Search the Community

Showing results for tags 'inside'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Accellera Systems Initiative
    • Information
    • Announcements
    • In the News
  • SystemC
    • SystemC Language
    • SystemC AMS (Analog/Mixed-Signal)
    • SystemC TLM (Transaction-level Modeling)
    • SystemC Synthesizable Subset v1.4 Public Review
    • SystemC Verification (UVM-SystemC, SCV)
  • UVM (Universal Verification Methodology)
    • UVM 1.2 Public Review
    • Methodology and BCL Forum
    • UVM SystemVerilog Discussions
    • Simulator Specific Issues
    • UVM Commercial Announcements
  • Portable Stimulus
    • Portable Stimulus Discussion
  • IP-XACT
    • IP-XACT Discussion
  • IEEE 1735/IP Encryption
    • IEEE 1735/IP Encryption Discussion
  • OCP (Open Core Protocol)
  • UCIS (Unified Coverage Interoperability Standard)
  • Commercial Announcements
    • Announcements

Categories

  • SystemC
  • UVM
  • UCIS
  • IEEE 1735/IP Encryption

Calendars

  • Community Calendar

Found 1 result

  1. How can I use "randomize() with" along with "inside", on the same line? Below is some code that solves the problem using >= and <=, but I'd like to use "inside". module top; class aclass; int index; function void get_latency; //assert (randomize(index) with {index inside {[1:5]}}) else begin //WHAT IS THE PROPER SYNTAX? //assert (randomize(index) inside {[1:5]}) else begin //WHAT IS THE PROPER SYNTAX? assert (randomize(index) with {index<=5; index>=1;}) else begin //WORKS $display("ERROR: We failed!"); $finish; end $display("RESULT: index=%0d",index); endfunction endclass initial begin aclass a_class=new(); a_class.get_latency(); $finish; end endmodule I often grapple with the "randomize with" syntax, getting confused with squiggly brackets and semicolons, and refer to the LRM. (Any tips that will stick in my head are welcome.)