For Programmers: Free Programming Magazines  


Home > Archive > Tcl > March 2006 > TCL Modelsim interface









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author TCL Modelsim interface
GLW

2006-03-31, 1:40 am

I am currently attempting to interface a simple TCL script to a VHDL testbench. I have a DUT that generates row and column integer counts the TCL script extracts the row/column count and creates a corresponding pixel on a n*n display screen represented by the TCL canvas.

The scripts seems to work correctly in that the row and column count gets extracted and a pixel is created in the canvas, but for some reason the pixel colour is always black?

This is the script:
I would very much appreciate if someone could point out where I've gone wrong here.

Many thanks

G

if {[winfo exists .test]} {
destroy .test
}
toplevel .test
set screen_width 820
set screen_height 820
canvas .test.c -width $screen_width -height $screen_height
pack .test.c -in .test

when {/test_tb/clock'event and /test_tb/clock = '1'} {set Captured_Row_Count [examine /test_tb/RowCount]}
when {/test_tb/clock'event and /test_tb/clock = '1'} {set Captured_Col_Count [examine /test_tb/ColCount]}
when {/test_tb/clock'event and /test_tb/clock = '0'} {pixel_draw $Captured_Col_Count $Captured_Row_Count}

proc pixel_draw { x y } {

set xul [expr $x ]
set yul [expr $y ]
set xlr [expr $x + 1]
set ylr [expr $y + 1]
.test.c create rectangle $xul $yul $xlr $ylr -fill red
}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com