Variable vector indices in Verilog #5130
              
                
                  
                  
                    Answered
                  
                  by
                    povik
                  
              
          
                  
                    
                      CatalpaEel
                    
                  
                
                  asked this question in
                Q&A
              
            -
| 
         Emm, is yosys unable to handle this syntax? The JSON produce a cell of type "shiftx". module top_module (
        input [3:0] a,
        input [1:0] x,
        output z);
    assign z = a[x];
endmoduleJSON: "cells": {
  "$shiftx${workspace}/demo.v:0$1": {
    "hide_name": 1,
    "type": "$shiftx",
    "parameters": {
      "A_SIGNED": "00000000000000000000000000000000",
      "A_WIDTH": "00000000000000000000000000000100",
      "B_SIGNED": "00000000000000000000000000000000",
      "B_WIDTH": "00000000000000000000000000000010",
      "Y_WIDTH": "00000000000000000000000000000001"
    },
    "attributes": {
      "src": "{workspace}/demo.v:0.0-0.0"
    },
    "port_directions": {
      "A": "input",
      "B": "input",
      "Y": "output"
    },
    "connections": {
      "A": [ 2, 3, 4, 5 ],
      "B": [ 6, 7 ],
      "Y": [ 8 ]
    }
  }
}, | 
  
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            povik
          
      
      
        May 19, 2025 
      
    
    Replies: 1 comment 3 replies
-
| 
         That looks to be the expected output and Yosys should handle this syntax. What makes you think otherwise?  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    3 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
You can look up the name
shiftxin the documentation. You'll need to provide more details about the netlist generation getting stuck (ideally a reproducer) to receive help.