[libre-riscv-dev] [Bug 64] data handling / io control / data routing API needed
    bugzilla-daemon at libre-riscv.org 
    bugzilla-daemon at libre-riscv.org
       
    Sat Apr 27 14:07:46 BST 2019
    
    
  
http://bugs.libre-riscv.org/show_bug.cgi?id=64
--- Comment #17 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
jacob let's go through these, in order, one at a time, it's the
only real sane way to get through them all, just with a lot of
patience.
on the "name=" for input data and output data spec, i added this wrapper:
+def _spec(fn, name=None):
+    if name is None:
+        return fn()
+    varnames = dict(inspect.getmembers(fn.__code__))['co_varnames']
+    if 'name' in varnames:
+        return fn(name=name)
+    return fn()
+
+
basically, this keeps the API simple.  developers who do not *want*
to add a name prefix are not forced to do so... and do not require
adding "name=None" to the input and output spec function.
https://git.libre-riscv.org/?p=ieee754fpu.git;a=commitdiff;h=8d38dc3d0ead75ff5313a653a2194c82a1ca0572
i modified one of the unit tests and visually inspected the graphviz,
it works well.  i_data_INPUTNAME and o_data_OUTPUTNAME, and intermediaries,
all good.
also, chaining (both types: combinatorial and pipelining) have intermediary
names added where (if) ispec/ospec is deployed.
i know i suggested using nmigen-style name-None overriding: it'll get
too complicated.  adding name= to input spec and output spec as originally
suggested however _will_ work... i just prefer that it not be forced onto
developers that don't want it (hence the dynamic check)
-- 
You are receiving this mail because:
You are on the CC list for the bug.
    
    
More information about the libre-riscv-dev
mailing list