Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOBUF support #1148

Merged
merged 17 commits into from
Nov 19, 2019
Merged

IOBUF support #1148

merged 17 commits into from
Nov 19, 2019

Conversation

mkurc-ant
Copy link
Collaborator

@mkurc-ant mkurc-ant commented Nov 12, 2019

This PR adds support for IOBUF to SymbiFlow.

  • Minitest.
  • Blackbox / simulation model.
  • Architecture definition.
  • Techmap.
  • fasm2bels.
  • Automatic inference of 3-state IOBUFs

With this PR the flow of SymbiFlow changes a bit. Upon sysnthesis the design is written to a JSON file. Then, the file is processed by the split_inouts.py utility which splits inout ports into separate inputs and outputs. After processing, the design is written to another JSON file which is then converted to EBLIF using Yosys.

This processing should be moved to a Yosys plugin in the future.

Each top-level inout port of the design is split into one input and one output port. Port names are given in the following way: inout A -> input A_$inp and output A_$out.

@probot-autolabeler probot-autolabeler bot added lang-verilog Issue uses (or requires) Verilog language. lang-xml Issues uses (or requires) XML language. type-vpr labels Nov 12, 2019
@probot-autolabeler probot-autolabeler bot added arch-artix7 arch-ice40 Issue related to the iCE40 architecture description. arch-test type-utils Issues is related to the scripts inside the repo. lang-python Issue uses (or requires) Python language. labels Nov 13, 2019
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
…w in CMake build system.

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
…longer required.

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
@mkurc-ant mkurc-ant changed the title [WIP] IOBUF support IOBUF support Nov 15, 2019
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
@mkurc-ant
Copy link
Collaborator Author

I'm still having issues with making Yosys infer IOBUFs from assign statements though. For such a design:

inout wire pin

...

wire pin_i;
wire pin_o;
wire pin_t;

assign pin_i = pin;
assign pin = (pin_t == 1'b1) ? pin_o : 1'bz;

In some cases I end up with an OBUFT-like cell for the 3-state output and the input taken directly from the pin (not through any buffer). In other cases I have a properly connected IOBUF cell but after optimization its output gets disconnected (a bug?).

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
@litghost
Copy link
Contributor

I'm still having issues with making Yosys infer IOBUFs from assign statements though. For such a design:

I know I suggested the iobufmap to begin with, but if we simply require the IOBUF explicitly, would your script do the right thing?

OUTPUT ${OUT_JSON}
DEPENDS ${OUT_JSON_SYNTH} ${QUIET_CMD} ${QUIET_CMD_TARGET} ${SPLIT_INOUTS} ${PYTHON3} ${PYTHON3_TARGET} simplejson
COMMAND
${CMAKE_COMMAND} -E env PYTHONPATH=${PRJXRAY_DIR}:${symbiflow-arch-defs_SOURCE_DIR}/utils ${PYTHON3} ${SPLIT_INOUTS} -i ${OUT_JSON_SYNTH} -o ${OUT_JSON}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is PRJXRAY_DIR required here? It seems weird to have a 7-series specific thing in the (in theory) generic CMake function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon review of split_inouts, it doesn't seem to use PRJXRAY at all? So you should just be able to drop the path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, It ended up here as a mistake. Removed.

# =============================================================================


def find_and_split_inout_ports(design, module_name):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


def get_nets(bits):
"""
Returns a set of numbers corresponding to net indices.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is very weird. Can you provide some doctest examples?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added docstring and doctest.

if "top" in attrs and attrs["top"] == 1:
return name

return None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should throw an exception rather than return None?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added throwing an exception.

Copy link
Contributor

@litghost litghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really good! Comments added

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
@probot-autolabeler probot-autolabeler bot added the type-docs Issue is related to documentation. label Nov 19, 2019
@litghost litghost merged commit eff035a into f4pga:master Nov 19, 2019
@mkurc-ant mkurc-ant deleted the vpr_iobuf_support branch November 20, 2019 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-artix7 arch-ice40 Issue related to the iCE40 architecture description. arch-test lang-python Issue uses (or requires) Python language. lang-verilog Issue uses (or requires) Verilog language. lang-xml Issues uses (or requires) XML language. type-docs Issue is related to documentation. type-utils Issues is related to the scripts inside the repo. type-vpr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants