Skip to content

Commit 4f09969

Browse files
committed
Output fasm_features attached to modes or pb_types.
Signed-off-by: Keith Rothman <[email protected]>
1 parent d5646b9 commit 4f09969

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

utils/fasm/src/fasm.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ static const t_pb_graph_pin* is_node_used(const t_pb_route *top_pb_route, const
162162
return nullptr;
163163
}
164164

165+
void FasmWriterVisitor::check_features(t_metadata_dict *meta) const {
166+
if(meta == nullptr) {
167+
return;
168+
}
169+
170+
if(!meta->has("fasm_features")) {
171+
return;
172+
}
173+
174+
output_fasm_features(meta->one("fasm_features")->as_string());
175+
}
176+
165177
void FasmWriterVisitor::visit_all_impl(const t_pb_route *pb_route, const t_pb* pb,
166178
const t_pb_graph_node* pb_graph_node) {
167179
clb_prefix_ = build_clb_prefix(pb_graph_node);
@@ -170,6 +182,11 @@ void FasmWriterVisitor::visit_all_impl(const t_pb_route *pb_route, const t_pb* p
170182
t_pb_type *pb_type = pb_graph_node->pb_type;
171183
auto *mode = &pb_type->modes[pb->mode];
172184

185+
check_features(pb_type->meta);
186+
if(mode != nullptr) {
187+
check_features(mode->meta);
188+
}
189+
173190
if(mode != nullptr && std::string(mode->name) == "wire") {
174191
auto io_pin = is_node_used(pb_route, pb_graph_node);
175192
if(io_pin != nullptr) {

utils/fasm/src/fasm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class FasmWriterVisitor : public NetlistVisitor {
3131

3232
private:
3333
void output_fasm_features(std::string features) const;
34+
void check_features(t_metadata_dict *meta) const;
3435
void check_interconnect(const t_pb_route *pb_route, int inode);
3536
void check_for_lut(const t_pb* atom);
3637
void output_fasm_mux(std::string fasm_mux, t_interconnect *interconnect, t_pb_graph_pin *mux_input_pin);

0 commit comments

Comments
 (0)