now inout must be global port and I/O port so that it will appear in the top-level module
This commit is contained in:
parent
b9dab2baaf
commit
e6c896d583
|
@ -317,6 +317,18 @@ size_t check_circuit_library_ports(const CircuitLibrary& circuit_lib) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Check global output ports: make sure they are all I/Os */
|
||||
for (const auto& port : circuit_lib.ports()) {
|
||||
if ( (circuit_lib.port_is_global(port))
|
||||
&& (CIRCUIT_MODEL_PORT_OUTPUT == circuit_lib.port_type(port))
|
||||
&& (false == circuit_lib.port_is_io(port)) ) {
|
||||
VTR_LOG_ERROR("Circuit port (type=%s) of model (name=%s) is defined as global output port but not an I/O!\n",
|
||||
CIRCUIT_MODEL_PORT_TYPE_STRING[size_t(circuit_lib.port_type(port))],
|
||||
circuit_lib.model_name(port).c_str());
|
||||
num_err++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check set/reset/config_enable ports: make sure they are all global ports */
|
||||
for (const auto& port : circuit_lib.ports()) {
|
||||
if ( ( (circuit_lib.port_is_set(port))
|
||||
|
|
|
@ -489,9 +489,7 @@ void read_xml_circuit_port(pugi::xml_node& xml_port,
|
|||
/* Identify if the port is for io, this is only applicable to INPUT ports.
|
||||
* By default, it will NOT be a mode selection port
|
||||
*/
|
||||
if (CIRCUIT_MODEL_PORT_INPUT == circuit_lib.port_type(port)) {
|
||||
circuit_lib.set_port_is_io(port, get_attribute(xml_port, "io", loc_data, pugiutil::ReqOpt::OPTIONAL).as_bool(false));
|
||||
}
|
||||
circuit_lib.set_port_is_io(port, get_attribute(xml_port, "is_io", loc_data, pugiutil::ReqOpt::OPTIONAL).as_bool(false));
|
||||
|
||||
/* Identify if the port is for mode selection, this is only applicable to SRAM ports.
|
||||
* By default, it will NOT be a mode selection port
|
||||
|
|
|
@ -306,22 +306,17 @@ void build_primitive_block_module(ModuleManager& module_manager,
|
|||
/* Find the inout ports required by the primitive node, and add them to the module
|
||||
* This is mainly due to the I/O blocks, which have inout ports for the top-level fabric
|
||||
*/
|
||||
if (CIRCUIT_MODEL_IOPAD == circuit_lib.model_type(primitive_model)) {
|
||||
std::vector<CircuitPortId> primitive_model_inout_ports = circuit_lib.model_ports_by_type(primitive_model, CIRCUIT_MODEL_PORT_INOUT);
|
||||
for (auto port : primitive_model_inout_ports) {
|
||||
for (const auto& port : circuit_lib.model_global_ports(primitive_model, false)) {
|
||||
if ( (CIRCUIT_MODEL_PORT_INOUT == circuit_lib.port_type(port))
|
||||
&& (true == circuit_lib.port_is_io(port)) ) {
|
||||
add_primitive_module_fpga_global_io_port(module_manager, primitive_module,
|
||||
logic_module, logic_instance_id,
|
||||
ModuleManager::MODULE_GPIO_PORT,
|
||||
circuit_lib,
|
||||
primitive_model,
|
||||
port);
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the other i/o ports required by the primitive node, and add them to the module */
|
||||
for (const auto& port : circuit_lib.model_global_ports(primitive_model, false)) {
|
||||
if ( (CIRCUIT_MODEL_PORT_INPUT == circuit_lib.port_type(port))
|
||||
&& (true == circuit_lib.port_is_io(port)) ) {
|
||||
} else if ( (CIRCUIT_MODEL_PORT_INPUT == circuit_lib.port_type(port))
|
||||
&& (true == circuit_lib.port_is_io(port)) ) {
|
||||
add_primitive_module_fpga_global_io_port(module_manager, primitive_module,
|
||||
logic_module, logic_instance_id,
|
||||
ModuleManager::MODULE_GPIN_PORT,
|
||||
|
|
|
@ -203,6 +203,12 @@ void print_analysis_sdc_disable_global_ports(std::fstream& fp,
|
|||
continue;
|
||||
}
|
||||
|
||||
/* Skip any gpio port here! */
|
||||
if ( (CIRCUIT_MODEL_PORT_INOUT == circuit_lib.port_type(global_port))
|
||||
&& (true == circuit_lib.port_is_io(global_port)) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ModulePortId module_port = module_manager.find_module_port(top_module, circuit_lib.port_prefix(global_port));
|
||||
BasicPort port_to_disable = module_manager.module_port(top_module, module_port);
|
||||
|
||||
|
|
|
@ -37,8 +37,9 @@ ModuleId add_circuit_model_to_module_manager(ModuleManager& module_manager,
|
|||
|
||||
/* Add ports */
|
||||
/* Find global ports and add one by one
|
||||
* Global input ports will be considered as global port in the context of module manager
|
||||
* Global output ports will be considered as spy port in the context of module manager
|
||||
* Non-I/O Global input ports will be considered as global port to be shorted wired in the context of module manager
|
||||
* I/O Global output ports will be considered as general purpose output port in the context of module manager
|
||||
* I/O Global inout ports will be considered as general purpose i/o port in the context of module manager
|
||||
*/
|
||||
for (const auto& port : circuit_lib.model_global_ports(circuit_model, false)) {
|
||||
BasicPort port_info(circuit_lib.port_prefix(port), circuit_lib.port_size(port));
|
||||
|
@ -50,9 +51,12 @@ ModuleId add_circuit_model_to_module_manager(ModuleManager& module_manager,
|
|||
} else if ( (CIRCUIT_MODEL_PORT_INPUT == circuit_lib.port_type(port))
|
||||
&& (true == circuit_lib.port_is_io(port)) ) {
|
||||
module_manager.add_port(module, port_info, ModuleManager::MODULE_GPIN_PORT);
|
||||
} else {
|
||||
VTR_ASSERT(CIRCUIT_MODEL_PORT_OUTPUT == circuit_lib.port_type(port));
|
||||
} else if (CIRCUIT_MODEL_PORT_OUTPUT == circuit_lib.port_type(port)) {
|
||||
VTR_ASSERT(true == circuit_lib.port_is_io(port));
|
||||
module_manager.add_port(module, port_info, ModuleManager::MODULE_GPOUT_PORT);
|
||||
} else if ( (CIRCUIT_MODEL_PORT_INOUT == circuit_lib.port_type(port))
|
||||
&& (true == circuit_lib.port_is_io(port)) ) {
|
||||
module_manager.add_port(module, port_info, ModuleManager::MODULE_GPIO_PORT);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
|
@ -173,7 +173,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
@ -209,7 +209,7 @@
|
|||
<port type="output" prefix="rx_data" size="80"/>
|
||||
<port type="clock" prefix="tx_clk" size="1" default_val="0"/>
|
||||
<port type="clock" prefix="rx_clk" size="1" default_val="0"/>
|
||||
<port type="inout" prefix="pad" size="80"/>
|
||||
<port type="inout" prefix="pad" size="80" is_global="true" is_io="true"/>
|
||||
</circuit_model>
|
||||
</circuit_library>
|
||||
<configuration_protocol>
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
|
@ -179,7 +179,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
|
@ -173,11 +173,11 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true" />
|
||||
<!-- A spypad for the direction port of the I/O pad, which can be visible in the fpga_top -->
|
||||
<port type="input" prefix="din" size="1" is_global="true" io="true" default_value="0"/>
|
||||
<port type="output" prefix="dout" size="1" is_global="true"/>
|
||||
<port type="output" prefix="dir" size="1" is_global="true"/>
|
||||
<port type="input" prefix="din" size="1" is_global="true" is_io="true" default_value="0"/>
|
||||
<port type="output" prefix="dout" size="1" is_global="true" is_io="true"/>
|
||||
<port type="output" prefix="dir" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
|
@ -164,7 +164,7 @@
|
|||
<design_technology type="cmos"/>
|
||||
<input_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<output_buffer exist="true" circuit_model_name="INVTX1"/>
|
||||
<port type="inout" prefix="pad" size="1"/>
|
||||
<port type="inout" prefix="pad" size="1" is_global="true" is_io="true"/>
|
||||
<port type="sram" prefix="en" size="1" mode_select="true" circuit_model_name="sc_dff_compact" default_val="1"/>
|
||||
<port type="input" prefix="outpad" size="1"/>
|
||||
<port type="output" prefix="inpad" size="1"/>
|
||||
|
|
Loading…
Reference in New Issue