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
Question: Tie off unused module inputs (as listed in AUTOREGINPUT) #1244
Comments
Original Redmine Comment I found a thread with this example:
It is an ok work-around but I thought these was a way to have AUTOREGINPUT declare the signals and then have them assigned to zero. |
Original Redmine Comment I think your workaround is the only choice at present. I thought there could be something added like an AUTORESET for signals that came from AUTOREGRESET, but it would be hard to know what not to reset, you'd need a list, so I don't see that being more convenient than what the present templating gives you. |
Original Redmine Comment Ack! Well, this solution worked great - until it hit an input port that was multidimensional. Now what? Thanks & Happy New Year, David
|
Original Redmine Comment If you're using non-SystemVerilog you'll need to assign manually. If using SV, the vl-width was unneeded and something like this might work (untested):
|
Original Redmine Comment Thanks for the super-fast reply! I hadn't thought of using pattern assignments. So close, but unfortunately, at least for Cadence, this gives a warning for ports that are single-bit scalars: xmelab: *W,APSCXT (top.sv,300|62): Assignment pattern - scalar context is not legal [SystemVerilog]. Can the regex be modified to only work for multi-bit ports? Could vl-width be used? Would that work for an unpacked array of single bit:
If so, then the previous regex could be modified to only run for scalar ports. David |
Original Redmine Comment The intent of the "(if vl-mbits" was to only have it do that on memories, perhaps it needs some tweaking. |
Original Redmine Comment I did some more experiments and it looks like vl-mbits doesn't work right. Here's my template and used variables to make it readable: (setq my-nc-output "/NC/") .(.*) (@" (concat (if (equal vl-dir \"output\") my-nc-output (if (equal vl-bits \"\") my-nc-input-vector my-nc-input-mdv) ) my-space vl-width my-space vl-bits my-space vl-mbits ) "), To debug, I used this template that just prints the variable values:
Here are the port declarations followed by the results of AUTO: input wire [8:0] mixed_mda_var [2], input wire unpacked_scalar_var [2], input wire scalar_var, input wire [1:0] packed_vec_var, So, vl-mbits is always null. And, there's no other way to identify a 1-bit scalar vs an unpacked array of 1-bit scalars (2nd and 3rd cases). David |
Original Redmine Comment I think this works:
|
Is there a way to tie off 0 for all the unused input, at the meanwhile leave all unused output as dangling? I just want to keep this coding style as: |
I updated the FAQ with this: |
Author Name: David Rogoff
Original Redmine Message: 2444 from https://www.veripool.org
Hi.
I'm sure this has come up but I can't find anything. I'm creating a simple testbench of register access for some modules. I've instantiated the modules with AUTOINST with templates to tie the register bus signals to an interface. I have AUTOLOGIC and AUTOREGINPUT that declare all the sub-module outputs and inputs I don't care about. I want to tie all the signals listed under AUTOREGINPUT to zero. There's hundreds of them. How do I do this in my testbench using AUTOs?
Thanks!
David
The text was updated successfully, but these errors were encountered: