Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SC two-dimensional inputs/outputs don't work #886

Closed
veripoolbot opened this issue Feb 25, 2015 · 5 comments
Closed

SC two-dimensional inputs/outputs don't work #886

veripoolbot opened this issue Feb 25, 2015 · 5 comments
Assignees
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800

Comments

@veripoolbot
Copy link
Contributor


Author Name: David Poole
Original Redmine Issue: 886 from https://www.veripool.org
Original Date: 2015-02-25
Original Assignee: Wilson Snyder (@wsnyder)


Verilator 3.871 devel rev verilator_3_866-58-ga89502b
(Also originally tested with release verilator before fetching git tip.)

When I use the --pins-bv 8 to convert a 10-bit signal to a sc_bv array, the resulting C++ code fails to compile. I have a small test case.

Tested under both recent Linux (gcc) and recent OSX (clang).

Example error:
Vctwin.cpp:90:5: error: invalid cast from type ‘sc_core::sc_in<sc_dt::sc_bv<10> >’ to type ‘IData {aka unsigned int}’

Generated code:
85 VL_INLINE_OPT void Vctwin::_combo__TOP__1(Vctwin__Syms* __restrict vlSymsp) {
86 VL_DEBUG_IF(VL_PRINTF(" Vctwin::_combo__TOP__1\n"); );
87 Vctwin* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp;
88 // Body
89 vlTOPp->__Vcellinp__v__ch_in[5U] = (IData)(vlTOPp->ch_in)
90 [5U];
91 vlTOPp->__Vcellinp__v__ch_in[4U] = (IData)(vlTOPp->ch_in)
92 [4U];
93 vlTOPp->__Vcellinp__v__ch_in[3U] = (IData)(vlTOPp->ch_in)
94 [3U];
95 vlTOPp->__Vcellinp__v__ch_in[2U] = (IData)(vlTOPp->ch_in)
96 [2U];
97 vlTOPp->__Vcellinp__v__ch_in[1U] = (IData)(vlTOPp->ch_in)
98 [1U];
99 vlTOPp->__Vcellinp__v__ch_in[0U] = (IData)(vlTOPp->ch_in)
100 [0U];
101 }

If I don't use --pins-bv, the ch_in array is an array of uint32_t. However, my verification simulation is failing (incorrect values) so I'm trying the more accurate (but slower) single bit signals to see if that helps.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: David Poole
Original Date: 2015-02-25T21:27:33Z


Verilator command line
successful: -I. --sc --sv

failure: -I. --sc --sv --pins-bv 8

Have also tried without the --sv flag. No change.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-02-26T00:11:06Z


Two dimensional array input/outputs to SV weren't supported, but this shouldn't be too hard to fix. Stay tuned for a day or so.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-02-26T02:10:02Z


Fixed in git towards 3.871.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: David Poole
Original Date: 2015-02-26T19:57:13Z


Updated to tip git. Works!

Thank you!

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-04-05T15:00:51Z


In 3.872.

@veripoolbot veripoolbot added resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800 labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed type: feature-IEEE Request to add new feature, described in IEEE 1800
Projects
None yet
Development

No branches or pull requests

2 participants