- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I wonder if what I've in mind is possible.
Imagine I've a 64bit counter that rolls to 0 when the count is 64'hFFFFFFFFFFFFFF0. The counter is described in Verilog code. The counter has no signal to load a particular counter value. I want to simulate counter behaviour and test if it resets when expected. I don't want to simulate 2^64 clock cycles foroabvious reasons. Is there a way to write a tesbench that, at a certain simulation point, sets a particular value in the register of the counter? My question is then: is it possible, in simulation, to set a particular state in the circuit under test? As example, is it possible to put a finite state machine in a not defined state, to check it's behaviour? Thx for your help. P.S. Is this the correct forum for Verilog questions? Do you know a more adequate one?Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can take a look at the ModelSim force command, or right click the signal in the Objects window to look for the Force window
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I solved the problem using Verilog.
The command that should be used is 'force' followed by 'release'. Here's a snmipset of the code:
initial
begin
reset=1;{read_write, ready, write_OK}=3'b000;# period;
reset=0;{read_write, ready, write_OK}=3'b000;# (2*period);
{read_write, ready, write_OK}=3'b010;# period;
{read_write, ready, write_OK}=3'b001;# period;
// ac_state is the name of the internal node
force UUT.ac_state = 5'b00000;# period;
release UUT.ac_state;# (3*period)
$stop;
end
endmodule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for the tip
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page