ASIC/FPGA Design and Verification Out Source Services
All about printing the instance name from a VHDL component.
- While it is simple in VERILOG (%m in the display system function), in VHDL a bit more code writing is required.
$display("dbg instance name %m at %d", $time);
An example how to print an instance name in systemc is also available on this site.
- The importance of such debug information is when a design contains many instances of the very same component.
- First text IO library has to be called and line variable should be declared. Please refer to print example to see details.
- Next you have to select between two options: One is: instance name only in debug string and the other option gives more information such as entry and architecture names.
- Syntax example is given below:
- if(newByte = '1') then
- write (my_line, string'("path "));
- write (my_line, clk'path_name);--short
- write (my_line, string'(" "));
- writeline(output, my_line);
- write (my_line, string'("inst "));
- write (my_line, clk'instance_name);--long
- write (my_line, string'(" "));
- writeline(output, my_line);
- The code was tried on the free GHDL simulator. GHDL output follows:
- path :ip_stack_tsb:u_dut:mas:crcgenethrec:clk
- inst :ip_stack_tsb(bhv):u_dut@stack(stack_arch):mas@ethernet(ethernet_arch):crcgenethrec@crcgenerator(crcgenerator_arch):clk
Contact me now at: |