bug fix in lut and mux module generation on supporting spypads
This commit is contained in:
parent
726185cd5e
commit
8ac6e10727
|
@ -777,7 +777,7 @@ std::vector<CircuitPortId> CircuitLibrary::model_ports_by_type(const CircuitMode
|
|||
if ( type != port_type(port_id) ) {
|
||||
continue;
|
||||
}
|
||||
/* We skip global ports if specified */
|
||||
/* We skip global ports if specified. Note: I/O port should be kept */
|
||||
if ( (true == ignore_global_port)
|
||||
&& (true == port_is_global(port_id)) ) {
|
||||
continue;
|
||||
|
|
|
@ -163,16 +163,36 @@ void add_primitive_module_fpga_global_io_port(ModuleManager& module_manager,
|
|||
BasicPort logic_io_port = module_manager.module_port(logic_module, logic_io_port_id);
|
||||
VTR_ASSERT(logic_io_port.get_width() == module_port.get_width());
|
||||
|
||||
/* Wire the GPIO port form primitive_module to the logic module!*/
|
||||
/* Wire the GPIO port from primitive_module to the logic module!*/
|
||||
for (size_t pin_id = 0; pin_id < module_port.pins().size(); ++pin_id) {
|
||||
ModuleNetId net = module_manager.create_module_net(primitive_module);
|
||||
if ( (ModuleManager::MODULE_GPIO_PORT == module_io_port_type)
|
||||
|| (ModuleManager::MODULE_GPIN_PORT == module_io_port_type) ) {
|
||||
module_manager.add_module_net_source(primitive_module, net, primitive_module, 0, primitive_io_port_id, module_port.pins()[pin_id]);
|
||||
bool net_exist = true;
|
||||
/* If the source port has already a net to drive, we just update the net sinks */
|
||||
ModuleNetId net = module_manager.module_instance_port_net(primitive_module, primitive_module, 0, primitive_io_port_id, module_port.pins()[pin_id]);
|
||||
if (net == ModuleNetId::INVALID()) {
|
||||
net_exist = false;
|
||||
net = module_manager.create_module_net(primitive_module);
|
||||
}
|
||||
|
||||
if (false == net_exist) {
|
||||
module_manager.add_module_net_source(primitive_module, net, primitive_module, 0, primitive_io_port_id, module_port.pins()[pin_id]);
|
||||
}
|
||||
module_manager.add_module_net_sink(primitive_module, net, logic_module, logic_instance_id, logic_io_port_id, logic_io_port.pins()[pin_id]);
|
||||
} else {
|
||||
bool net_exist = true;
|
||||
/* If the source port has already a net to drive, we just update the net sinks */
|
||||
ModuleNetId net = module_manager.module_instance_port_net(primitive_module, logic_module, logic_instance_id, logic_io_port_id, logic_io_port.pins()[pin_id]);
|
||||
if (net == ModuleNetId::INVALID()) {
|
||||
net_exist = false;
|
||||
net = module_manager.create_module_net(primitive_module);
|
||||
}
|
||||
|
||||
VTR_ASSERT(ModuleManager::MODULE_GPOUT_PORT == module_io_port_type);
|
||||
module_manager.add_module_net_source(primitive_module, net, logic_module, logic_instance_id, logic_io_port_id, logic_io_port.pins()[pin_id]);
|
||||
|
||||
if (false == net_exist) {
|
||||
module_manager.add_module_net_source(primitive_module, net, logic_module, logic_instance_id, logic_io_port_id, logic_io_port.pins()[pin_id]);
|
||||
}
|
||||
module_manager.add_module_net_sink(primitive_module, net, primitive_module, 0, primitive_io_port_id, module_port.pins()[pin_id]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ void build_lut_module(ModuleManager& module_manager,
|
|||
/* Get the input ports from the mux */
|
||||
std::vector<CircuitPortId> lut_input_ports = circuit_lib.model_ports_by_type(lut_model, CIRCUIT_MODEL_PORT_INPUT, true);
|
||||
/* Get the output ports from the mux */
|
||||
std::vector<CircuitPortId> lut_output_ports = circuit_lib.model_ports_by_type(lut_model, CIRCUIT_MODEL_PORT_OUTPUT, true);
|
||||
std::vector<CircuitPortId> lut_output_ports = circuit_lib.model_ports_by_type(lut_model, CIRCUIT_MODEL_PORT_OUTPUT, false);
|
||||
|
||||
/* Classify SRAM ports into two categories: regular (not for mode select) and mode-select */
|
||||
std::vector<CircuitPortId> lut_regular_sram_ports = find_circuit_regular_sram_ports(circuit_lib, lut_model);
|
||||
|
|
|
@ -849,7 +849,7 @@ vtr::vector<MuxOutputId, ModuleNetId> build_mux_module_output_buffers(ModuleMana
|
|||
vtr::vector<MuxOutputId, ModuleNetId> mux_output_nets(mux_graph.num_outputs(), ModuleNetId::INVALID());
|
||||
|
||||
/* Get the output ports from the mux */
|
||||
std::vector<CircuitPortId> mux_output_ports = circuit_lib.model_ports_by_type(mux_model, CIRCUIT_MODEL_PORT_OUTPUT, true);
|
||||
std::vector<CircuitPortId> mux_output_ports = circuit_lib.model_ports_by_type(mux_model, CIRCUIT_MODEL_PORT_OUTPUT, false);
|
||||
|
||||
/* Iterate over all the outputs in the MUX module */
|
||||
for (const auto& output_port : mux_output_ports) {
|
||||
|
@ -1098,7 +1098,7 @@ void build_cmos_mux_module(ModuleManager& module_manager,
|
|||
/* Get the input ports from the mux */
|
||||
std::vector<CircuitPortId> mux_input_ports = circuit_lib.model_ports_by_type(mux_model, CIRCUIT_MODEL_PORT_INPUT, true);
|
||||
/* Get the output ports from the mux */
|
||||
std::vector<CircuitPortId> mux_output_ports = circuit_lib.model_ports_by_type(mux_model, CIRCUIT_MODEL_PORT_OUTPUT, true);
|
||||
std::vector<CircuitPortId> mux_output_ports = circuit_lib.model_ports_by_type(mux_model, CIRCUIT_MODEL_PORT_OUTPUT, false);
|
||||
/* Get the sram ports from the mux
|
||||
* Multiplexing structure does not mode_sram_ports, they are handled in LUT modules
|
||||
* Here we just bypass it.
|
||||
|
|
|
@ -1001,7 +1001,7 @@ void MuxGraph::build_onelevel_mux_graph(const size_t& mux_size,
|
|||
void MuxGraph::add_fracturable_outputs(const CircuitLibrary& circuit_lib,
|
||||
const CircuitModelId& circuit_model) {
|
||||
/* Iterate over output ports */
|
||||
for (const auto& port : circuit_lib.model_ports_by_type(circuit_model, CIRCUIT_MODEL_PORT_OUTPUT, true)) {
|
||||
for (const auto& port : circuit_lib.model_ports_by_type(circuit_model, CIRCUIT_MODEL_PORT_OUTPUT, false)) {
|
||||
/* Get the fracturable_level */
|
||||
size_t frac_level = circuit_lib.port_lut_frac_level(port);
|
||||
/* Bypass invalid frac_level */
|
||||
|
|
Loading…
Reference in New Issue