Merge pull request #71 from Silimate/mem_size_limit

Mem size limit
This commit is contained in:
Akash Levy 2025-03-17 10:45:55 -07:00 committed by GitHub
commit dbc3418585
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -1676,8 +1676,9 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
log_error("Verific RamNet %s is connected to unsupported instance type %s (%s).\n",
net->Name(), pr->GetInst()->View()->Owner()->Name(), pr->GetInst()->Name());
}
if ((bits_in_word * number_of_bits) > (1 << 23))
log_error("Memory %s size is larger than 2**23 bits\n", net->Name());
if ((bits_in_word * number_of_bits) > (uint64_t)(((uint64_t)1) << 28))
log_error("Memory %s size is larger than 2**28 bits, bits_in_word: %ld, number_of_bits: %ld, total: %ld\n", net->Name(),
bits_in_word, number_of_bits, bits_in_word * number_of_bits);
memory->width = bits_in_word;
memory->size = number_of_bits / bits_in_word;