ASIC/FPGA Design and Verification Out Source Services
Back to Simili VHDL simulator with a random.
-
As part of an evaluation to Simili simulator, I tried to compile a VHDL random module.
The original page is
page
-
The code did not compile as is from the web site. Simili did not like the way the variable is initialized.
A slight code modification did it well.
- ...
- architecture Behavioral of random is
- --Pini
- constant temp_c : std_logic_vector(width-2 downto 0):=
- (others => '0');
- begin
- process(clk)
- variable rand_temp : std_logic_vector(width-1 downto 0):=
- '1' & temp_c;
- --Pini
- --(width-1 => '1',others => '0');
- variable temp : std_logic := '0';
- begin
- if(rising_edge(clk)) then
- temp := rand_temp(width-1) xor rand_temp(width-2);
- ...
-
The modified code can be downloaded from:
code
-
In another project, using simili, I needed to work on
a flash model from FMF. During the debug simili proved
to be better than GHDL:
- While GHDL crashes on Segmentation fault, simili
reported an invalid parameter used in vital function:
VitalPathDelay01 ...
--Commented out by Pini
--IgnoreDefaultDelay => TRUE,
GHDL also crashed (segmentation fault) also on a generic, which was initialized with the following string "*".
I re-write the code to the following:
InstancePath :STRING := "kuku";
Another option, which proved excellent in debug, is --ttace-processes.
It printed the offending process, which first removed (memory pre-load) and later fixed.
-
Next was much more difficult to debug and fix. The
FMF model used some arrays of 0 to 3. The index,
which was used is an integer with range starting with
-1. This caused also vhdle simulator to crash, but it
did give a clue that an access of -1 to range of 0 to
3 is not allowed.
Although not giving the line number, it was enough
to debug. I created a function to convert negative
numbers to 0 and used it instead:
- function f_to_pos (n : integer) return integer is
- variable r : integer;
- variable my_line : line;
- begin
- if( n < 0) then
- write(my_line, string'("f_to_pos "));
- write(my_line, n);
- write(my_line, string'(" at "));
- write(my_line, now);
- writeline(output, my_line);
- r := 0;
- else
- r := n;
- end if;
- return r;
- end f_to_pos;
-
The following shows a script to use
vhdle (simulation script):
- #!/bin/bash
- #-p no timing display to speed simulation
- #presently limit the simulation from running too long
- vhdle -nostderr -breakon error -do a.do -p -t 50us TB | tee vhdle.log
- if [ -e "simili.lst" ] ; then
- ~/bin/lst2vcd simili.lst simili.vcd
- if [ -e "simili.vcd.gz" ] ; then
- rm -f simili.vcd.gz
- gzip simili.vcd
- fi
- fi
|