When i simulated a 4-bit serial shift register at Xillinx ISE 13.2 program, i get these wave forms. The problem is that all 4 bits are changed at the same time (no Shifting was happen ). I need to know the problem is in the code or the simulator ?
Code:
Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
libraryieee;useieee.std_logic_1164.all;entity SR isport( clk,rst,d :instd_logic;
q:outstd_logic_vector(3downto0));end SR;architecture SR of SR issignal qs:std_logic_vector(3downto0);beginprocess(clk,rst)beginif rst='1' then qs<="0000";elsif clk'eventand clk='1' then
qs(3)<=d;
qs(2downto0)<=qs(3downto1);endif;endprocess;
q<=qs;end SR;
I agree with you FVM. Rst should be 0 at start but after some time it should go to high.
I though waveform has been shared after running the test bench.
The OP is showing simulation output at 4us and 5us out from the begining, might be they do have a testbench that is doing something but it's likely doing it near the beginning of the simulation and they are letting it run 400,000 times farther then needed (based on the clock period and the current simulation time).
Also who runs an FPGA simulation with a 10 ps period clock!? What FPGA runs at 100 GHz!? Maybe the OP should learn how to use a simulator by using the venodor's tutorials. Seems like they have the simulator setting for the timescale all messed up.
Thanks all for your replies.
I used "force" method in the simulation (right click and force constant), i didn't use test bench method. By the way i simulated the code in Modelsim software and i get what i want. Now i want to know is Xillinx working well only using test bench method ?
Thanks all for your replies.
I used "force" method in the simulation (right click and force constant), i didn't use test bench method. By the way i simulated the code in Modelsim software and i get what i want. Now i want to know is Xillinx working well only using test bench method ?
If I understand what you are saying by "Xillinx working well only using test bench method". A Xilinx based design (or a design done in any vendors tools) doesn't require a test bench.
Verifying the functionality requires testing, if you test before you implement by running a simulation then using a test bench makes it easier to test complicated designs in a repeatable fashion, which your force method doesn't allow an easy method to do the same.
The simple brute force test bench just assigns inputs to a DUT advances the simulator time, applies new inputs to the DUT, advances time, etc (repeating), until the end of the inputs you want to apply. More advanced test benches will use BFM (bus function models) to stimulate the design , capture DUT outputs, check output results, etc.