Friday, November 21, 2008     Register | Login | Search | Contact Us
     

Many of you already received communications about the move of the Cadence user community into cadence.com. And many of you have already joined, with over 4000 registrations in the first two weeks.

The new Cadence Community enhances the ability of Cadence users to connect and collaborate. In addition to moving the community into cadence.com -- enabling single sign-on for community, Sourcelink and Cadence events -- the new site is organized around nine technology segments, giving you easy access to product information, training, forums and blogs. Some of the new features include:
  • Ability to respond to posts via e-mail
  • Technology-specific blogs
  • Latest Web 2.0 social networking capabilities
  • Public profile options
  • Private messaging
  • Friends lists
Visit the new Cadence Community today at www.cadence.com/community and join the discussions!

Registration note: Due to the scope of the enhancements and the new SSO registration system, we were not able to migrate existing cdnusers.org member accounts. So new registrations are required, but this enables a broader set of functionality we think you'll enjoy.

Forum note: Under the guidance of forum moderators, we have taken the 20+ cdnusers.org forums and consolidated them into 11 forums on the new site. Posts have been brought over so you can leverage that posting history. CDNusers forums will be set to read only starting 7/30, and cdnusers.org will be redirected to the new community on 8/4.

Best regards,
Mike and Tom

Michael A. Catrambone - Steering Committee Chairman
Distinguished Engineer
PCB/Mechanical
UTStarcom, Inc.

Tom Diederich
Cadence Community Manager
Home
Forums
Subject: howto? triggering event off 1 bit of uint simple_port
Posting to forums is available to community members only.
Login or Register
Rate this topic:
   
Author Messages
LDiracDelta
Posts: 2
Online: User is Offline
5/21/2007 12:57 PM  

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] )@sim;

Is this possible?


Here is a complete example:
#### top.v ####
module top();
   
    reg ⎬: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] )@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] )@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?

Hilmar
Posts: 8
Online: User is Offline
8/16/2007 1:48 AM  
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]";

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.

Hilmar v.d. K.
Hilmar
Posts: 8
Online: User is Offline
8/16/2007 2:18 AM  
I coded up two little examples:

[quote]<'

unit test_1_u {
my_val : uint(bits:32);
my_p : simple_port of uint(bits:32) is instance;
keep bind(my_p,external);
keep my_p.hdl_path()=="my_signal";
event ch_p_e is change(my_p$) @sim exec {my_val=my_p$};
event bit_0_e is rise(my_valΎ:0]) @ch_p_e;
};

unit test_2_u {
my_p : simple_port of uint(bits:32) is instance;
keep bind(my_p,external);
keep my_p.hdl_path()=="my_signal";
keep my_p.declared_range()=="Ύ:0]";

event bit_0_e is rise(my_p$) @sim;
};



'>[/quote]

Hope this helps,
Hilmar

Hilmar v.d. K.
Posting to forums is available to community members only.
Login or Register

Forums > Functional Verification > e > howto? triggering event off 1 bit of uint simple_port


ActiveForums 3.6
     
Copyright 2006 Cadence Design Systems, Inc.