sst-core icon indicating copy to clipboard operation
sst-core copied to clipboard

configureLink call not always getting correct defaultTimeBase

Open feldergast opened this issue 6 years ago • 2 comments

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 avatar Dec 13 '18 20:12 feldergast

@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.

jjwilke avatar Apr 05 '19 16:04 jjwilke

@feldergast to look at this, it may be fixed.

allevin avatar Mar 11 '20 16:03 allevin