Can a testbench take data from a separate file?

7 views
Skip to first unread message

peter.t...@gmail.com

unread,
Mar 11, 2021, 3:11:53 AM3/11/21
to Clash - Hardware Description Language
I need to initialize the memory in the device under test with different patterns.
 Patterns of interest range from about 1000 to 180000 bytes in size.
In real life the initial state of the memory is (pre) programmed.
Is there a way of writing a testbench function such that the generated HDL code will take this initial state from a file?  Is there perhaps a TH function that will produce the file content as a  constant initial vector for the testbench synthesis.

If not, what is recommended?

Regards

PTB

Christiaan Baaij

unread,
Mar 11, 2021, 5:07:03 AM3/11/21
to clash-l...@googlegroups.com
That page also describes the (space-inefficient) file-format used by the VHDL/Verilog simulators, which is ASCII-encoded binary.

also describes how to generate these files from constants at compile-time using TH

--
You received this message because you are subscribed to the Google Groups "Clash - Hardware Description Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clash-languag...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clash-language/62ab50d2-0e32-49a6-975e-67c8d7d47945n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages