• 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. howto? triggering event off 1 bit of uint simple_port

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 64
  • Views 13224
  • 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

howto? triggering event off 1 bit of uint simple_port

archive
archive over 18 years ago

I have a simple port of uint(bits:NUM_BITS).  I want to trigger
an event based on a single bit of this port, e.g.

event foo is rise( my_port$[0:0] )@sim;

Is this possible?

Here is a complete example:
#### top.v ####
module top();
   
    reg [32:0] my_signal;
   
    initial begin
        $display("TOP.V: BEGIN test");
        my_signal =  0;
        $displayb("TOP.V: my_signal = '%d'",my_signal);
        #10
        my_signal = -1;
        $displayb("TOP.V: my_signal = '%d'",my_signal);
        #10
        my_signal =  0;
        $displayb("TOP.V: my_signal = '%d'",my_signal);
        #10
        my_signal = -1;
        $displayb("TOP.V: my_signal = '%d'",my_signal);
        #10
        my_signal =  0;
        $displayb("TOP.V: my_signal = '%d'",my_signal);
        #10
        my_signal = -1;
        $displayb("TOP.V: my_signal = '%d'",my_signal);
        #10
        my_signal =  0;
        $displayb("TOP.V: my_signal = '%d'",my_signal);
        #10
        my_signal = -1;
        $displayb("TOP.V: my_signal = '%d'",my_signal);
        #10
        $display("TOP.V: END test");
    end
   
endmodule

#### test.e ####
<'

unit foo_u {
    my_port : simple_port of uint(bits:32) is instance;
    keep bind(my_port,external);
    keep my_port.hdl_path() == "~/top/my_signal";
   
    event bit0_posedge_e is rise( my_port$[0:0] )@sim;
   
    on bit0_posedge_e {
        out( "Event 'bit0_posedge_e' seen");
    };
   
};
 
extend sys {
    foo : foo_u is instance;
    run() is also{
        out("hello!!");
    };
};


'>
#### makefile ####

.PHONY: all
all: specrun

specman.v: test.e
    @echo "## Creating specman.v"
    specman -c  "load test.e; write stubs -vcs"

vcs_specman: top.v specman.v
    sn_compile.sh -sim vcs                  \
        -sim_flags "top.v specman.v -debug -l runsim.log "

.PHONY: specrun
specrun: specman.v test.e top.v vcs_specman
    @echo ""
    specrun -p "load test.e" ./vcs_specman -ucli

clean:
    -rm -rf vcs_specman specman.v csrc .vcsmx_rebuild specman.elog runsim.log \
        vcs_specman.daidir ag_command.log jspecview.log simv *log test.esv test \
        ucli.key vcs.key vcs_test vcs_test.daidir
   

When I run, I get:
## Creating specman.v
specman -c  "load test.e; write stubs -vcs"
Welcome to Specman Elite (6.1)  -  Linked on Sun Apr  1 10:15:44 2007

Protected by U.S. Patents 6,920,583; 6,918,076; 6,907,599; 6,687,662;
6,684,359; 6,675,138; 6,530,054; 6,519,727; 6,502,232; 6,499,132; 6,487,704;
6,347,388; 6,219,809; 6,182,258; 6,141,630; Other Patents Pending.

Checking license ... OK
Loading test.e ...
read...parse...update...patch...h code...code...
   *** Error: Unrecognized exp
    [Unrecognized expression '0:0']
                at line 10 in test.e
    event bit0_posedge_e is rise( my_port$[0:0] )@sim;
                                           ^^^




Load failed - restored
/nfs/site/eda/group/SYSNAME/lrb/verisity/specman/6.1/components/sn/linux/specman.esv
make: *** [specman.v] Error 255

Is this possible?  How would I do this?


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

    Hi,

    Bit slicing like that is not allowed. Simple ports however have an option to constrain the range, constraining declared_range(), similar to hdl_path() to something like:

    keep my_port_p.declared_range()=="[0:0]";

    That might not be a good solution for you, so you might need to add a second simple_port just sampling bit 0. An event_port could also be an option, but event_ports don't have the declared_range() attribute.


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

    Hi,

    Bit slicing like that is not allowed. Simple ports however have an option to constrain the range, constraining declared_range(), similar to hdl_path() to something like:

    keep my_port_p.declared_range()=="[0:0]";

    That might not be a good solution for you, so you might need to add a second simple_port just sampling bit 0. An event_port could also be an option, but event_ports don't have the declared_range() attribute.


    Originally posted in cdnusers.org by Hilmar
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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