[libre-riscv-dev] [Bug 217] create a "ring" system which allows pad locations to be specified conveniently
bugzilla-daemon at libre-riscv.org
bugzilla-daemon at libre-riscv.org
Thu Mar 26 21:39:34 GMT 2020
http://bugs.libre-riscv.org/show_bug.cgi?id=217
--- Comment #44 from Jock Tanner <tanner.of.kha at gmail.com> ---
Sorry for being missing for some time, it was a busy week for me. My other
projects and local bureaucracy required my attention.
So I reworked the ALU16 example with the hope that this approach could be
(re)used in a future work.
https://git.libre-riscv.org/?p=soclayout.git;a=blob;f=experiments7/utils.py
My goals were:
- eliminate dead, duplicated and redundant code,
- facilitate multiple instantiation of electronic components through modular
design with a support for module “nesting”,
- enable parameterization of the electronic modules in a simple, declarative
manner,
- proper incapsulate all Coriolis interfacing to overcome the “global context”
antipattern that prevailed in the original code, and further improve the
readability and maintainability.
To achieve these goals, I
- created a class named 'Module', which encapsulated the execution context
('Hurricane.Cell', 'Hurricane.DataBase', 'CRL.AllianceFramework', 'editor', et
c.) in its attributes and properties,
- converted the typical actions into the methods of this class,
- separated the initialization of the Module object ('Module.__init__()') with
the actual operations ('Module.build()'),
- provided a method for recursive building of “nested” objects.
Right now, 'Module.build()' is designed to be implemented in 'Module'
subclasses. As soon as my understanding of the requirements will grow beyond
the simple examples, 'Module.build()' can be converted into the “template
method”.
The amount of required parameters can also be reduced. Maybe we could teach the
module to deduct either its size or pin spacing. Now the initialization looks
quite fuzzy.
I deleted all the 'print' statements from the example, since I could not grasp
the logic and requirements behind them. Perhaps it makes sense to return some
logging, preferably with a proper use of 'logging' facility.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-riscv-dev
mailing list