Skip to content

Commit 1cf4f1b

Browse files
authored
Merge pull request #41 from litghost/rework_mode_support
Do allow fasm_lut in mode or in pb_type with 1 mode.
2 parents 5c36489 + 727a5cf commit 1cf4f1b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

doc/src/utils/fasm.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,12 @@ example:
148148
</meta>
149149
</metadata>
150150
151-
FASM LUT metadata must be attached to the ``<pb_type>`` at or directly above
152-
the ``<pb_type>`` with ``blif_model=".names"``. The FASM LUT metadata tags
153-
will not be recognized attached inside of ``<mode>`` tags or inside
154-
``<pb_type>``'s higher than 1 level above the leaf type.
151+
FASM LUT metadata must be attached to the ``<pb_type>`` at or within the
152+
``<mode>`` tag directly above the ``<pb_type>`` with ``blif_model=".names"``.
153+
Do note that there is an implicit ``<mode>`` tag within intermediate
154+
``<pb_type>`` when no explicit ``<mode>`` tag is present. The FASM LUT
155+
metadata tags will not be recognized attached inside of ``<pb_type>``'s higher
156+
above the leaf type.
155157

156158
When specifying a FASM features with more than one bit, explicitly specify the
157159
bit range being set. This is required because "genfasm" does not have access

utils/fasm/src/fasm.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,12 @@ static const t_metadata_dict *get_fasm_type(const t_pb_graph_node* pb_graph_node
382382
if(pb_graph_node->pb_type->parent_mode != nullptr) {
383383
VTR_ASSERT(pb_graph_node->pb_type->parent_mode->parent_pb_type != nullptr);
384384
const t_pb_type *pb_type = pb_graph_node->pb_type->parent_mode->parent_pb_type;
385-
if(pb_type->meta.has("fasm_type")) {
386-
meta = &pb_type->meta;
385+
if(pb_graph_node->pb_type->parent_mode->meta.has("fasm_type")) {
386+
meta = &pb_graph_node->pb_type->parent_mode->meta;
387+
} else if(pb_type->num_modes <= 1) {
388+
if(pb_type->meta.has("fasm_type")) {
389+
meta = &pb_type->meta;
390+
}
387391
}
388392
}
389393

0 commit comments

Comments
 (0)