[myhdl-list] how to create records in MyHDL like those in VHDL
Brought to you by:
jandecaluwe
From: bedros <be...@ya...> - 2004-02-12 18:35:04
|
Jan, I got a question for you. I've been playing with MyHDL whenever I have extra time. Everything works fine for me, but I need a way to combine many signals into one record so I can pass it around. I tried to create a new class with all my signals instantiated and it worked fine, except I needed to modify your source code to get the VCD waveforms. Even though I used __str__ attribute; I still feel that there should be a better way to do it. I'm new to both MyHDL and Python. My question is how to make a record of something roughly like this (in vhdl) type pkg_t is (data, address, command); type my_record is record package_type : pkg_t; load : bit_vector(31 downto 0); valid : boolean; end record; I can use enum for pkg_t statement, but how can I create the record? should I use a function, list, or a class? Thanks, -Bedros |