Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
language:namespaces [2020/06/19 07:26] rajit [Importing namespaces] |
language:namespaces [2022/05/13 08:46] (current) rajit |
||
---|---|---|---|
Line 12: | Line 12: | ||
A namespace is created by using the '' | A namespace is created by using the '' | ||
- | < | + | < |
namespace lib { | namespace lib { | ||
... | ... | ||
Line 38: | Line 38: | ||
namespaces is shown below. | namespaces is shown below. | ||
- | < | + | < |
namespace datapath { | namespace datapath { | ||
export defproc bus_interface(...) { ... } | export defproc bus_interface(...) { ... } | ||
Line 64: | Line 64: | ||
the entire namespace '' | the entire namespace '' | ||
- | < | + | < |
namespace datapath { | namespace datapath { | ||
export defproc bus_interface(...) { ... } | export defproc bus_interface(...) { ... } | ||
Line 93: | Line 93: | ||
The basic form of import statement is shown below: | The basic form of import statement is shown below: | ||
- | < | + | < |
import " | import " | ||
... | ... | ||
Line 111: | Line 111: | ||
hierarchy. The import statement | hierarchy. The import statement | ||
- | < | + | < |
import processor:: | import processor:: | ||
</ | </ | ||
Line 117: | Line 117: | ||
is equivalent to the following: | is equivalent to the following: | ||
- | < | + | < |
import " | import " | ||
</ | </ | ||
Line 125: | Line 125: | ||
'' | '' | ||
- | < | + | < |
import foo; | import foo; | ||
</ | </ | ||
Line 143: | Line 143: | ||
To resolve this issue, ACT provides a way to rename a namespace that has been imported. | To resolve this issue, ACT provides a way to rename a namespace that has been imported. | ||
- | < | + | < |
import " | import " | ||
open lib -> lib1; | open lib -> lib1; | ||
Line 161: | Line 161: | ||
because not all types might be exported! In this case we can say: | because not all types might be exported! In this case we can say: | ||
- | < | + | < |
import " | import " | ||
open processor:: | open processor:: |