Platform Studio

Accessing SmartModel's Internal Signals


The lmcwin Command

The lmcwin command has the following options:

lmcwin read

lmcwin read <window_instance> [-<radix>]

The lmcwin read command displays the current value of a window. The optional radix argument is -binary, -decimal, or -hexadecimal, and can be abbreviated.

lmcwin write

lmcwin write <window_instance> <value>

The lmcwin write command writes a value into a window. The format of the value argument is the same as that used in other simulator commands that take value arguments.

lmcwin enable

lmcwin enable <window_instance>

The lmcwin enable command enables continuous monitoring of a window. The specified window is added to the model instance as a signal (with the same name as the window) of type std_logic or std_logic_vector. You can then reference this signal in other simulator commands as with any other signal.

lmcwin disable

lmcwin disable <window_instance>

The lmcwin disable command disables continuous monitoring of a window. The window signal is not deleted, but it no longer updates when the model’s window register changes value.

lmcwin release

lmcwin release <window_instance>

Some windows are actually nets, and the lmcwin write command behaves more like a continuous force on the net. The lmcwin release command disables the effect of a previous lmcwin write command on a window net.

Viewing PowerPC Registers in ModelSim

You can enable and view the contents of PowerPC™ registers during simulation. The lmc command provides access to the PowerPC SmartModel. This section provides some examples of the command usage.

Note The InstanceName path below is an example only. You should replace <InstanceName> with the path that matches your design.

To see the SmartModel Status Report, type:

VSIM> lmc -all reportstatus

This lists all available registers and shows the full instance name path to the SmartModel. For example,

# InstanceName: /system/ppc405_i/ippc405_swift/ppc405_swift_inst

To enable a register to be read, type:

VSIM> lmcwin enable <InstanceName>/GPRO

This enables GPR0 to be read. You must enable each register to which you want access.

To read the value of a register, type:

VSIM> examine <InstanceName>/GPR0

To add a register to the wave window, use

VSIM> add wave <InstanceName>/GPR0

Using ModelSim Helper Scripts for Viewing PowerPC Registers

In addition to the compile script for compiling simulation models, EDK generates ModelSim helper scripts to simplify simulator set up. When run, the scripts define commands to compile and load a design or test harness and to display wave forms, including PowerPC registers.

If the design or test harness name is system, EDK generates a system.do compile script and the following helper scripts:

system_setup.do (defines new commands)

system_wave.do (runs wave.do scripts created for each instance)

system_list.do (runs list.do scripts created for each instance)

For designs containing a PowerPC instance ppc405_i, the following scripts are created for displaying registers:

ppc405_i_regint_wave.do (display internal PowerPC register wave forms)

ppc405_i_regstd_wave.do (display standard PowerPC register wave forms)

ppc405_i_regint_list.do (display internal PowerPC register list)

ppc405_i_regstd_list.do (display standard PowerPC register list)

To run helper scripts, start the ModelSim simulator and type the following at the command prompt:

ModelSim> do system_setup.do

This system_setup.do script sets up the following commands:

c   compile simulation models (runs the compile script)

s   load the test harness model (run ModelSim vsim command)

l    set up signal list display (run ModelSim add –list command)

w  set up signal wave display (run ModelSim add –wave command)

h   print help information about each command

To run a simulation with a wave form display, type the following commands:

ModelSim> c

ModelSim> s

ModelSim> w

ModelSim> run

If EDK was not used to generate the test harness (testbench), the helper scripts can still be used. Edit hierarchical path and test harness names in helper scripts as needed to match your test harness.

Edit wave.do and list.do scripts to comment or remove comments from the set of registers to display.

For VHDL designs, the wave.do and list.do scripts for displaying PowerPC registers include both lmcwin enable and add wave commands.

For Verilog designs, the wave.do and list.do scripts for displaying PowerPC registers include only add wave and add list commands. EDK also creates a Verilog testbench_lm_monitor.v file to enable viewing of Swift model registers. To use this file, add the following statement to your test harness (testbench):

`include “testbench_lm_monitor.v”

The statement testbench_lm_monitor.v  uses the $lm_monitor_enable system task to enable access to Swift model internal signals:

initial $lm_monitor_enable( path_to_PowerPC_Swift_model );

where path_to_PowerPC_Swift_model is the hierarchical path name for the PowerPC Swift model instance.


See Also

Using ModelSim Helper Scripts for Simulation Set Up


Send any feedback on this topic to isedocs@xilinx.com.
Copyright © 1995-2005 Xilinx, Inc. All rights reserved.