--- Quote Start ---
I'm using VHDL ... I would appreciate if you could post the testbench for me.
--- Quote End ---
Here's an example component, testbench, and simulation script. There's a readme.txt file in the zip file that I'll repeat here:
Modelsim Example
----------------
10/24/2011 D. W. Hawkins (dwh@ovro.caltech.edu)
This design shows an example of a simple Modelsim simulation
for a VHDL design. The design consists of a register with a
veriable width. The register can be enabled to store the
data on its input, or the inverse of the data on its input.
The testbench performs a walking 1's test for each of the
input modes, and checks the output is consistent with the
input.
To run the test, start Modelsim, change to the top-level
folder of this project and run the sim.tcl script, eg.,
under Windows
ModelSim> cd {C:\temp\modelsim_example}
ModelSim> source scripts/sim.tcl
and then run the testbench
ModelSim> example_tb 16
which will generate the output:
# ==============================================================================# Example testbench# ==============================================================================# 210 ns: Synchronously deassert reset# # ------------------------------------------------------------------------------# # 1: Check the reset state# ------------------------------------------------------------------------------# 430 ns: Test passed# # ------------------------------------------------------------------------------# # 2: Mode '0' test# ------------------------------------------------------------------------------# 630 ns: Walk a '1' across the register data bus# 1290 ns: Test passed# # ------------------------------------------------------------------------------# # 3: Mode '1' test# ------------------------------------------------------------------------------# 1490 ns: Walk a '1' across the register data bus# 2150 ns: Test passed# # ==============================================================================# Simulation complete# ==============================================================================# ** Note: stop# Time: 2350 ns Iteration: 0 Instance: /example_tb
In Modelsim, under Linux, I don't think you'll need the {} when you change directories, eg. cd /home/luiz/temp/modelsim_example, should work.
Cheers,
Dave