Download GEZEL User Manual

Transcript
Simulating standalone GEZEL designs
$dp
$hex, $bin, $dec
$finish
$trace(expression, “file.txt”);
$trace
$option “string”
April 21, 2005 10:39 am
The debug flag
Used as a $display argument.
Returns the name of the current datapath.
Used as a $display argument.
Changes the base of the next argument to hexadecimal,
binary, or decimal.
Used inside of an sfg.
Aborts the simulation.
Used after register/signal definitions in dp.
Records value of expression each clock cycle in
file.txt
Used as an instruction in an FSM state transition.
Echoes the state transision to the screen.
Includes optional simulator profiling. string is one of
debug, vcd,
profile_toggle_upedge_cycles,
profile_toggle_alledge_operations,
profile_toggle_upedge_operations,
profile_toggle_alledge_cycles
(See below for details)
4.4 The debug flag
The main use of the GEZEL standalone simulator is validation of your GEZEL designs. In
fact, before taking any GEZEL code into a cosimulation (as will be discussed later), it is a
good idea to verify the design first in a small standalone simulation.
fdlsim provides a debug mode-of-operation that can be enabled using the -d flag on the
command line. The effect of the -d flag is twofold:
• It will print out the GEZEL symbol table in a file called fdl.symbols.
• For each clock cycle, it will print out all register changes in the datapaths and controllers using a value-change format. This means that, if a register is not changing in a particular clock cycle, it will not be printed.
The use of the debug flag will be illustraed on the Galois Field Multiplier from Section 3.5
on page 28. A small testbench was added after line 50 to multiply (1101) with (1001).
Also, various directives were added in the simulation, such as on lines 7 (trace), 20 and 25
(display), 26 (finish) and 42 (trace).
LISTING 11. A Galois Field multiplier testbench
1. dp gfmul( in fp, i1, i2 : ns(4); out mul: ns(4);
2.
in mul_st: ns(1);
3.
out mul_done : ns(1)) {
4.
reg acc, sr2, fpr, r1 : ns(4);
Schaumont, Ching
GEZEL User Manual
35