• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Differences b/w logic , reg & wire

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 64
  • Views 5287
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Differences b/w logic , reg & wire

archive
archive over 18 years ago

hi,

1.      i  know the differences between reg & wire...but i what to know the differences between logic , reg & wire clearly.

2.     When iam writing code in systemverilog using URM ..... i got a simple bug.. which iam pasting below & please let me know where to use reg , wire & logic in systemverilog coding.....


  
      

ncelab: *W,ENUMERR (./sv_module/sips_apb_env.sv,53|66): This
assignment is a violation of SystemVerilog strong typing rules for
enumeration datatypes.
            .PWRITE(dut_if.PWRITE),
                  |
ncelab: *E,ICDPAV (./sv_module/sips_apb_dut_wrap.sv,25|19): Illegal combination
of driver and procedural assignment to variable dut_if.PWRITE detected.
            .PADDR(dut_if.PADDR),
                 |
ncelab: *E,ICDPAV (./sv_module/sips_apb_dut_wrap.sv,26|18): Illegal combination
of driver and procedural assignment to variable dut_if.PADDR detected.
            .PWDATA(dut_if.PWDATA),      


... Raghavendra


Originally posted in cdnusers.org by raghavendrap
  • Cancel
  • archive
    archive over 18 years ago

    I think it would help the discussion if you would add the following info:
    1. The declaration for dut_if.PWRITE
    2. The port declaration for .PWRITE


    Originally posted in cdnusers.org by TAM
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 18 years ago

    ncelab: *W,ENUMERR (./sv_module/sips_apb_env.sv,53|66): This
    assignment is a violation of SystemVerilog strong typing rules for
    enumeration datatypes.
    .PWRITE(dut_if.PWRITE),



    You need to show us the declaration of:

    PWRITE inside the DUT and
    dut_if.PWRITE



    ncelab: *E,ICDPAV (./sv_module/sips_apb_dut_wrap.sv,25|19): Illegal combination
    of driver and procedural assignment to variable dut_if.PWRITE detected.



    Again we need full declaration that shows:

    1. Data type
    2. Direction (I/O/IO)

    to comment properly. From the clear error message it is clear that you have a "procedural assignment" - say inside task/function/initial PWRITE and perhaps a "net" connection from a block beneath.

    Show us full code to help better. If it is too many lines, consider posting a tar ball or send via email ajeetha <> gmail.com

    Interestingly I was doing some revamp of our (CVC, www.noveldv.com) SystemVerilog training material this week and found similar examples that we show during our classes.

    Regards
    Ajeetha, CVC
    www.noveldv.com


    Originally posted in cdnusers.org by ajeetha
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 18 years ago

    thanks for your cooperation in helping me Tam..
               i have declared as
                        dut.v file....ouput reg PWRITE
                   dut_interface.sv...logic PWRITE
                    dut_wrap.sv--------- .PWRITE(dut_if.PWRITE)

                                 dut_if is the dut interface name..........


    Originally posted in cdnusers.org by raghavendrap
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 18 years ago

    I've run a couple of tests using an interface, an always block and a submodule connection and I can't duplicate all of the behavior that you are seeing. :-(

    One thing that has been explained to me that the SystemVerilog has two properties associated with a signal, its "type" and its "kind." The "kind" is the familiar Verilog "reg", "var" or "wire". The "type" is the data type, 4-state "logic", 2-state "bit", integer and real. You can leave out the "kind", as long as you have specified the "type". But if you do, then "reg" is assumed.

    "logic PWRITE" is thus the same as "reg logic PWRITE".

    In SystemVerilog, you are allowed one continuous assignment to a "reg", so you can connect that interface signal to a submodule's port. But if you also try to drive it using a behavioral assignment or connect it to a second port, you will get an error. So I can easily get the tool to complain about different combinations of drivers on a PWRITE signal that is implicitly declared as a "reg". But I can't quite get it to complain in the same way that you are seeing, so I can't really be sure what you might have done.

    See what happens if you try declaring the signal as a wire.

    wire logic PWRITE;

    Or go thru your assignments and connections to that signal and make sure that they are all consistant with a "reg" kind of signal.


    Originally posted in cdnusers.org by TAM
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 18 years ago

    This is not quite correct.

    In SystemVerilog, logic and reg are both data types. In fact, they are the same data type.

    So 'logic PWRITE' is like 'var logic PWRITE' and 'reg PWRITE' is like 'var reg PWRITE'.


    Originally posted in cdnusers.org by shalom
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 18 years ago


    i.e inorder to avoid the confusion of reg & wire....here in SV we are using "logic".


    Originally posted in cdnusers.org by raghavendrap
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 18 years ago

    Try making the PWRITE signal as "wire" instead of "logic" - "logic" doesn't allow multiple drivers while wire does. I just now fixed a similar problem in our inhouse code. I didn't do a thorough analysis so can't give you the exact rationale, maybe will do that tomorrow if I get time.

    Cheers
    Ajeetha, CVC
    www.noveldv.com


    Originally posted in cdnusers.org by ajeetha
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information