If you insist on using variables you will come up a lot of resistance - Using them is seen as "bad form" and make people think of you as a converted software programmer, not someone who thinks in circuits.
delay:=delay(3 downto 0) & rdempty_sig;
if ldma_rdy = '1' and delay="00000" and poscnt<1024 then
Adding delay to the empty flag will just make things worse.
original empty flag to read relationship.
Your variable based shift register behaves differently than you describe.well unfortunately that's what I am and I don't think that I'll become a good FPGA circuit designer that quickly.
I'm trying to study that area and pick up information.
The books just said that signals are only required to interconnect processes, while variables are used for local processes (they didn't mention anything about that those are not preferred). Anyway I picked it up thanks.
But it still doesn't solve my original problem.
delay:=delay(3 downto 0) & rdempty_sig;
if ldma_rdy = '1' and delay="00000" and poscnt<1024 then
I still don't get it, because closer to the end of the buffer "delay" would be 00001 -- meaning it would not read anything from the dcfifo, it continues... 00010 ... still not reading (still delaying) 00100 again .. it would delay the whole read quite a few cycles until 1 disappears in the std_logic_vector until enough data is stacked up in the fifo.
Since the output (12 MHz) is running faster than the input (5 MHz) this should not be a problem?
However it doesn't work as mentioned so there is a problem and indeed I don't understand the circuit...
However it doesn't work as mentioned so there is a problem and indeed I don't understand the circuit...
Please - use a simulator. You'll likely get the problem fixed within a day.
cycle 0: empty = 0, read = 0, next_empty = 0, next_read = 1 // empty is 0, so next_read is 1.
cycle 1: empty = 0, read = 1, next_empty = 1, next_read = 1 // empty is 0, so next_read is 1. read is 1, so next_empty is 1
cycle 2: empty = 1, read = 1, next_empty = 1, next_read = 0 // fifo is empty, but read is 1. fifo underflow.
cycle 0: empty = 0, read = 0, next_empty = 0, next_read = 1 // empty is 0, so next_read is 1.
cycle 1: empty = 0, read = 1, next_empty = 1, next_read = 1 // empty is 0 but read is 1, so next_read is 0. read is 1, so next_empty is 1
cycle 2: empty = 1, read = 0, next_empty = 1, next_read = 0 // fifo is empty.
I tried that but didn't get very far...
Since I'm new to this I tried following tutorial
https://www.youtube.com/watch?v=qZNL1C0TwY8 (but selected VHDL and selected 10ms / 20ms / 40ms)
Is there a 1ms limitation with Modelsim Starter?
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 entity some_tb is end entity some_tb; -- no IO, because it's a testbench architecture test of some_tb is constant CLK_PERIOD : time := 10 ns; -- this is nice and easy to read on the wave viewer signal clk : std_logic := '1'; signal rst : std_logic; signal ips : std_logic_vector(7 downto 0); signal ops : std_logic_vector(7 downto 0); procedure wait_for_clks( n : integer := 1) is begin for i in 1 to n loop wait until rising_edge(clk); end loop; end procedure wait_for_clks; begin -- clock and reset generation rst <= '1', '0' after 3.5 * CLK_PERIOD; clk <= not clk after CLK_PERIOD; -- the Design under test DUT_inst : entity my_lib.my_ent port map ( ---ips.. -- ops ) stim_proc : process begin ip <= x"00"; wait until rst = '0'; wait_for_clks; ip <= x"0A"; wait_for_clks(10); ip <= x"FF"; wait_for_clks(1000); ip <= x"A5"; wait; -- end testbench end process; end architecture;
Can someone fix the Picture uploading?
"error: Upload failed due to failure writing temporary file."
"error: Upload failed due to failure writing temporary file."
Edaboard Error
That shows how to generate a testbench from an input waveform - not really that useful in the long run. You have much more control generating these things in code.
There is no time limitation in modelsim stater (maybe if you're hand drawing a waveform). It just has a 10000 line limit, after which it runs really slowly.
a basic testbench would be something like:
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 entity some_tb is end entity some_tb; -- no IO, because it's a testbench architecture test of some_tb is constant CLK_PERIOD : time := 10 ns; -- this is nice and easy to read on the wave viewer signal clk : std_logic := '1'; signal rst : std_logic; signal ips : std_logic_vector(7 downto 0); signal ops : std_logic_vector(7 downto 0); procedure wait_for_clks( n : integer := 1) is begin for i in 1 to n loop wait until rising_edge(clk); end loop; end procedure wait_for_clks; begin -- clock and reset generation rst <= '1', '0' after 3.5 * CLK_PERIOD; clk <= not clk after CLK_PERIOD; -- the Design under test DUT_inst : entity my_lib.my_ent port map ( ---ips.. -- ops ) stim_proc : process begin ip <= x"00"; wait until rst = '0'; wait_for_clks; ip <= x"0A"; wait_for_clks(10); ip <= x"FF"; wait_for_clks(1000); ip <= x"A5"; wait; -- end testbench end process; end architecture;
I have been trying for quite some time now but Quartus won't give me any output files into modelsim/rtl_work
The youtube video works okay (except that modelsim is not generating any appropriate vhdl code for the waveforms which obviously is a bug in QII 13.01, I'm using a Cyclone II so I can't go higher). However if I try to reproduce this with my other testproject it doesn't work.
Modelsim only shows up:
work (empty) path rtl_work
rtl_work (empty)
and indeed the directory is almost empty, there's only _temp and _info in it.
Quartus II shows up the top level vhdl file in the Design Units tab on the left side below "work"
I have also compared the settings between my project and the youtube sample project (which also works locally) but I couldn't find any difference so far.
does anyone know how to fix that?
----
ok got it ... there was an error in the vhdl code referencing to a non existing library (while the Analysis & Synthesis did not complain about it Modelsim did). I fixed that now and will try to continue to build the testbench
#compile the code
vcom my_entity.vhd
vcom my_testbench.vhd
vsim my_testbench
# set the simulation time, or if you have a self checking testbench, do run -all
run 10 us
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?