ANNOUNCE: MyHDL 0.1

Paddy McCarthy paddy3118 at netscape.net
Wed Mar 12 17:46:11 EST 2003


paddy3118 at netscape.net (Paddy McCarthy) wrote in message news:<2ae25c6b.0303111208.45f791d6 at posting.google.com>...
> Jan Decaluwe <jan at jandecaluwe.com> wrote in message news:<mailman.1047070861.23261.clpa-moderators at python.org>...
> > I am happy to announce the initial public release of MyHDL, a
> > Python package for using Python as a hardware description language.
> > 
> > This may be of interest to:
> > - Pythoneers interested in applications of Python generators
> > - hardware designers interested in the wonders of Python
> > 
> > You can find it at http://jandecaluwe.com/Tools/MyHDL/Overview.html.
> > 
> 



I noticed that in your documentation you had this kind of construct:

clk = Signal(0)

  def clkGen():
    while 1:
      yield delay(10)
      clk.next = 1
      yield delay(10)
      clk.next = 0


I wondered if you might make it easier to write if you could assign
multiple values and delays if clk.next is a list, i.e

  def clkgen():
    clk = [0, 10,  1, 10]      # Assigning a list would change the
next attribute
                               # clk is to be Low for 10 then Hi for
10
    clk.loop()                 # replay value,time pairs when
exhausted
    while 1:
      yield clk.values()       # That neccessary yield within an inf.
loop


For cycle vased designs, how about creating a standard way to assign
the values of multiple signals every cycle?
E.g:

rst = Signal()
a = Signal()
b = Signal()
c = Signal()

  def stimulate():
    while 1:
      yield cycles(period=20, offset=2, signals=[rst, a, b, c],
        next=[
          0, 0, 0, 0,
          0, 0, 0, 0,
          1, 0, 0, 0,
          1, 1, 0, 0,
          1, 0, 1, 0,
          1, 0, 0, 1
         ]
        )


The above might be extended to handle inputs and outputs, where next
values of H or L are checked to see if they are high or low at the
strobe offset time within
the clock period:

  def stimCheck():
    while 1:
      yield cycles(period=20, offset=2, strobe=18, signals=[rst, a, b,
c],
        next=[
          0, X, X, X,
          0, 0, 0, X,
          1, 0, 0, H,
          1, 1, 0, L,
          1, 0, H, H,
          1, 0, H, L
         ]
        }

In the example above, b is bi-directional, c is an output, (and X
means don't
change or check a signal in that period).


The idea would be to define enhancements that many would use and have
them provided as standard so people don't reinvent the wheel.

Cheers,  Pad.




More information about the Python-list mailing list