Email: bknpk@hotmail.com Phone: +972-54-7649119
V

 

ASIC/FPGA Design and Verification Out Source Services

Back to Simili VHDL simulator with a random.



  1. As part of an evaluation to Simili simulator, I tried to compile a VHDL random module.
    The original page is page

  2. 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.


    1. ...
    2. architecture Behavioral of random is
    3.   --Pini
    4.   constant temp_c : std_logic_vector(width-2 downto 0):=
    5.   (others => '0');
    6. begin
    7.   process(clk)
    8.     variable rand_temp : std_logic_vector(width-1 downto 0):=
    9.     '1' & temp_c;
    10.   --Pini
    11.   --(width-1 => '1',others => '0');
    12.     variable temp : std_logic := '0';
    13.     begin
    14.     if(rising_edge(clk)) then
    15.       temp := rand_temp(width-1) xor rand_temp(width-2);
    16. ...

  3. The modified code can be downloaded from: code



  4. 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:
    1. 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.

    2. 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:

      1. function f_to_pos (n : integer) return integer is
      2.   variable r : integer;
      3. variable my_line : line;
      4. begin
      5.   if( n < 0) then
      6.     write(my_line, string'("f_to_pos "));
      7.     write(my_line, n);
      8.     write(my_line, string'(" at "));
      9.     write(my_line, now);
      10.     writeline(output, my_line);
      11.     r := 0;
      12.   else
      13.     r := n;
      14.   end if;
      15.   return r;
      16. end f_to_pos;




  5. The following shows a script to use vhdle (simulation script):
    1. #!/bin/bash

    2. #-p no timing display to speed simulation
    3. #presently limit the simulation from running too long
    4. vhdle -nostderr -breakon error -do a.do -p -t 50us TB | tee vhdle.log
    5. if [ -e "simili.lst" ] ; then
    6.   ~/bin/lst2vcd simili.lst simili.vcd
    7.   if [ -e "simili.vcd.gz" ] ; then
    8.     rm -f simili.vcd.gz
    9.     gzip simili.vcd
    10.   fi
    11. fi


Home

SD slave with Samsung flash (k9f1208) (vhdl project).






Search This Site


Feedback This Site




new pages on this site