aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-03-17 21:22:44 +0100
committerTristan Gingold <tgingold@free.fr>2021-03-17 21:30:40 +0100
commit38308d94658dc83856691fdb4bb6ad1ace8dc01a (patch)
tree71132a6d3591796a3e30b188d2d2701bd91ded26
parentdb40ae63b93c4b033376b663d6224a2da208900d (diff)
downloadghdl-yosys-plugin-38308d94658dc83856691fdb4bb6ad1ace8dc01a.tar.gz
ghdl-yosys-plugin-38308d94658dc83856691fdb4bb6ad1ace8dc01a.tar.bz2
ghdl-yosys-plugin-38308d94658dc83856691fdb4bb6ad1ace8dc01a.zip
ghdl.cc: handle attributes on output ports
-rw-r--r--src/ghdl.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/ghdl.cc b/src/ghdl.cc
index de06f1f..8b6b151 100644
--- a/src/ghdl.cc
+++ b/src/ghdl.cc
@@ -633,7 +633,7 @@ static void import_module(RTLIL::Design *design, GhdlSynth::Module m)
std::vector<Instance> memories;
if (!is_valid(self_inst)) { // blackbox
- module->set_bool_attribute("\\blackbox");
+ module->set_bool_attribute(ID::blackbox);
Port_Idx nbr_inputs = get_nbr_inputs(m);
for (Port_Idx idx = 0; idx < nbr_inputs; idx++) {
@@ -766,6 +766,7 @@ static void import_module(RTLIL::Design *design, GhdlSynth::Module m)
}
}
break;
+ case Id_Output:
case Id_Inout:
case Id_Iinout:
// The wire was created when the port was.
@@ -784,7 +785,6 @@ static void import_module(RTLIL::Design *design, GhdlSynth::Module m)
case Id_Signal:
case Id_Isignal:
break;
- case Id_Output:
case Id_Port:
case Id_Const_UB32:
case Id_Const_SB32:
@@ -841,12 +841,7 @@ static void import_module(RTLIL::Design *design, GhdlSynth::Module m)
}
// Attributes
- for (Attribute attr = get_first_attribute (inst);
- attr.id != 0;
- attr = get_attribute_next(attr)) {
- IdString id = build_attribute_id(attr);
- w->attributes[id] = build_attribute_val(attr);
- }
+ add_attributes(*w, inst);
break;
}
default:
@@ -1198,6 +1193,15 @@ static void import_module(RTLIL::Design *design, GhdlSynth::Module m)
wire->width = get_width(output_out);
module->connect(wire, get_src(net_map, output_out));
+
+ Instance inst = get_net_parent(output_out);
+ switch(get_id(inst)) {
+ case Id_Output:
+ add_attributes(*wire, inst);
+ break;
+ default:
+ break;
+ }
}
module->fixup_ports();