Return to Support Page
 homesearchagentssupportask xilinxmap

Answers Database


PROsim, ViewSim: Using the LOADM command with Xilinx FPGA simulations


Record #632

Problem Title:
PROsim, ViewSim: Using the LOADM command with Xilinx FPGA simulations


Problem Description:
There is often confusion about use of the LOADM command for Viewlogic
simulation.  Here is a clarification of the command found in the Viewlogic
documentation.	The LOADM command specifies the value of the output of a
RAM/ROM componant at the specified address(es).


Solution 1:

Here is example 1 from the viewlogic documentation:

loadm videobuf (0:255) AA\h

This command loads the 8 bit wide RAM or ROM with the hex output AA for
every location between 0 and 255.  For the XC4000 simulations all memories
are 1 bit wide.  For XC4000 designs even multiple bit width outputs are
generated as macros of single output memories. These means that all memories
will be made from either 16x1 or 32x1 memory componants, so the output that
is defined should always be one bit wide.  All 16 bit memories will take as
many as 16 loadm commands to initialize,  and all 32 bit memories will take
as many as 32 loadm commands to initialize. (this can only be reduced if and
only if there are adjacent locations with the same output)

For example take a 16x1 ROM that has an INIT=AAAA attribute.  (this sets up
every adjacent bit in the ROM as opposites.)  The way to initialize this ROM
in viewlogic simulation would be:

loadm videobuf/rom (0:0) 0
loadm videobuf/rom (1:1) 1
loadm videobuf/rom (2:2) 0
loadm videobuf/rom (3:3) 1
loadm videobuf/rom (4:4) 0
loadm videobuf/rom (5:5) 1
loadm videobuf/rom (6:6) 0
loadm videobuf/rom (7:7) 1
loadm videobuf/rom (8:8) 0
loadm videobuf/rom (9:9) 1
loadm videobuf/rom (10:10) 0
loadm videobuf/rom (11:11) 1
loadm videobuf/rom (12:12) 0
loadm videobuf/rom (13:13) 1
loadm videobuf/rom (14:14) 0
loadm videobuf/rom (15:15) 1

An example where only one loadm command is needed is a ROM where all of the
outputs are the same.  (INIT=FFFF or INIT=0)  The viewlogic command for the
case where all values of a 16x1 rom are set to 1 would be:


loadm videobuf/rom (0:15) 1


When people generate their ROMs using memgen or XBLOX a .XMM file is created
which will initialize the memories.  However, when a discrete memory is added
to a schematic it is expected that the user be able to use the loadm command
to initialize their simulation.



End of Record #632

For the latest news, design tips, and patch information on the Xilinx design environment, check out the Xilinx Expert Journals!

© 1998 Xilinx, Inc. All rights reserved
Trademarks and Patents