give specific name to mux so that we can bind it to SDC generator

This commit is contained in:
tangxifan 2019-11-10 19:42:30 -07:00
parent 3d711823e5
commit 8e8e59b0ca
5 changed files with 106 additions and 0 deletions

View File

@ -758,6 +758,25 @@ std::string generate_grid_block_module_name(const std::string& prefix,
return module_name; return module_name;
} }
/*********************************************************************
* Generate the instance name for a programmable routing multiplexer module
* in a Switch Block
* To keep a unique name in each module and also consider unique routing modules,
* please do NOT include any coordinates in the naming!!!
* Consider only relative coordinate, such as side!
********************************************************************/
std::string generate_sb_mux_instance_name(const std::string& prefix,
const e_side& sb_side,
const size_t& track_id,
const std::string& postfix) {
std::string instance_name(prefix);
instance_name += Side(sb_side).to_string();
instance_name += std::string("_track_") + std::to_string(track_id);
instance_name += postfix;
return instance_name;
}
/********************************************************************* /*********************************************************************
* Generate the instance name for a configurable memory module in a Switch Block * Generate the instance name for a configurable memory module in a Switch Block
* To keep a unique name in each module and also consider unique routing modules, * To keep a unique name in each module and also consider unique routing modules,
@ -776,6 +795,26 @@ std::string generate_sb_memory_instance_name(const std::string& prefix,
return instance_name; return instance_name;
} }
/*********************************************************************
* Generate the instance name for a programmable routing multiplexer module
* in a Connection Block
* To keep a unique name in each module and also consider unique routing modules,
* please do NOT include any coordinates in the naming!!!
* Consider only relative coordinate, such as side!
********************************************************************/
std::string generate_cb_mux_instance_name(const std::string& prefix,
const e_side& cb_side,
const size_t& pin_id,
const std::string& postfix) {
std::string instance_name(prefix);
instance_name += Side(cb_side).to_string();
instance_name += std::string("_ipin_") + std::to_string(pin_id);
instance_name += postfix;
return instance_name;
}
/********************************************************************* /*********************************************************************
* Generate the instance name for a configurable memory module in a Connection Block * Generate the instance name for a configurable memory module in a Connection Block
* To keep a unique name in each module and also consider unique routing modules, * To keep a unique name in each module and also consider unique routing modules,
@ -795,6 +834,38 @@ std::string generate_cb_memory_instance_name(const std::string& prefix,
return instance_name; return instance_name;
} }
/*********************************************************************
* Generate the instance name for a programmable routing multiplexer
* module in a physical block of a grid
* To guarentee a unique name for pb_graph pin,
* the instance name includes the index of parent node
* as well as the port name and pin index of this pin
*
* Exceptions:
* For OUTPUT ports, due to hierarchical module organization,
* their parent nodes will be uniquified
* So, we should not add any index here
********************************************************************/
std::string generate_pb_mux_instance_name(const std::string& prefix,
t_pb_graph_pin* pb_graph_pin,
const std::string& postfix) {
std::string instance_name(prefix);
instance_name += std::string(pb_graph_pin->parent_node->pb_type->name);
if (IN_PORT == pb_graph_pin->port->type) {
instance_name += std::string("_");
instance_name += std::to_string(pb_graph_pin->parent_node->placement_index);
}
instance_name += std::string("_");
instance_name += std::string(pb_graph_pin->port->name);
instance_name += std::string("_");
instance_name += std::to_string(pb_graph_pin->pin_number);
instance_name += postfix;
return instance_name;
}
/********************************************************************* /*********************************************************************
* Generate the instance name for a configurable memory module in a * Generate the instance name for a configurable memory module in a
* physical block of a grid * physical block of a grid

View File

@ -78,16 +78,30 @@ std::string generate_switch_block_module_name(const vtr::Point<size_t>& coordina
std::string generate_connection_block_module_name(const t_rr_type& cb_type, std::string generate_connection_block_module_name(const t_rr_type& cb_type,
const vtr::Point<size_t>& coordinate); const vtr::Point<size_t>& coordinate);
std::string generate_sb_mux_instance_name(const std::string& prefix,
const e_side& sb_side,
const size_t& track_id,
const std::string& postfix);
std::string generate_sb_memory_instance_name(const std::string& prefix, std::string generate_sb_memory_instance_name(const std::string& prefix,
const e_side& sb_side, const e_side& sb_side,
const size_t& track_id, const size_t& track_id,
const std::string& postfix); const std::string& postfix);
std::string generate_cb_mux_instance_name(const std::string& prefix,
const e_side& cb_side,
const size_t& pin_id,
const std::string& postfix);
std::string generate_cb_memory_instance_name(const std::string& prefix, std::string generate_cb_memory_instance_name(const std::string& prefix,
const e_side& cb_side, const e_side& cb_side,
const size_t& pin_id, const size_t& pin_id,
const std::string& postfix); const std::string& postfix);
std::string generate_pb_mux_instance_name(const std::string& prefix,
t_pb_graph_pin* pb_graph_pin,
const std::string& postfix);
std::string generate_pb_memory_instance_name(const std::string& prefix, std::string generate_pb_memory_instance_name(const std::string& prefix,
t_pb_graph_pin* pb_graph_pin, t_pb_graph_pin* pb_graph_pin,
const std::string& postfix); const std::string& postfix);

View File

@ -16,6 +16,10 @@ constexpr char* SWITCH_BLOCK_MEM_INSTANCE_PREFIX = "mem_";
constexpr char* CONNECTION_BLOCK_MEM_INSTANCE_PREFIX = "mem_"; constexpr char* CONNECTION_BLOCK_MEM_INSTANCE_PREFIX = "mem_";
constexpr char* MEMORY_MODULE_POSTFIX = "_mem"; constexpr char* MEMORY_MODULE_POSTFIX = "_mem";
/* Multiplexer naming constant strings */
constexpr char* GRID_MUX_INSTANCE_PREFIX = "mux_";
constexpr char* SWITCH_BLOCK_MUX_INSTANCE_PREFIX = "mux_";
constexpr char* CONNECTION_BLOCK_MUX_INSTANCE_PREFIX = "mux_";
/* Bitstream file strings */ /* Bitstream file strings */
constexpr char* BITSTREAM_XML_FILE_NAME_POSTFIX = "_bitstream.xml"; constexpr char* BITSTREAM_XML_FILE_NAME_POSTFIX = "_bitstream.xml";

