sst-core
sst-core copied to clipboard
configureLink call not always getting correct defaultTimeBase
Passing NULL for the time base argument to configureLink indicates the (sub)component's current default time base should be used as the time base for the link. However, configureLink doesn't actually put in the current defaultTimeBase for the component and most often you end up with the first registered defaultTimeBase.
So, the following code does not work properly:
registerTimeBase("1ns",true) Link* first_link = configureLink("first_port"); registerTimeBase("2ns",true) Link* second_link = configureLink("second_port");
Both first_link and second_link end up with a defaultTimeBase of 1ns, but second_link should end up with a defaultTimeBase of 2ns.
@feldergast: Do we want to support this sort of implicit behavior? I don't love the idea of allowing registerTimeBase to be called multiple times for a component. I would actually vote for this type of code to be disallowed. There's a component-wide default time base OR you set the time base directly on the link.
The regAll
parameter defaults to true
. Wouldn't the expected behavior actually be that both links end up with a time base of 2ns? It looks like the function loops all links if regAll = true
and sets the time base on all of them.
@feldergast to look at this, it may be fixed.