How to traversal or return the signalName/Direction/type of all elements of a bundle?
See original GitHub issueCould you enlight me how to traversal the signalName of a bundle? like
class test extends Bundle {
val io = IO(new Bundle{
val a = Input(Bool())
val b = Input(Bool())
})
for ( signame <- io.elements) {
printf("%s \n",signame)
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to Iterate through all Bundle objects - android
If you get all the way up to java.lang.Object then you've got a bundled object that can't immediately be stored in SharedPreferences.
Read more >Bundle Function - NI - National Instruments
When you create a new cluster, you must wire all the inputs. The elements in the output cluster must appear in the same...
Read more >Bundling Linked Data Structures for Linearizable Range Queries
only a range of the data structure instead of all elements [12]. ... returns the next node in a traversal toward the range...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to iterate on the elements of
a
, nota
itself. Try:As for the printf, the type error is because it doesn’t know the type of
d
(until you make the fix I mentioned above), but you will get an elaboration time error with it as written. Instead tryThe above is a C-style printf. Alternatively, you could try using our custom String-interpolator which would be simply:
Note how it uses
p"
instead ofs"
, also that there are no arguments to send after the String. For more information, check out Printing in ChiselPlease reopen if issue was not resolved.