From 6dac416025271557d324720deee48c55613b3f6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Jul 2022 06:28:13 +0000 Subject: [PATCH 1/4] Bump yosys-plugins from `e71ace5` to `52cdcc4` Bumps [yosys-plugins](https://github.com/SymbiFlow/yosys-symbiflow-plugins) from `e71ace5` to `52cdcc4`. - [Release notes](https://github.com/SymbiFlow/yosys-symbiflow-plugins/releases) - [Commits](https://github.com/SymbiFlow/yosys-symbiflow-plugins/compare/e71ace57a7d3416683e435a6a9a690c462e90e6a...52cdcc42db527087fb342b4dabdb1a79878266cb) --- updated-dependencies: - dependency-name: yosys-plugins dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- yosys-plugins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yosys-plugins b/yosys-plugins index e71ace57a..52cdcc42d 160000 --- a/yosys-plugins +++ b/yosys-plugins @@ -1 +1 @@ -Subproject commit e71ace57a7d3416683e435a6a9a690c462e90e6a +Subproject commit 52cdcc42db527087fb342b4dabdb1a79878266cb From 22f8d968cc31bfa6651d9a7efecc0493e8caaf63 Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Thu, 21 Jul 2022 10:29:58 +0200 Subject: [PATCH 2/4] Ported fixes related to timing graph node remapping. Signed-off-by: Maciej Kurc --- vpr/src/base/atom_lookup.cpp | 9 +++ vpr/src/base/atom_lookup.h | 5 ++ vpr/src/timing/timing_graph_builder.cpp | 75 +++++++++++++++++++++---- vpr/src/timing/timing_graph_builder.h | 2 + 4 files changed, 80 insertions(+), 11 deletions(-) diff --git a/vpr/src/base/atom_lookup.cpp b/vpr/src/base/atom_lookup.cpp index 6f3362619..4a9b98711 100644 --- a/vpr/src/base/atom_lookup.cpp +++ b/vpr/src/base/atom_lookup.cpp @@ -150,6 +150,15 @@ AtomLookup::tnode_pin_range AtomLookup::tnode_atom_pins() const { return vtr::make_range(tnode_atom_pin_.begin(), tnode_atom_pin_.end()); } +AtomLookup::pin_tnode_range AtomLookup::atom_pin_tnodes(BlockTnode block_tnode_type) const { + if (block_tnode_type == BlockTnode::EXTERNAL) { + return vtr::make_range(atom_pin_tnode_external_.begin(), atom_pin_tnode_external_.end()); + } else { + VTR_ASSERT(block_tnode_type == BlockTnode::INTERNAL); + return vtr::make_range(atom_pin_tnode_internal_.begin(), atom_pin_tnode_internal_.end()); + } +} + void AtomLookup::set_atom_pin_tnode(const AtomPinId pin, const tatum::NodeId node, BlockTnode block_tnode_type) { //A pin always expands to an external tnode (i.e. it's external connectivity in the netlist) //but some pins may expand to an additional tnode (i.e. to SOURCE/SINK to cover internal sequential paths within a block) diff --git a/vpr/src/base/atom_lookup.h b/vpr/src/base/atom_lookup.h index 15710da43..45fe4bd04 100644 --- a/vpr/src/base/atom_lookup.h +++ b/vpr/src/base/atom_lookup.h @@ -18,8 +18,10 @@ */ class AtomLookup { public: + typedef vtr::linear_map::const_iterator pin_tnode_iterator; typedef vtr::linear_map::const_iterator tnode_pin_iterator; + typedef vtr::Range pin_tnode_range; typedef vtr::Range tnode_pin_range; public: @@ -86,6 +88,9 @@ class AtomLookup { //Returns a range of all tnode to pin mappings tnode_pin_range tnode_atom_pins() const; + ///@brief Returns a range of all pin to tnode mappingsg of the specified type + AtomLookup::pin_tnode_range atom_pin_tnodes(BlockTnode block_tnode_type) const; + //Sets the bi-directional mapping between an atom netlist pin and timing graph node void set_atom_pin_tnode(const AtomPinId pin, const tatum::NodeId node, BlockTnode block_tnode_type = BlockTnode::EXTERNAL); diff --git a/vpr/src/timing/timing_graph_builder.cpp b/vpr/src/timing/timing_graph_builder.cpp index 4d4ac33be..28346bff4 100644 --- a/vpr/src/timing/timing_graph_builder.cpp +++ b/vpr/src/timing/timing_graph_builder.cpp @@ -47,6 +47,8 @@ std::unique_ptr TimingGraphBuilder::timing_graph(bool allow_danglin VTR_ASSERT(tg_); tg_->validate(); + validate_netlist_timing_graph_consistency(); + return std::move(tg_); } @@ -421,22 +423,73 @@ tatum::EdgeId TimingGraphBuilder::find_scc_edge_to_break(std::vector new_tnode_atom_pin; - for (auto kv : netlist_lookup_.tnode_atom_pins()) { - tatum::NodeId old_tnode = kv.first; - AtomPinId pin = kv.second; - tatum::NodeId new_tnode = id_mapping.node_id_map[old_tnode]; + for (BlockTnode type : {BlockTnode::EXTERNAL, BlockTnode::INTERNAL}) { + for (auto kv : netlist_lookup_.atom_pin_tnodes(type)) { + AtomPinId pin = kv.first; + tatum::NodeId old_tnode = kv.second; - new_tnode_atom_pin.emplace(new_tnode, pin); - } + if (!old_tnode) continue; - for (auto kv : new_tnode_atom_pin) { - tatum::NodeId tnode = kv.first; - AtomPinId pin = kv.second; - netlist_lookup_.set_atom_pin_tnode(pin, tnode); + tatum::NodeId new_tnode = id_mapping.node_id_map[old_tnode]; + + netlist_lookup_.set_atom_pin_tnode(pin, new_tnode, type); + } } } bool TimingGraphBuilder::is_netlist_clock_source(const AtomPinId pin) const { return netlist_clock_drivers_.count(pin); } + +bool TimingGraphBuilder::validate_netlist_timing_graph_consistency() const { + for (AtomPinId pin : netlist_.pins()) { + tatum::NodeId ext_tnode = netlist_lookup_.atom_pin_tnode(pin, BlockTnode::EXTERNAL); + if (!ext_tnode) VPR_ERROR(VPR_ERROR_TIMING, "Found no external tnode for atom pin '%zu'", size_t(pin)); + + tatum::NodeId int_tnode = netlist_lookup_.atom_pin_tnode(pin, BlockTnode::INTERNAL); + + /* + * Sanity check look-up consistency + */ + AtomPinId ext_tnode_pin = netlist_lookup_.tnode_atom_pin(ext_tnode); + if (ext_tnode_pin != pin) { + VPR_ERROR(VPR_ERROR_TIMING, "Inconsistent external tnode -> atom pin lookup: atom pin %zu -> tnode %zu, but tnode %zu -> atom pin %zu", + size_t(pin), size_t(ext_tnode), size_t(ext_tnode), size_t(ext_tnode_pin)); + } + if (int_tnode) { + AtomPinId int_tnode_pin = netlist_lookup_.tnode_atom_pin(int_tnode); + if (int_tnode_pin != pin) { + VPR_ERROR(VPR_ERROR_TIMING, "Inconsistent internal tnode -> atom pin lookup: atom pin %zu -> tnode %zu, but tnode %zu -> atom pin %zu", + size_t(pin), size_t(int_tnode), size_t(int_tnode), size_t(int_tnode_pin)); + } + } + + /* + * Sanity check internal/external tnode types + */ + tatum::NodeType ext_tnode_type = tg_->node_type(ext_tnode); + if (ext_tnode_type == tatum::NodeType::IPIN || ext_tnode_type == tatum::NodeType::OPIN) { + if (!int_tnode) VPR_ERROR(VPR_ERROR_TIMING, "Missing expected internal tnode for combinational atom pin %zu", size_t(pin)); + if (int_tnode != ext_tnode) VPR_ERROR(VPR_ERROR_TIMING, "Mismatch external/internal tnodes (%zu vs %zu) for combinational atom pin %zu", + size_t(ext_tnode), size_t(int_tnode), size_t(pin)); + } else if (ext_tnode_type == tatum::NodeType::CPIN) { + if (int_tnode) VPR_ERROR(VPR_ERROR_TIMING, "Unexpected internal tnode (%zu) for clock pin: atom pin %zu ,external tnode %zu", + size_t(int_tnode), size_t(pin), size_t(ext_tnode)); + } else if (ext_tnode_type == tatum::NodeType::SOURCE) { + if (int_tnode && tg_->node_type(int_tnode) != tatum::NodeType::SINK) { + VPR_ERROR(VPR_ERROR_TIMING, "Found internal tnode (%zu) associated with atom pin %zu, but it is not a SINK (external tnode %zu was a SOURCE)", + size_t(int_tnode), size_t(pin), size_t(ext_tnode)); + } + + } else if (ext_tnode_type == tatum::NodeType::SINK) { + if (int_tnode && tg_->node_type(int_tnode) != tatum::NodeType::SOURCE) { + VPR_ERROR(VPR_ERROR_TIMING, "Found internal tnode (%zu) associated with atom pin %zu, but it is not a SOURCE (external tnode %zu was a SINK)", + size_t(int_tnode), size_t(pin), size_t(ext_tnode)); + } + } else { + VPR_ERROR(VPR_ERROR_TIMING, "Unexpected timing node type for atom pin %zu", size_t(pin)); + } + } + + return true; //success +} diff --git a/vpr/src/timing/timing_graph_builder.h b/vpr/src/timing/timing_graph_builder.h index 8e6745b7c..f7fb28a55 100644 --- a/vpr/src/timing/timing_graph_builder.h +++ b/vpr/src/timing/timing_graph_builder.h @@ -32,6 +32,8 @@ class TimingGraphBuilder { bool is_netlist_clock_source(const AtomPinId pin) const; + bool validate_netlist_timing_graph_consistency() const; + private: std::unique_ptr tg_; From 591899dfb80686fc0d09db6ce6769999fb1f1196 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Jul 2022 00:02:19 +0000 Subject: [PATCH 3/4] Updated Patch Count --- VERSION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.md b/VERSION.md index 850459987..ba9659954 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -1.1.318 +1.1.329 From 21a0415ff3422967e692da3f6323d5729210576b Mon Sep 17 00:00:00 2001 From: tangxifan Date: Thu, 21 Jul 2022 17:52:21 -0700 Subject: [PATCH 4/4] Update compile.rst --- docs/source/tutorials/getting_started/compile.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/source/tutorials/getting_started/compile.rst b/docs/source/tutorials/getting_started/compile.rst index 2e9b8109c..05ccda637 100644 --- a/docs/source/tutorials/getting_started/compile.rst +++ b/docs/source/tutorials/getting_started/compile.rst @@ -30,12 +30,16 @@ In general, please follow the steps to compile **Quick Compilation Verification** +.. note:: Ensure that you install python dependences in :ref:`tutorial_compile_dependencies`. + To quickly verify the tool is well compiled, users can run the following command from OpenFPGA root repository .. code-block:: shell python3 openfpga_flow/scripts/run_fpga_task.py compilation_verification --debug --show_thread_logs +.. _tutorial_compile_dependencies: + Dependencies ~~~~~~~~~~~~ Full list of dependencies can be found at install_dependencies_build_. @@ -50,8 +54,11 @@ In particular, OpenFPGA requires specific versions for the following dependencie :python dependencies: python packages are also required: +.. code-block:: + python3 -m pip install -r requirements.txt + .. _install_dependencies_build: https://github.com/lnis-uofu/OpenFPGA/blob/master/.github/workflows/install_dependencies_build.sh