Using the Verilog Simulator to Generate IRSIM .cmd Files We will be using the functional models we developed in Verilog to create IRSIM .cmd files (recall that .cmd files are batch files of IRSIM commands that you can run on .sim files created from Magic layouts). In Verilog, we have working modules for the datapath as well as the controller, clock generator, and pattersource generator. By using a special version of Verilog to simulate these modules and by using a special "snooper" module, we can run the same simulation on our extracted Magic layout of the datapath with the appropriate input assertions automatically generated by the .cmd file. The output of the datapath (namely, the bus) from the Verilog simulation will be compared with the output of the IRSIM simulation of the datapath generated in Magic, and differences will be noted when running the .cmd file. Here is the procedure: 1. Create the snooper module with the snoopgen program. The input to the snoopgen program must be a file of inputs, outputs, and bidirectional signals. This file has already been created and is called datapath.in. You will not need to change this file UNLESS your IRSIM names (often the labeled signal name in your Magic layout on the top level) are different from the signal names in the Verilog modules. Here is an example of how datapath.in needs to be modified: i readReg_s1 readregfile where readReg_s1 is the Verilog name and readregfile is the IRSIM name. For vectors, only put the range on the Verilog name. i bibus_v1[3:0] irsimbibus To create the snooper module, execute the following command: snoopgen datapath.in > snooper.v snooper.v has already been created for the existing datapath.in and the snoopgen program is in the hw6 directory. 2. Instantiate the snooper module somewhere. THIS HAS ALREADY BEEN DONE in system.v. Usually, you will want to instantiate the snooper module within the module you are checking (datapath.v) or the next one above it (system.v). In either case, the snooper module must have easy access to the nodes it needs, the inputs and outputs of the datapath. 3. Run rsimverilog. rsimverilog is a special version of Verilog that we need for our purposes here. Remember that our machine is executing the simple set of instructions in input.patterns. As we are running our simulation in rsimverilog, it is creating a file called versim.cmd which is the .cmd file we will be using in our IRSIM simulation. Therefore, it may be a good idea to run rsimverilog for a fixed period of time using the interactive mode of simulation. Here is how rsimverilog should be called: rsimverilog -s *.v (you will see messages pass by ...) C1> #1000 $stop; C2> . (simulation will run until time 1000) 4. Run IRSIM. Before running versim.cmd on your datapath.sim file, you may want to set up the analyzer window and create necessary vectors first. Remember that @ versim.cmd is the command for running a command file. The simulation will run and you will see whether your datapath design has made any output assertion errors. If so, find out why. For more detailed information on this procedure, read snoopgen.doc which is also in this directory.