URL
https://opencores.org/ocsvn/hd44780_driver/hd44780_driver/trunk
Subversion Repositories hd44780_driver
[/] [hd44780_driver/] [trunk/] [tb_example_driver.do] - Rev 2
Compare with Previous | Blame | View Log
# Filename: tb_example_driver.do# Filetype: Modelsim Script File# Date: 26 oct 2012# Update: -# Description: Script File For Automatic Simulation# Author: J. op den Brouw# State: Demo# Error: -# Version: 1.1aplha# Copyright: (c)2012, De Haagse Hogeschool# This ModelSim command file houses all commands for tracing# the client side module driver alias the test hardware.# Set transcript ontranscript on# Recreate the work directory and map to workif {[file exists rtl_work]} {vdel -lib rtl_work -all}vlib rtl_workvmap work rtl_work# Find out if we're started through Quartus or by hand# (or by using an exec in the Tcl window in Quartus).# Quartus has the annoying property that it will start# Modelsim from a directory called "simulation/modelsim".# The design and the testbench are located in the project# root, so we've to compensate for that.if [ string match "*simulation/modelsim" [pwd] ] {set prefix "../../"puts "Running Modelsim from Quartus..."} else {set prefix ""puts "Running Modelsim..."}# Compile the LCD VHDL description and testbench,# please note that the design and its testbench are located# in the project root, but the simulator start in directory# <project_root>/simulation/modelsim, so we have to compensate# for that.vcom -2008 -work work ${prefix}lcd_driver_hd44780_module.vhdvcom -2008 -work work ${prefix}example_driver.vhdvcom -2008 -work work ${prefix}tb_example_driver.vhd# Start the simulator with 1 ns time resolutionvsim -t 1ns -L rtl_work -L work -voptargs="+acc" tb_example_driver# Log all signals in the design, good if the number# of signals is small.add log -r *# Add all toplevel signals# Add a number of signals of the simulated designadd wave -divider "SYSTEM"add wave CLOCK_50add wave -divider "Inputs"add wave BUTTONadd wave -divider "Internals"add wave de0/aresetadd wave de0/clkadd wave de0/stateadd wave de0/busyadd wave de0/wradd wave de0/goto10add wave de0/goto20add wave de0/goto30add wave de0/homeadd wave de0/clsadd wave de0/line_counteradd wave de0/character_counteradd wave -divider "Outputs"add wave LCD_ENadd wave LCD_RWadd wave LCD_RSadd wave LCD_DATAadd wave LEDG(0)# Open Structure, Signals (waveform) and List windowview structure#view listview signalsview wave# Run simulation for ...# Note 60 ms is sufficient if using Busy Flag reading, 270 ms# for non-BF readingrun 270 ms# Fill up the waveform in the windowwave zoom full
