3538 - Diamond / EBR: Is there an easy way to modify some Embedded Block RAM (EBR) data before running bitgen with encryption enabled?

3538 - Diamond / EBR: Is there an easy way to modify some Embedded Block RAM (EBR) data before running bitgen with encryption enabled?

Solution:
To modify the Embedded Block RAM (EBR) data through command line, use medit command.

User can follow below steps-

1. Load the test project and check the path by using the "pwd" command in Tcl Console. By default, it navigates to the /test directory (for example D:/test; this may differ in various machines).

Change the path to point to the "impl" directory, such as D:/test/test.

As an example, before updating the path, you were in D:/test. After cd test ("impl" directory of project) you will have D:/test/test.

Note: The path changes depending on where you locate the project.

2. Once you are in the implementation directory, use the following command to find out the instance name.

Command syntax: (ncdread [ [-o ]). For example ncdread test_test.ncd -o ncdout.out

Wait for “ncdout.out” to be generated and search for the instance name. (For the procedure on how to find the 
instance name, check the “Reading NCD files” section of the Diamond Help).

3. Once the instance name is found, use the command below to update the memory content.

Command syntax: medit [-i ] [-o ] [-format ] [] [] []. For example: medit -I <instance name> -o newncd.ncd -format BIN init.mem test_test.ncd t2.lpc

After running the above command, you should be able to see the updated *.ncd file with the “newncd.ncd” file name.

4. With the new updated ncd file, you can generate the bitstream with encryption option.

You can also create a simple batch script and run it with the test project to edit Memory Content, generate an ncd and with the updated ncd, generate an encrypted bitstream *.bat is located in the test project file directory.