Enabling pullups for mulitple pins at once


#1

How can I enable pullups for an entire bus? I’m using IceStudio and the pullup module only allows 1 input and 1 output but I have a byte-wide bus that needs pullups.

I have read the SBTICETechnologyLibrary document that went over pin configs and I get how to do a single pin config based on the code from the pullup module:

  SB_IO #(
    .PIN_TYPE(6'b 1010_01),
    .PULLUP(1'b 1)
) io_pin (
    .PACKAGE_PIN(i),
    .OUTPUT_ENABLE(outen),
    .D_OUT_0(dout),
    .D_IN_0(din)
);

which I tried to pare down to:

SB_IO #(
    .PIN_TYPE(6'b 1010_01),
    .PULLUP(1'b 1)
) io_pin (
    .PACKAGE_PIN(B[7:0])
)

where B[7:0] is the input byte that needs pullups (coming from 8 pins). But this syntax doesn’t accept multiple assignments in there, just one.


#2

Try

SB_IO #(...) io_pin [7:0] (
  .PACKAGE_PIN(B)
);

The synthesizer will notice that B is a vector of size [7:0] and will generate 8 SB_IO blocks with the correct bit in B assigned to the PACKAGE_PIN.