diff --git a/libopenfpga/libarchopenfpga/arch/sample_arch.xml b/libopenfpga/libarchopenfpga/arch/sample_arch.xml index d3b289b05..aaadd04ad 100644 --- a/libopenfpga/libarchopenfpga/arch/sample_arch.xml +++ b/libopenfpga/libarchopenfpga/arch/sample_arch.xml @@ -270,7 +270,7 @@ - + diff --git a/libopenfpga/libarchopenfpga/src/pb_type_annotation.cpp b/libopenfpga/libarchopenfpga/src/pb_type_annotation.cpp index dda74520b..806a76c44 100644 --- a/libopenfpga/libarchopenfpga/src/pb_type_annotation.cpp +++ b/libopenfpga/libarchopenfpga/src/pb_type_annotation.cpp @@ -51,6 +51,14 @@ bool PbTypeAnnotation::is_physical_pb_type() const { return true == physical_pb_type_name_.empty(); } +std::string PbTypeAnnotation::physical_mode_name() const { + return physical_mode_name_; +} + +std::string PbTypeAnnotation::idle_mode_name() const { + return idle_mode_name_; +} + std::string PbTypeAnnotation::mode_bits() const { return mode_bits_; } @@ -121,6 +129,14 @@ void PbTypeAnnotation::set_physical_parent_mode_names(const std::vector physical_parent_pb_type_names() const; std::vector physical_parent_mode_names() const; bool is_physical_pb_type() const; + std::string physical_mode_name() const; + std::string idle_mode_name() const; std::string mode_bits() const; std::string circuit_model_name() const; int physical_pb_type_index_factor() const; @@ -55,6 +57,8 @@ class PbTypeAnnotation { void set_physical_pb_type_name(const std::string& name); void set_physical_parent_pb_type_names(const std::vector& names); void set_physical_parent_mode_names(const std::vector& names); + void set_physical_mode_name(const std::string& name); + void set_idle_mode_name(const std::string& name); void set_mode_bits(const std::string& mode_bits); void set_circuit_model_name(const std::string& name); void physical_pb_type_index_factor(const int& value); @@ -89,6 +93,12 @@ class PbTypeAnnotation { std::vector physical_parent_pb_type_names_; std::vector physical_parent_mode_names_; + /* Identify which mode is the physical implementation of an operating pb_type */ + std::string physical_mode_name_; + + /* Identify in which mode is the pb_type will operate when it is not used */ + std::string idle_mode_name_; + /* Configuration bits to select an operting mode for the circuit mode name */ std::string mode_bits_; diff --git a/libopenfpga/libarchopenfpga/src/read_xml_pb_type_annotation.cpp b/libopenfpga/libarchopenfpga/src/read_xml_pb_type_annotation.cpp index 9bf10a171..7ac685436 100644 --- a/libopenfpga/libarchopenfpga/src/read_xml_pb_type_annotation.cpp +++ b/libopenfpga/libarchopenfpga/src/read_xml_pb_type_annotation.cpp @@ -30,6 +30,7 @@ void read_xml_pb_type_annotation(pugi::xml_node& xml_pb_type, /* Find the name of pb_type */ const std::string& name_attr = get_attribute(xml_pb_type, "name", loc_data).as_string(); const std::string& physical_name_attr = get_attribute(xml_pb_type, "physical_pb_type_name", loc_data, pugiutil::ReqOpt::OPTIONAL).as_string(); + const std::string& physical_mode_name_attr = get_attribute(xml_pb_type, "physical_mode_name", loc_data, pugiutil::ReqOpt::OPTIONAL).as_string(); /* If both names are not empty, this is a operating pb_type */ if ( (false == name_attr.empty()) @@ -45,6 +46,20 @@ void read_xml_pb_type_annotation(pugi::xml_node& xml_pb_type, pb_type_annotation.set_physical_pb_type_name(name_attr); } + /* Parse physical mode name which are applied to both pb_types */ + pb_type_annotation.set_physical_mode_name(get_attribute(xml_pb_type, "physical_mode_name", loc_data, pugiutil::ReqOpt::OPTIONAL).as_string()); + + /* Parse idle mode name which are applied to both pb_types */ + pb_type_annotation.set_idle_mode_name(get_attribute(xml_pb_type, "idle_mode_name", loc_data, pugiutil::ReqOpt::OPTIONAL).as_string()); + + /* Parse mode bits which are applied to both pb_types */ + pb_type_annotation.set_mode_bits(get_attribute(xml_pb_type, "mode_bits", loc_data, pugiutil::ReqOpt::OPTIONAL).as_string()); + + /* If this is a physical pb_type, circuit model name is a mandatory attribute */ + if (true == pb_type_annotation.is_physical_pb_type()) { + pb_type_annotation.set_circuit_model_name(get_attribute(xml_pb_type, "circuit_model_name", loc_data).as_string()); + } + /* Finish parsing and add it to the vector */ pb_type_annotations.push_back(pb_type_annotation); }