View File

@ -559,6 +559,11 @@ void add_module_pb_graph_pin_interc(ModuleManager& module_manager,
/* Instanciate the MUX */ /* Instanciate the MUX */
size_t mux_instance = module_manager.num_instance(pb_module, mux_module); size_t mux_instance = module_manager.num_instance(pb_module, mux_module);
module_manager.add_child_module(pb_module, mux_module); module_manager.add_child_module(pb_module, mux_module);
/* Give an instance name: this name should be consistent with the block name given in SDC generator,
* If you want to bind the SDC generation to modules
*/
std::string mux_instance_name = generate_pb_mux_instance_name(GRID_MUX_INSTANCE_PREFIX, des_pb_graph_pin, std::string(""));
module_manager.set_child_instance_name(pb_module, mux_module, mux_instance, mux_instance_name);
/* Instanciate a memory module for the MUX */ /* Instanciate a memory module for the MUX */
std::string mux_mem_module_name = generate_mux_subckt_name(circuit_lib, std::string mux_mem_module_name = generate_mux_subckt_name(circuit_lib,

View File

@ -128,6 +128,12 @@ void build_switch_block_mux_module(ModuleManager& module_manager,
/* Instanciate the MUX Module */ /* Instanciate the MUX Module */
module_manager.add_child_module(sb_module, mux_module); module_manager.add_child_module(sb_module, mux_module);
/* Give an instance name: this name should be consistent with the block name given in SDC manager,
* If you want to bind the SDC generation to modules
*/
std::string mux_instance_name = generate_sb_memory_instance_name(SWITCH_BLOCK_MUX_INSTANCE_PREFIX, chan_side, chan_node_id, std::string(""));
module_manager.set_child_instance_name(sb_module, mux_module, mux_instance_id, mux_instance_name);
/* Generate input ports that are wired to the input bus of the routing multiplexer */ /* Generate input ports that are wired to the input bus of the routing multiplexer */
std::vector<ModulePortId> sb_input_port_ids = find_switch_block_module_input_ports(module_manager, sb_module, rr_gsb, grids, drive_rr_nodes); std::vector<ModulePortId> sb_input_port_ids = find_switch_block_module_input_ports(module_manager, sb_module, rr_gsb, grids, drive_rr_nodes);
@ -515,6 +521,12 @@ void build_connection_block_mux_module(ModuleManager& module_manager,
size_t mux_instance_id = module_manager.num_instance(cb_module, mux_module); size_t mux_instance_id = module_manager.num_instance(cb_module, mux_module);
module_manager.add_child_module(cb_module, mux_module); module_manager.add_child_module(cb_module, mux_module);
/* Give an instance name: this name should be consistent with the block name given in SDC manager,
* If you want to bind the SDC generation to modules
*/
std::string mux_instance_name = generate_cb_mux_instance_name(CONNECTION_BLOCK_MUX_INSTANCE_PREFIX, rr_gsb.get_ipin_node_grid_side(cb_ipin_side, ipin_index), ipin_index, std::string(""));
module_manager.set_child_instance_name(cb_module, mux_module, mux_instance_id, mux_instance_name);
/* TODO: Generate input ports that are wired to the input bus of the routing multiplexer */ /* TODO: Generate input ports that are wired to the input bus of the routing multiplexer */
std::vector<ModulePortId> cb_input_port_ids = find_connection_block_module_input_ports(module_manager, cb_module, rr_gsb, cb_type, drive_rr_nodes); std::vector<ModulePortId> cb_input_port_ids = find_connection_block_module_input_ports(module_manager, cb_module, rr_gsb, cb_type, drive_rr_nodes);