acc_sysC Posted June 25, 2022 Report Share Posted June 25, 2022 I'm trying to instantiate mux multiple times that is also parameterized. It gives me Segmentation fault (core dumped) error. I can't figure out why this is happening. This is the EDA link to the code: https://www.edaplayground.com/x/Et_C Please guide me. Thanks Quote Link to comment Share on other sites More sharing options...
karthickg Posted June 26, 2022 Report Share Posted June 26, 2022 Try running with gdb and check the backtrace $ gdb <executable name> gdb> run (after segfault) gdb> bt Quote Link to comment Share on other sites More sharing options...
Eyck Posted June 27, 2022 Report Share Posted June 27, 2022 Your sc_vector sOUT_bit_select is not properly initialized and the sc_vector sIN_segment has the wrong size. In general I would siggest to use something like this: sc_vector<multiplexer<(1<<N)> > bit_mux{bit_mux"",M}; sc_vector<sc_signal<sc_biguint<(1<<N)>>> sIN_segment{"sIN_segment",M}; sc_vector<sc_signal<bool> > sOUT_bit_select{"sOUT_bit_select",M}; instead of putting them intit the constructor initializer list. Quote Link to comment Share on other sites More sharing options...
acc_sysC Posted June 27, 2022 Author Report Share Posted June 27, 2022 @Eyck it works! But can you tell me what's the difference between inititializing like this and initializing in the constructor list? Quote Link to comment Share on other sites More sharing options...
Eyck Posted July 22, 2022 Report Share Posted July 22, 2022 Since the edaplayground code changed I cannot tell since I do not remember what 'like this' was Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.