Answers Database


Simulator: How to simulate a ramp or counter on a bus


Record #5237

Product Family: Software

Product Line: Aldec

Product Part: Foundation Logic Simulator

Product Version: 1.5

Problem Title:
Simulator: How to simulate a ramp or counter on a bus


Problem Description:
Urgency: General

General Description: How do you simulate a bus to count up or down? If
you have an eight bit bus, how to make it go 00 01 02 etc.


Solution 1:

The easiest way to do this is with a simulation script. Create a script from
the simulator, and choose to use the Wizard. Add your buses as vectors,
naming them anything you wish. Then, under the Stimulated and Watched
Signals Screen, click Browse, and click beside each of the individual signals
in the bus you want to stimulate. Then, one by one, click on the the bit,
then under Stimulator Type choose Binary Counter, and in the Value field
type the index number of the signal in the bus. The relevant portion should
look something like this:

| Vector Definitions
|
| Add your vector definition commands here
vector Vector_Name_1 BUS_IN7 BUS_IN6 BUS_IN5 BUS_IN4 BUS_IN3
BUS_IN2 BUS_IN1 BUS_IN0
radix hex Vector_Name_1
vector Vector_Name_2 BUS_OUT7 BUS_OUT6 BUS_OUT5 BUS_OUT4
BUS_OUT3 BUS_OUT2 BUS_OUT1 BUS_OUT0
radix hex Vector_Name_2

| Watched Signals and Vectors
|
| Define your signal and vector watch list here
watch BUS_IN7 BUS_IN6 BUS_IN5 BUS_IN4 BUS_IN3
watch BUS_IN2 BUS_IN1 BUS_IN0

| Stimulators Assignment
|
| Select and/or define your own stimulators
| and assign them to the selected signals
set_stim B7 BUS_IN7
set_stim B6 BUS_IN6
set_stim B5 BUS_IN5
set_stim B4 BUS_IN4
set_stim B3 BUS_IN3
set_stim B2 BUS_IN2
set_stim B1 BUS_IN1
set_stim B0 BUS_IN0

Then when you run the your script, you'll see your buses referenced by their
vector names, and they'll perform as n-bit binary counters (8 bits in this case).




End of Record #5237 - Last Modified: 06/14/99 10:28

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