Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > VHDL > simulation diff...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 6081 of 6417
Post > Topic >>

simulation differences in modelsim

by koyel.aphy@[EMAIL PROTECTED] Jun 15, 2008 at 06:27 AM

I have designed a unit that I am testing in modelsim. I did that in
two ways, first forcing the inputs from the object pull down menu of
the vsim window and clicking on the run command and second by writing
a test bench. However, I find that in the first case the inputs need
to arrive two clock pulses after the reset goes high as is also true
logically in my design whereas in the test bench, the outputs get the
correct values if the input enters one clock pulse after the reset
goes high else if it enters two clock pulses after the reset goes high
as in the first case then the last data sample is not written and the
output takes on the previous value. If I try to input data one clock
pulse after reset goes high in the first case as in the second case
then the last sample overwrites the previous last before the previous
last is out, which is also true logically.What is the problem with the
test bench?

This is a part of the test bench that reads the data depending on the
reset2 signal that has to be set high after one clock pulse, the reset
goes high else that causes problem as mentioned above. This is just a
signal I have used to control reading operation in the test bench.

readfile :PROCESS
	file inp1:TEXT open READ_MODE is "inp1.txt";
	file inp2:TEXT open READ_MODE is "inp2.txt";
	VARIABLE  inline1,inline2      : LINE;
	variable dat_var : std_logic_vector (11 DownTo 0);
   variable add_var : std_logic_vector (2 DownTo 0);
	BEGIN

    WAIT UNTIL (clock1 = '1' AND clock1'EVENT);
	 	IF  (NOT ENDFILE(inp1)) and reset2 = '1' then -----reading data
	   READLINE(inp1, inline1);
		READ(inline1, dat_var);
		datain1 <= dat_var;
      count_read <= count_read+1;

	END IF;
	IF  (NOT ENDFILE(inp2)) and reset2 = '1' THEN --------reading address

		READLINE(inp2, inline2);
		READ(inline2, add_var);
       write_add <= add_var;
        count_read <= count_read+1;
	END IF;
	end process readfile;
 




 8 Posts in Topic:
simulation differences in modelsim
koyel.aphy@[EMAIL PROTECT  2008-06-15 06:27:59 
Re: simulation differences in modelsim
Jonathan Bromley <jona  2008-06-16 22:25:04 
Re: simulation differences in modelsim
"jtw" <wrigh  2008-06-17 21:16:05 
Re: simulation differences in modelsim
"HT-Lab" <ha  2008-06-18 09:00:57 
Re: simulation differences in modelsim
koyel.aphy@[EMAIL PROTECT  2008-06-17 09:35:12 
Re: simulation differences in modelsim
Tricky <Trickyhead@[EM  2008-06-18 00:47:32 
Re: simulation differences in modelsim
Andy <jonesandy@[EMAIL  2008-06-18 16:14:00 
Re: simulation differences in modelsim
koyel.aphy@[EMAIL PROTECT  2008-06-19 00:19:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 16:31:51 CST 2008.