Hallo,
da ich mit der Simulation bzw. der korrekten Erzeugung eines Testbenchs
immer Schwierigkeiten hatte, habe ich versucht, eine Funkuhr ohne
Simulation zu programmieren.
Zum Testen habe ich anhand mehrerer LEDs den Zustand der einzelnen
Module überwacht. Allerdings ist der Code jetzt doch relativ
umfangreich geworden, abgesehen davon habe ich Schwierigkeiten mit der
Auswertung.
Deswegen werde ich um eine richtige Simulation wohl nicht herum kommen.
Zu meiner Frage:
Wenn ich ein Testbench Waveform in ISE erstelle, habe ich ja nur
eingeschränkte Möglichkeiten.
Wie kann ich sinnvoll ein TB erstellen? Müsste ich das von Hand
schreiben? Und, wie macht man das, dass man bestimmte Teile des
Programms so schreibt, dass Sie nur für den Simulator sichtbar sind,
und andere Teile, dass Sie nur für die Synthese sichtbar sind?
Das wäre besonders für meine Taktteilungen wichtig, da ich das
DCF-Signal mit 1 kHz abtaste, dies jedoch in der Simulation aufgrund
der Auslastung Unfug wäre.
Und ich will mir nicht jedes Mal neu überlegen, wie ich die Werte für
die Taktteilung und Auswertung ändern muss, wenn ich nur simulieren
möchte.
Viele Grüße
Andy
bestimmte teile kann man z.b. mit --pragma synthesis on/off für die
synthese ein und ausschalten soweit ich weiß.
die genauen pragmas und wie diese für ise bzw. modelsim lauten weiß ich
nicht genau. müsste aber irgendwo in dem pdf-dschungel etwas zu finden
sein.
generell wirst du um eine simulation mit tb nicht drum herumkommen.
hab im moment dasselbe problem. nur bei mir ists noch etwas
grundlegender (kann z.b. keine instanziierten komponenten vernünftig
simulieren).
wenn du den dcf mit 1 khz tastest kannst du doch einfach die auflösung
der tb ändern. müsste unter modelsim bei den projekteinstellungen
stehen. du brauchst ja keine pico-sekunden. kannst den ja einfach auf
us stellen und dann geht die simulation auch deutlich fixer.
tbs werden eigentlich immer von hand geschrieben.
bei der simulation hat man dann auch die ganzen möglichkeiten die sich
in der hardware nicht synthetisieren lassen (dateien, gleitkommazahlen,
prozeduren, wait anweisungen usw)
Hi,
I want to simulate a CAN softcore written in Verilog, using ISE
Simulator.
I know how to construct an input signal by constructing the waveform
provided by ISE simulator, however this method is not very efficient if
one wants to give a long bit sequence as input (I am talking about over
a 50 messages, each containing about 100 bits). However, it can be very
easily done if i can give an input signal using an input file or
something similar, in which i can list the input bytes and corresponding
timings or something similar.
I currently dont know of such a method and will highly appreciate if
someone can guide me about it.
Thanks and regards,
Zeeshan
in der Testbench kannst du wie im folgenden Beispiel Files einbinden
woraus dann die Inputs eingelesen werden können.
file Input_Signal_Name: text open read_mode is"textfile.txt";
The suggested command was:
file Input_Signal_Name: text open read_mode is"textfile.txt";
I wrote the following command in the Tcl Shell Window:
file rd_i: text open read_mode is"inputfile.txt";
(assuming I should write the name of the input signal in place of
'Input_Signal_Name' and name of the input text file in place of
"textfile.txt")
the response I get is:
bad option "rd_i:": must be atime, attributes, channels, copy, delete,
dirname, executable, exists, extension, isdirectory, isfile, join, link,
lstat, mtime, mkdir, nativename, normalize, owned, pathtype, readable,
readlink, rename, rootname, separator, size, split, stat, system, tail,
type, volumes, or writable
What am I doing wrong here ? How should I do it correctly ?
I have already tried to search for the "file" command, but couldn't find
anything helpful.
Thanks.
write the following line direct into the architecture of the
VHDL-testbench file. not in a TCL-script.
file Input_Signal_Name: text open read_mode is"textfile.txt";
with commands like "read" or "readline" can you read from the file.
Can you point to some reading/help material, which lists and explains
the commands (like the "read" and "readline" mentioned by you) related
to VHDL Testbench file programming.
Thanks again.
i have found these commands in an automatic generated testbench were all
stimuli and results are in external ascii-files.
the important parts of the testbench are following:
Thanks for the example code...
Can you kindly send the complete testbench ?
I will need it to understand e.g. the role of some of the temp variables
etc.