-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ports with attributes to python builder (#2069)
* Being work on dynamic AXI wrapper. Currently, have reduced complexity of channels by not tracking transfer counts and transaction counts and similar. Changes are a bit haphazard, so be careful about assuming aything is "done". Perhapes the AR and AW channels are indeed finished. TODO: Create address-translate module. In particular look at interface for mulitpliers as we might only have pipelined version * add new const_mult to py-builder * AW AR R and W channels might be done. Need to make sure write channel interface is correct. Then need to tie everything together according to diagram. * Finish(?) read and write controller in builder TODO: Wire up translator, read controller, write controller. Then test if this works with current test bench/executor * begin axi dynamic read controller * refactor reg calls in dynamix yxi generator * add import for const-mult in py-builder * WIP: need to work on axi-seq-mem-comp. Namley, need to be able to add attributes to ports * add support for port attributes with method * refactor to also have outputs iwth attributes * remove extra files added somehow * Add attributes to (and rename) add_comp_ports * Fix some formatting issues, should pass runt tests * find and replace add_comp_params * refactor to only have single input/output method. TODO: remove commented out code * Refactor to remove code duplication in builder * black formatting * add runt test for port attributes * update docs to showcase option to add port attributes * improved example in walkthrough for port attributes --------- Co-authored-by: eys29 <[email protected]>
- Loading branch information
1 parent
ad8a828
commit 6fb893e
Showing
8 changed files
with
149 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import "primitives/core.futil"; | ||
component foo(in_1: 1, @data in_2: 2, @data @write_together(1) in_3: 2) -> (out_1: 1, @data out_2: 1, @data @done(1) out_3: 1) { | ||
cells { | ||
|
||
} | ||
wires { | ||
|
||
} | ||
control { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import calyx.builder as cb | ||
|
||
|
||
def insert_foo_component(prog): | ||
comp = prog.component("foo") | ||
|
||
foo_inputs = [ | ||
("in_1", 1), | ||
("in_2", 2, ["data"]), | ||
("in_3", 2, ["data", ("write_together", 1)]) | ||
] | ||
|
||
cb.add_comp_ports(comp, foo_inputs, []) | ||
|
||
comp.output("out_1", 1) | ||
# ANCHOR: port_attributes | ||
comp.output("out_2", 1, ["data"]) | ||
comp.output("out_3", 1, ["data", ("done", 1)]) | ||
# ANCHOR_END: port_attributes | ||
|
||
if __name__ == "__main__": | ||
prog = cb.Builder() | ||
insert_foo_component(prog) | ||
prog.program.emit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters