diff --git a/hdl/fpga/ip/nuand/time_tamer/modelsim/compile.do b/hdl/fpga/ip/nuand/time_tamer/modelsim/compile.do index 00471e56..c23bf247 100644 --- a/hdl/fpga/ip/nuand/time_tamer/modelsim/compile.do +++ b/hdl/fpga/ip/nuand/time_tamer/modelsim/compile.do @@ -1,6 +1,24 @@ +# Create work library vlib nuand + +# Compile design files vcom -work nuand -2008 ../../synthesis/synchronizer.vhd vcom -work nuand -2008 ../../synthesis/handshake.vhd vcom -work nuand -2008 ../vhdl/time_tamer.vhd vcom -work nuand -2008 ../vhdl/tb/time_tamer_tb.vhd + +# Elaborate design +vsim nuand.time_tamer_tb + +# Add waves +add wave -hexadecimal sim:/time_tamer_tb/U_tamer/clock +add wave -hexadecimal sim:/time_tamer_tb/U_tamer/reset +add wave -hexadecimal sim:/time_tamer_tb/U_tamer/ts_clock +add wave -hexadecimal sim:/time_tamer_tb/U_tamer/ts_reset +add wave -hexadecimal sim:/time_tamer_tb/U_tamer/timestamp +add wave -hexadecimal sim:/time_tamer_tb/U_tamer/compare_time +add wave -hexadecimal sim:/time_tamer_tb/U_tamer/check_compare/fsm + +# Run +run -all diff --git a/hdl/fpga/ip/nuand/time_tamer/vhdl/tb/time_tamer_tb.vhd b/hdl/fpga/ip/nuand/time_tamer/vhdl/tb/time_tamer_tb.vhd index b8dccddb..1736f846 100644 --- a/hdl/fpga/ip/nuand/time_tamer/vhdl/tb/time_tamer_tb.vhd +++ b/hdl/fpga/ip/nuand/time_tamer/vhdl/tb/time_tamer_tb.vhd @@ -10,7 +10,7 @@ architecture arch of time_tamer_tb is signal clock : std_logic := '1' ; signal reset : std_logic := '1' ; - signal addr : std_logic_vector(4 downto 0) ; + signal addr : std_logic_vector(4 downto 0) := (others => '0'); signal din : std_logic_vector(7 downto 0) ; signal dout : std_logic_vector(7 downto 0) ; signal write : std_logic := '0' ; diff --git a/hdl/fpga/ip/nuand/time_tamer/vhdl/time_tamer.vhd b/hdl/fpga/ip/nuand/time_tamer/vhdl/time_tamer.vhd index bd54850e..fe42931a 100644 --- a/hdl/fpga/ip/nuand/time_tamer/vhdl/time_tamer.vhd +++ b/hdl/fpga/ip/nuand/time_tamer/vhdl/time_tamer.vhd @@ -51,7 +51,7 @@ architecture arch of time_tamer is signal timestamp : unsigned(63 downto 0) ; - signal compare_time : unsigned(63 downto 0) ; + signal compare_time : unsigned(63 downto 0) := (others => '0'); signal mm_clear_compare : std_logic ; signal mm_compare_cleared : std_logic ; @@ -304,7 +304,7 @@ begin end if ; when WAIT_FOR_COMPARE => - if( compare_time <= timestamp ) then + if( compare_time = timestamp ) then ts_time_trigger <= '1' ; ts_compare_loaded <= '0' ; fsm := WAIT_FOR_CLEAR ;