Skip to content

Does an Interface use resources when there is no Module instantiation? #548

Answered by quark17
jrmejiaa asked this question in Q&A
Discussion options

You must be logged in to vote

An interface is not state, it is a value. An interface just a struct of functions. Usually, those functions are connected to state that you have instantiated, but the functions can also just be values that don't refer to any state.

When you instantiate a module (with <-), that is when state is created:

stats_fifo <- mkFIFOF;

At a statement like the above, new state is added to an implicit collection that BSC is building up behind the scenes, and what is returned from the instantiation (and assigned to the name on the left-hand side of the arrow) is an interface -- a struct -- whose methods are connected to the ports of that state. The interface itself does not have state.

So, for example…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jrmejiaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants