This page describes how to stimulate a nanosim simulation with vectors, and how to have nanosim check if the output matches other vectors at specified times.
This example refers to several files in this directory.
.lib 'logic025.ns' TT
.inc 'count32.spi'
.tran 10p '100*ct'
set_sim_level 4
print_node_logic rst print_node_voltage q[0]
(is=vec) (en=count32.vec) (ot=in,rst,q[3],q[2],q[1],q[0]); (is=vec) (en=count32_2.vec) (ot=q[3-0]);Note that one can use multiple vector files.
nice -n 5 nanosim -n count32.sp count32.cmd -c count32.cfg -o count32The first part, 'nice -n 5', just runs the job at lower priority and can be omitted. Nanosim will run and generate a lot of chatter to the standard output (and also in count32.log)
radix 11 4 1111
io ii o oooo
; cr q qqqq
; le 3 3210
; os -
; ce 0
; kt
;
0 00 x xxxx ;comment
5 10 x xxxx
10 01 x xxxx
15 11 x xxxx
20 01 x xxxx
25 00 0 0000
30 10 0 0000
35 00 1 0001
40 10 1 0001
45 00 2 0010
50 10 2 0010
55 00 3 0011
60 10 3 0011
65 00 4 0100
70 10 4 0100
75 00 5 0101
80 10 5 0101
85 00 5 0101
The syntax should be obvious. Note that the nodes names run
vertically and ";" denotes the beginning of a comment. At the time
given in the left most column group, nanosim asserts in the inputs
(denoted by "i" in the io line) checks the outputs (denoted by "o" in
the io line; "x" = don't care). Values in the radix line set the node
types (1 = binary, 4 = hex, etc.)
85.00 1 1 1 0 q[1] 85.00 1 1 0 1 q[0]