Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hier port map (to provide fast linking for large designs). #5836

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

andyfox-rushc
Copy link
Contributor

@andyfox-rushc andyfox-rushc commented Oct 1, 2024

This pull request includes the use of hash tables to provide fast access to dbInst, dbModInst, dbModBTerm, dbModITerms. The hashes are annotated as user fields on dbModule/dbModInst and populated during creation (and input streaming). To get the streamer to work the dbInst have to be written out after the dbModule, so the streamer was modified.

The read_db command has been augmented with a -hier flag to mark the database as being hierarchical.

Many of the redundant hashes in dbBlock have been removed. For example the modbterms hash is in the dbModule not the dbBlock. The original modinst hash on dbBlock is unused (but left in for backward compatibility). The database version was advanced to handle this change.

The name of instances in hierarchical mode is now the "scoped" local name so that the netlisted verilog in hierachical mode only has local names for instances. So in hierarchical mode name (const Instance*) return the "tail" of the name, though of course the fullpath name still works. A filter was put in to the various writers (eg lef/def) which require flat names.

…archical mode. Added read_db -hier

Signed-off-by: andyfox-rushc <[email protected]>
Signed-off-by: andyfox-rushc <[email protected]>
Signed-off-by: andyfox-rushc <[email protected]>
@andyfox-rushc andyfox-rushc marked this pull request as draft October 1, 2024 01:15
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/odb/include/odb/db.h Show resolved Hide resolved
src/odb/src/db/dbModBTerm.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Oct 1, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

github-actions bot commented Oct 1, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/dbSta/src/dbNetwork.cc Outdated Show resolved Hide resolved
src/dbSta/src/dbNetwork.cc Outdated Show resolved Hide resolved
src/odb/src/db/dbModuleBusPortModBTermItr.cpp Outdated Show resolved Hide resolved
src/odb/src/db/dbModuleModBTermItr.cpp Outdated Show resolved Hide resolved
src/odb/src/db/dbModulePortItr.cpp Outdated Show resolved Hide resolved
Signed-off-by: andyfox-rushc <[email protected]>
Copy link
Contributor

github-actions bot commented Oct 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: andyfox-rushc <[email protected]>
Signed-off-by: andyfox-rushc <[email protected]>
Copy link
Contributor

github-actions bot commented Oct 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link
Contributor

github-actions bot commented Oct 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: andyfox-rushc <[email protected]>
Copy link
Contributor

github-actions bot commented Oct 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

github-actions bot commented Oct 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: andyfox-rushc <[email protected]>
Copy link
Contributor

github-actions bot commented Oct 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: andyfox-rushc <[email protected]>
Copy link
Contributor

github-actions bot commented Oct 4, 2024

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

github-actions bot commented Oct 5, 2024

clang-tidy review says "All clean, LGTM! 👍"

@andyfox-rushc andyfox-rushc marked this pull request as ready for review October 5, 2024 02:01
@andyfox-rushc andyfox-rushc changed the title Hier port map (draft, to provide fast linking for large designs). Hier port map (to provide fast linking for large designs). Oct 5, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

dbDatabase* db = (dbDatabase*) (obj.getDatabase());
_dbBlock* block = (_dbBlock*) (db->getChip()->getBlock());
_dbModule* module = block->_module_tbl->getPtr(obj._parent);
module->_modbterm_hash[obj._name] = obj.getId();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The parameter must not be null [clang-analyzer-cplusplus.StringChecker]

    module->_modbterm_hash[obj._name] = obj.getId();
                           ^
Additional context

src/odb/src/db/dbModBTerm.cpp:147: Taking true branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModBTerm.cpp:148: Calling 'dbIStream::operator>>'

    stream >> obj._name;
    ^

src/odb/include/odb/dbStream.h:382: Assuming 'l' is equal to 0

    if (l == 0) {
        ^

src/odb/include/odb/dbStream.h:382: Taking true branch

    if (l == 0) {
    ^

src/odb/include/odb/dbStream.h:383: Null pointer value stored to field '_name'

      c = nullptr;
      ^

src/odb/src/db/dbModBTerm.cpp:148: Returning from 'dbIStream::operator>>'

    stream >> obj._name;
    ^

src/odb/src/db/dbModBTerm.cpp:150: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModBTerm.cpp:153: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModBTerm.cpp:156: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModBTerm.cpp:159: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModBTerm.cpp:162: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModBTerm.cpp:165: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModBTerm.cpp:168: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_odb_busport)) {
  ^

src/odb/src/db/dbModBTerm.cpp:171: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModBTerm.cpp:174: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_hier_port_removal)) {
  ^

src/odb/src/db/dbModBTerm.cpp:178: Taking true branch

  if (obj.getDatabase()->isSchema(db_schema_db_remove_hash)) {
  ^

src/odb/src/db/dbModBTerm.cpp:182: The parameter must not be null

    module->_modbterm_hash[obj._name] = obj.getId();
                           ^

dbDatabase* db = (dbDatabase*) (obj.getDatabase());
_dbBlock* block = (_dbBlock*) (db->getChip()->getBlock());
_dbModInst* mod_inst = block->_modinst_tbl->getPtr(obj._parent);
mod_inst->_moditerm_hash[obj._name] = obj.getId();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The parameter must not be null [clang-analyzer-cplusplus.StringChecker]

    mod_inst->_moditerm_hash[obj._name] = obj.getId();
                             ^
Additional context

src/odb/src/db/dbModITerm.cpp:133: Taking true branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModITerm.cpp:134: Calling 'dbIStream::operator>>'

    stream >> obj._name;
    ^

src/odb/include/odb/dbStream.h:382: Assuming 'l' is equal to 0

    if (l == 0) {
        ^

src/odb/include/odb/dbStream.h:382: Taking true branch

    if (l == 0) {
    ^

src/odb/include/odb/dbStream.h:383: Null pointer value stored to field '_name'

      c = nullptr;
      ^

src/odb/src/db/dbModITerm.cpp:134: Returning from 'dbIStream::operator>>'

    stream >> obj._name;
    ^

src/odb/src/db/dbModITerm.cpp:136: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModITerm.cpp:139: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModITerm.cpp:142: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModITerm.cpp:145: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModITerm.cpp:148: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModITerm.cpp:151: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_update_hierarchy)) {
  ^

src/odb/src/db/dbModITerm.cpp:154: Taking false branch

  if (obj.getDatabase()->isSchema(db_schema_hier_port_removal)) {
  ^

src/odb/src/db/dbModITerm.cpp:158: Taking true branch

  if (obj.getDatabase()->isSchema(db_schema_db_remove_hash)) {
  ^

src/odb/src/db/dbModITerm.cpp:162: The parameter must not be null

    mod_inst->_moditerm_hash[obj._name] = obj.getId();
                             ^

Signed-off-by: andyfox-rushc <[email protected]>
Copy link
Contributor

github-actions bot commented Oct 7, 2024

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: andyfox-rushc <[email protected]>
Copy link
Contributor

github-actions bot commented Oct 7, 2024

clang-tidy review says "All clean, LGTM! 👍"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants