What follows is some information regarding our general approaches
(i.e. "which parser to use when") that we have taken with loading models
into
the simulator.
Because verilog allows for structural and behavioral model
descriptions, (not to mention multiple modules in one file),
there are a good variety of verilog files you may come across,
each of which may have to be parsed differently so the simulator
can ultimately make use of it.
In general with purely structural models, we translate them
into *.dee files and LOAD them into the simulator. However,
if a file is purely behavioral in nature, we want to convert
it to a C file, add it into the simulator's library of
"pre-fabricated" models, and then TEST it by creating a structural
verilog file which invokes an instance of the behavioral element.
As you will see, there are many varieties of verilog models and
there isn't always just one easy answer on how to approach a
translation.
I know this might sound a bit confusing, but bear with me.
I will try to describe things clearly, and I hope you will continue to
email me
with any questions/comments/problems you have.
For starters, here are the main Parsing Tools at your disposal,
and when you might want to use them:
//------------------------------------//
BEHAVORIAL PARSER
"Mike's Parser" - This parser converts behavioral verilog input to
C output code.
This C output code can then be added to the simulator (via eval.c -
see the tutorial on the simlab website).
The full path to this parser is:
/home/mattioli/parse/Behave_test/parser
the code for the parser is
in the same directory and called:
verilog.lex
verilog.yacc
when the file "makefile" is run, (use the command "make"),
the parser is compiled into the executable file, "parser"
//------------------------------------//
Now that we've covered the way purely behavioral files
are loaded into the simulator, let's look at structural
files:
The simplest structural files are single-level (i.e., NOT
multimodule verilog files). For these, simply use the
structural parser (Ben's parser) to convert them into *.dee
files which will load directly into the simulator).
The structural parser is located at:
/groups/sim/Tools/Struct_parser/Source.mult_output
//------------------------------------//
BUT wait! What about structural files which are multi-level?
Well, here's how we can get those to load as well:
Let's say you have a multilevel structural verilog file.
Using the following system, this file can be converted
into a *.dee that will load directly into the simulator:
multilevel structural verilog goes in...
1. "ver" will "flatten" the multilevel model into a giant
netlist. The netlist file is similar to a structural verilog
file, but first, it must be tweaked...
2. "fix", a small script I wrote seems to do this well.
Run the file through this script to make it ready for
further conversion.
3. "arch_parser" is the tool that REALLY converts the flattened
netlist into a structural verilog file ("fix" could really
be merged with arch_parser). Anyhow, this parser is written
in lex and yacc and converts the flattened netlist to
a giant structural verilog file.
4. "struct_parser" (also known as Ben's parser) can now be run
in order to convert the structural verilog file into
a *.dee which will load directly into the simulator.
To Check out these files, head over to: /groups/sim/Tools/multilev_parser
//------------------------------------//
So, to sum things up:
if your model is:
structural (single-level):
use the structural parser and load the model
/groups/sim/Tools/Struct_parser/Source.mult_output
structural (multi-level):
use the multilevel system described above.
(finish with the structural parser and load the model.)
/groups/sim/Tools/multilev_parser
behavioral (single-level):
use the behavioral parser and add the C code to
the simulator as a behavioral block (see the simlab
website for details on this).
/home/mattioli/parse/Behave_test/parser
behavioral (multi-level):
This ability can be added to the behavioral parser.
structural AND behavioral,
single OR multilevel (!):
So-called mixed models are a bit tough. Although
individual cases may vary, try using the multi
level system described above to get these going.
//------------------------------------//
Now here's something interesting: The "ver" program (although mainly
used for flattening multilevel structural files), also can handle some
behavioral code. To learn more about using this (perhaps in place of the
behavioral parser?), check out the website related to "ver",
http://daggit.pagecreator.com/ver/
also, the tar file of ver is located in the multilevel directory:
/groups/sim/Tools/multilev_parser
//------------------------------------//