[Tool] Bug fix for bitstream estimator due to the current special status of frame-based protocol

This commit is contained in:
tangxifan 2020-10-29 17:35:55 -06:00
parent c2c384e24b
commit 8ef6ae32fb
2 changed files with 7 additions and 7 deletions

View File

@ -672,11 +672,10 @@ size_t generate_top_module_sram_port_size(const ConfigProtocol& config_protocol,
break;
case CONFIG_MEM_SCAN_CHAIN:
case CONFIG_MEM_MEMORY_BANK:
case CONFIG_MEM_FRAME_BASED:
/* CCFF head/tail, data input could be multi-bit ports */
sram_port_size = config_protocol.num_regions();
break;
case CONFIG_MEM_FRAME_BASED:
break;
default:
VTR_LOGF_ERROR(__FILE__, __LINE__,
"Invalid type of SRAM organization!\n");
@ -785,7 +784,7 @@ void add_top_module_sram_ports(ModuleManager& module_manager,
BasicPort addr_port(std::string(DECODER_ADDRESS_PORT_NAME), total_num_config_bits);
module_manager.add_port(module_id, addr_port, ModuleManager::MODULE_INPUT_PORT);
BasicPort din_port(std::string(DECODER_DATA_IN_PORT_NAME), 1);
BasicPort din_port(std::string(DECODER_DATA_IN_PORT_NAME), sram_port_size);
module_manager.add_port(module_id, din_port, ModuleManager::MODULE_INPUT_PORT);
break;

View File

@ -82,16 +82,17 @@ size_t rec_estimate_device_bitstream_num_bits(const ModuleManager& module_manage
* Iterate over the configurable children regardless of regions
*/
if (parent_module == top_module) {
for (const ConfigRegionId& config_region : module_manager.regions(top_module)) {
for (const ConfigRegionId& config_region : module_manager.regions(parent_module)) {
size_t curr_region_num_config_child = module_manager.region_configurable_children(parent_module, config_region).size();
/* Frame-based configuration protocol will have 1 decoder
/* FIXME: This will be uncommented when multi-region support is extended for frame-based
* Frame-based configuration protocol will have 1 decoder
* if there are more than 1 configurable children
*/
if ( (CONFIG_MEM_FRAME_BASED == config_protocol_type)
&& (2 <= curr_region_num_config_child)) {
curr_region_num_config_child--;
}
*/
/* Memory configuration protocol will have 2 decoders
* at the top-level
@ -108,7 +109,7 @@ size_t rec_estimate_device_bitstream_num_bits(const ModuleManager& module_manage
}
}
} else {
VTR_ASSERT_SAFE(parent_module == top_module);
VTR_ASSERT_SAFE(parent_module != top_module);
size_t num_configurable_children = module_manager.configurable_children(parent_module).size();