<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD><FONT face=Arial><FONT size=2>
<BODY>
<DIV>Oroboro is an approach to integrating Python and Verilog. With it, Python 
generator functions are used to model simulation threads in a cooperative 
multitasking style. An Oroboro task can suspend its execution with a yield 
statement that lists the reasons the task should be resumed. Typical reasons map 
directly to VPI callback reasons. Oroboro does not implement a scheduler of its 
own, rather, it relies on Verilog for all event scheduling through the use of 
callback functions. </DIV>
<DIV>
<P>A short example illustrates some basic capabilities for interacting with a 
Verilog simulation. <PRE>  from oroboro import *

  def watcher(sig):
    print "Watching signal %s" % sig
    while 1:

      yield sigchange(sig), timeout(10)

      if isinstance(currentreason(), sigchange):
        print "New value for signal %s is %s" % (sig, sig.get())

      if isinstance(currentreason(), timeout):
        print "Timeout has elapsed.  Wait again."


  def main(systf):

    s = signal("top.mysignal")
    t = task(watcher, s)

    yield timeout(0)
    return</PRE>
<P>The example above illustrates a simple task that watches a Verilog signal. 
The task 'watcher' loops indefinitely, suspending its execution with a yield 
statement that lists the reasons it should be resumed. Here, the task waits 
until either the signal value changes, or a 10 simulation tick timeout occurs 
... whichever comes first. When the task resumes, it uses the 'currentreason' 
function to determine whether the first or second reason in the yield statement 
was triggered. The task prints an informative message and then loops. </P>
<P>Source downloads and documentation can be found at:</P>
<P>&nbsp; <A 
href="http://apvm.sourceforge.net">http://apvm.sourceforge.net</A></P>
<P>&nbsp;</P></DIV></BODY></HTML></FONT></FONT>