Logo Extending the Visual Elite Simulator with Python































- Slides: 31
Logo
Extending the Visual Elite Simulator with Python through the Foreign “C” Interface (FCI) To speed up the verification of the VHDL implementation of the Down Load Module (Do. Mo), there was the need for interactive testing. This presentation gives an introduction to how to make the Visual Elite simulator interact with a Graphical User Interface written in Python.
A Bit of History (and some News) • In the dark ages of board level simulation way back in 199 x, the Styx interface of the View. Logic Simulator enabled the creation of sockets – This resulted in an interactive VMEbus Interface – Later an interactive HSSL Interface was developed – For VME 64 x, it is now possible to write drivers and applications in C to test VMEbus boards in the board level simulator • You can place more than one board in one VMEbus rack • You can find these boards in the Configuration Space using the Geographical Addressing • You are able to install functions in the A 16 and A 24 address space • You can read from and write to any address in any address space • You may install Interrupt Handlers and consequently service interrupts 3 ELF meeting 25 -Jun-2003
A Bit of History (2) • Recently, the investigation of the possibilities to use the Summit Visual Elite C-Interface to accomplish the same for VHDL simulation was started • The first attempt resulted in an interactive user interface which helped to verify the User Registers implemented in VHDL of the HSSL Protocol Checker (HPC BI-1514) • At this moment also the VME and ASI interfaces of the Do. Mo module are implemented to help the verification of the Download Module VHDL 4 ELF meeting 25 -Jun-2003
The Foreign “C” Interface • “Ever since version 4. 0 of Visual HDL for VHDL, a Foreign “C” Language Interface (FCI) capability has been incorporated in this product. Today, this capability allows you to integrate foreign subprograms (functions and procedures) or models written in “C” in any VHDL-based design created in Visual Elite. ” • “The inclusion of the FCI capability in Visual Elite is based on the “foreign” attribute defined by VHDL IEEE 1076 -1993 (VHDL 1993’s Language Reference Manual). “ 5 ELF meeting 25 -Jun-2003
The Bigger Picture Python with Tcl/Tk Graphical Interface VHDL Entity VHDL Test Bench C++ DLL 6 ELF meeting 25 -Jun-2003
The Beauty of Python • “Learn about Python, the language that wraps itself around a problem to squeeze out a solution, swallowing it whole. ” • For more information about why you should be using Python – try Googling for • “Why Python? ” • “The beauty of Python” – Ask Be. St, Apal, Hofs and Pa. He (in order of reformation) – Go to www. python. org 7 ELF meeting 25 -Jun-2003
The Advantages of using Sockets • You can simulate the behavior interactively • Chain of events: – Connect GUI to simulator – Interact with simulator and watch results – When changes are needed to the script: • • Disconnect from simulator Make the changes to the script Reconnect to simulator Without having to recompile or even restart the simulator • Asynchronous behavior stresses the interface with the Device Under Test • Interactive sessions can ultimately be converted to procedural scripts for batch testing 8 ELF meeting 25 -Jun-2003
The Disadvantages of using Sockets • It is not possible to perfectly reproduce simulation results between two simulation sessions due to the asynchronous operations 9 ELF meeting 25 -Jun-2003
The Test Bench • The test bench contains the module under test ‘top’ and the socket interfaces in ‘anything’ 10 ELF meeting 25 -Jun-2003
The Socket Interface Module • The supported generics are: – – a_width d_width script dds_time 11 ELF meeting 25 -Jun-2003
VME and ASI • Two modules are used in the same test bench to implement both the VME and the ASI interface 12 ELF meeting 25 -Jun-2003
The Entity • The Entity is written in VHDL 13 ELF meeting 25 -Jun-2003
The Architecture • The Architecture is written in C 14 ELF meeting 25 -Jun-2003
The Read Timing • The dds_n output is connected to the ack_n input when no acknowledge is provided by the module under test 15 ELF meeting 25 -Jun-2003
A Read Cycle • The dds_n signal is not used in this case 16 ELF meeting 25 -Jun-2003
The Write Timing • The rwn signal announces a write cycle in the case that buffers need enabled before wr_n is activated 17 ELF meeting 25 -Jun-2003
A Write Cycle 18 ELF meeting 25 -Jun-2003
Script Starts Up Automagically • A Python program is specified via the script generic • The DLL starts the script providing it with the host name and port number 19 ELF meeting 25 -Jun-2003
After some Interaction • After disconnection, the number of reads and writes are reported (just for fun) 20 ELF meeting 25 -Jun-2003
The Python sources • A sample of the Python sources 21 ELF meeting 25 -Jun-2003
There are No Limits • There is no limit to the number of interactive sessions that may be invoked at the same time, other than the available system resources 22 ELF meeting 25 -Jun-2003
The Creation of the DLL • The dll is created using Borland C++Builder 23 ELF meeting 25 -Jun-2003
The Loaded Modules • The dll is tested, specifying Visual Elite as the application. Visual Elite is running under supervision of Borland C++Builder. 24 ELF meeting 25 -Jun-2003
About Break Points • When ‘printf’ is not enough • Add breakpoints in the dll source code 25 ELF meeting 25 -Jun-2003
Sending Messages • The Vis_message("Text") function sends text to the console 26 ELF meeting 25 -Jun-2003
The Cause Button • Cause button in graphical wave jumps to C code 27 ELF meeting 25 -Jun-2003
Things to be Implemented • Port the implementation to the Sun operating system • Remove the module’s dependency of the external clock signal • Implement a configurable timeout, in the case the ack_n signal is never asserted • Add host parameter to the script invocation 28 ELF meeting 25 -Jun-2003
The Problems to be Solved • Certain functions in FCI do not work, yet. Summit is working on the following issues: – Vis_exception(VIS_USER_DEFINED_EXCEPTION) terminates with an access violation – Vis_assertion("Text", VIS_NOTE) terminates with an access violation – Vis_remove_all_callbacks() terminates with an access violation • These problems are definitely no show stoppers • The current implementation operates extremely reliable 29 ELF meeting 25 -Jun-2003
Some Wild Ideas for the Future • • • Create dynamic flash contents Simulate complex peripheral components Log events to external programs, like a data base Display complex graphical information perhaps using Gnu. Plot Other wild ideas? 30 ELF meeting 25 -Jun-2003
Thanks Thank you all for your time 31 ELF meeting 25 -Jun-2003