Some Details

Variable Declarations

Each declaration has a set of namesakes (declarations with the same name). Take a look to an example below.

// A variable can be an _output_ and a _register_ (or a _wire_) at the same time.
output var;
reg var;

In this case, two declarations will be created:

  1. ID 1, name = "var", type = "output", namesakes = { ID 2 } ⟩
  2. ID 2, name = "var", type = "output", namesakes = { ID 1 } ⟩

The job is carried out by the redefiniton handler attached to the symbol table. Being requested with some name, the table checks whether it contains an entity with the given name. if it does, the redefinition handler is invoked, which does nothing unless the entities are declarations; for declarations, it updates the sets of namesakes.

Updated by Alexander Kamkin over 9 years ago · 4 revisions