Frequently Asked Questions: Difference between revisions

From Cpre584
Jump to navigation Jump to search
Ogamal (talk | contribs)
No edit summary
Ogamal (talk | contribs)
No edit summary
Line 1: Line 1:
== General FAQ ==
== General FAQ ==


=== How to start my own custom personality project? ===
==== How to start my own custom personality project? ====
Use the '''cnyScript''' as described in this tutorial: [[Convey PDK Tutorial]]
Use the '''cnyScript''' as described in this tutorial: [[Convey PDK Tutorial]]


Line 10: Line 10:
== Simulator Related ==
== Simulator Related ==


=== Where can I find the personality signals? ===
==== Where can I find the personality signals? ====
You can find your custom personality signals in the "sim" window in ModelSim under <code>testbench > cae_fpga0 > ae_top > core > cae_pers</code>
You can find your custom personality signals in the "sim" window in ModelSim under <code>testbench > cae_fpga0 > ae_top > core > cae_pers</code>


Line 24: Line 24:
Finally, click the "open" button and open the "vsim.wlf" file in the "sim" directory of your project.
Finally, click the "open" button and open the "vsim.wlf" file in the "sim" directory of your project.


=== How to run Modelsim GUI while simulating? ===
==== How to run Modelsim GUI while simulating? ====
You may run the simulation in interactive mode by adding the following line to the makefile in the sim directory:
You may run the simulation in interactive mode by adding the following line to the makefile in the sim directory:


Line 58: Line 58:
== Emulator Related ==
== Emulator Related ==


=== How to read AEG registers in the emulator? ===
==== How to read AEG registers in the emulator? ====
You can use the following function:
You can use the following function:
<code>
<code>
Line 64: Line 64:
</code>
</code>


=== How to read/write the memory in the emulator? ===
==== How to read/write the memory in the emulator? ====
You can use the functions AeMemLoad and AeMemStore to read and write from/to the memory as follows:
You can use the functions AeMemLoad and AeMemStore to read and write from/to the memory as follows:



Revision as of 01:14, 8 February 2013

General FAQ

How to start my own custom personality project?

Use the cnyScript as described in this tutorial: Convey PDK Tutorial

How to add new verilog files or directories to a PDK project?

By default, the PDK looks like the project/verilog directory and compiles all .v files found there. To add other Verilog directories, use this makefile variable:
USER_VERILOG_DIRS += ../../verilog

Simulator Related

Where can I find the personality signals?

You can find your custom personality signals in the "sim" window in ModelSim under testbench > cae_fpga0 > ae_top > core > cae_pers

How to keep the waves I simulated?

After adding the signals to the wave window, make sure to click anywhere in the waves window. Then, click the save button and save the current signals as "do" file. Next time you want to show the previous signals, open ModelSim using the command:

vsim &

Then, in the ModelSim command-line, type:

do sim/wave.do

Finally, click the "open" button and open the "vsim.wlf" file in the "sim" directory of your project.

How to run Modelsim GUI while simulating?

You may run the simulation in interactive mode by adding the following line to the makefile in the sim directory:

USER_SIM_OPTIONS = -gui

Another option is to edit the test bench (sim/tb_user.v shown below) to dump the waveforms to a file, then run the hardware simulator via command line, and finally open up the waveform file (vsim -v ./sim/vsim.wlf). This has the benefit of dumping all the signals (if your wave.do file was missing something, you'd have to rerun the simulation).

`timescale 1 ns / 1 ps

module tb_user();

  initial begin
    // Insert user code here, such as signal dumping
    // set CNY_PDK_TB_USER_VLOG variable in sim/makefile
`include "PDK_SIM_CONFIG.vh"
`ifdef AE0_PRESENT
    $wlfdumpvars(5,testbench.cae_fpga0.ae_top.core.cae_pers);
`endif
`ifdef AE1_PRESENT
    $wlfdumpvars(5,testbench.cae_fpga1.ae_top.core.cae_pers);
`endif
`ifdef AE2_PRESENT
    $wlfdumpvars(5,testbench.cae_fpga2.ae_top.core.cae_pers);
`endif
`ifdef AE3_PRESENT
    $wlfdumpvars(5,testbench.cae_fpga3.ae_top.core.cae_pers);
`endif
  end

endmodule

Emulator Related

How to read AEG registers in the emulator?

You can use the following function: uint64 AegRead(int aeId, int aegIdx);

How to read/write the memory in the emulator?

You can use the functions AeMemLoad and AeMemStore to read and write from/to the memory as follows:

bool AeMemLoad (int aeId, int mcId, unint64 addr, int size, bool bSigned, uint64 &data);
bool AeMemStore (int aeId, int mcId, unint64 addr, int size, bool bSigned, uint64 &data);