UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Voyager
Voyager
11,710 Views
Registered: ‎04-10-2012

How to trigger and capture only on change

Jump to solution

In my design (I am running 14.1), I was hoping to capture bits in chipscope to watch them change,  Unfortunately they change MUCH slower than my system clock.  That saind, since I am only concerned with the data itself and not when the changes occured so much, is it possible to only trigger and capture when the bits change>

 

IE: when the data goes from 0x0E, to 0x0F, to 0x10.  I want to see the data I am generating progress properly, and currently I get TONS of 0x0E listings, then finally a 0x0F listing which repeats for a long time.

 

I have to imagine this can be done in Chipscope, but I haven't cracked the triggering mechanisms yet.

0 Kudos
1 Solution

Accepted Solutions
Instructor
Instructor
17,066 Views
Registered: ‎08-14-2007

Re: How to trigger and capture only on change

Jump to solution

What did you mean by enabling conditional storage?  I think I am missing something there?

 

It's called "Storage Qualification" on the same screen where you set up the match units.  See

the attached picture.  It's not checked by default.

 

With the trig_on_change code, you are creating a reg that will act as a trigger by going high whenever the old data does not equal the new data right?  Then in chipscope, I could trigger whenever it is high, and then look at whatever the current data is, right?  I guess I am failing to see why the KEEP attribute is needed (the rest makes sense).

 

In ChipScope you can then use trig_on_change = 1 as a trigger (if that's what you really want, or as a

storage qualifier (i.e. only store cycles when trig_on_change == 1).  The KEEP attribute is to prevent

the removal of trig_on_change because it doesn't drive any outputs of the design (ChipScope is not

considered an "output", and when using the inserter it's not even known to exist at synthesis time).

 

I like the counter approach, that seems pretty slick and could be very telling about your signal!

 

As I said, this is something that would have been built in to a more robust logic analyzer.  In this

case it's required to overcome a shortcoming of ChipScope.

 

-- Gabor

-- Gabor

View solution in original post

SorageQualification.PNG
8 Replies
Voyager
Voyager
11,703 Views
Registered: ‎04-10-2012

Re: How to trigger and capture only on change

Jump to solution

I got it.  In case anyone else stumbled here looking for an answer, I setup the ILA to have 12 "match units"

 

I then went into my ChipScope project and modified the Trigger Setup (of which there are M0 - M11 to be RXXX_XXXX_XXXX_XXXX through XXXX_XXXX_XXXX_XXXR to trigger on the individula rising edges for any 12 of my bits.  Next I setup a Trigger Condition that ORed M0 through M11 together.  Lastly I changed the capture type to "N Samples" and set the samples per trigger to 1.  Now I get 8k seperate triggers in my window (which boys down ChipScope if you physically want to view it), which accoplishes what I needed.

 

Here is a quick screenshot in case I misspoke on some of it:

ChipScope.jpg

0 Kudos
Instructor
Instructor
11,696 Views
Registered: ‎08-14-2007

Re: How to trigger and capture only on change

Jump to solution

What you want to do is enable conditional storage.  Then use your OR of 12 triggers as a storage

qualifier and just sit an wait for a buffer to fill.  Some other things to consider:

 

When you have an unusual trigger requirement you can code the trigger in your HDL code.  Place

a KEEP attribute on this trigger signal so it doesn't go away before you use the ChipScope inserter.

For example:

 

(* KEEP = "TRUE" *) reg trig_on_change;

always @ (posedge clock) trig_on_change <= previous_data != current_data;

 

Also note that your trigger condition is rising-edge only, so you won't capture events that

have only falling edges like when data changes from hex E5 to hex A4.

 

One thing I do when using conditional storage (if I have enough block RAM left to widen

my ChipScope data word) is to add a free-running counter and add it to the data word.

Again this requires a KEEP attribute if you don't otherwise use the counter.  Then when

you look at the waveform, you can use the counter value to tell the time between the

events.

 

External logic analyzers typically allow the use of event-based storage to get longer

traces for sparsely-changing signals.  They will have an internal timer you never see

that allows them to reconstruct the waveform from the change data.  Currently ChipScope

does not support this mode of operation.

 

-- Gabor

-- Gabor
Voyager
Voyager
11,688 Views
Registered: ‎04-10-2012

Re: How to trigger and capture only on change

Jump to solution

Thank you for the info Gabor, that is really helpful.

 

I had a question though, you said:


@gszakacs wrote:

What you want to do is enable conditional storage.  Then use your OR of 12 triggers as a storage

qualifier and just sit an wait for a buffer to fill.  


What did you mean by enabling conditional storage?  I think I am missing something there?

 

With the trig_on_change code, you are creating a reg that will act as a trigger by going high whenever the old data does not equal the new data right?  Then in chipscope, I could trigger whenever it is high, and then look at whatever the current data is, right?  I guess I am failing to see why the KEEP attribute is needed (the rest makes sense).  

 

I knew that the signals were only rising edge, and that didn't bother me at first since I was feeding a counter in and I knew one bit would always be rising.  But that is incorrect for two cases:

1 - When I roll over from 0xFFF to 0x000, no bit is rising

2 - When my signal does something unexpected (which is why I am going through this process and doesn't have a nice count up, I might miss it

So, my approach does indeed stink.  It would have been nice if ChipScope would have allowed for a O option (O as in OR), since it allowed for R or F edge.  I guess the workaround is to add and additional 12 trigger points and set them to F just like I have my R ones set up, but that seemd tedious.  But  Ijust noticed that I am maxed out at 16, so there goes that idea.....

 

I like the counter approach, that seems pretty slick and could be very telling about your signal!

0 Kudos
Voyager
Voyager
11,681 Views
Registered: ‎04-10-2012

Re: How to trigger and capture only on change

Jump to solution
Upon further review of the Large and not quick digestible ChipScope ProSoftware and Cores User Guide, there is an either-or option, it is 'B':

Bit values: ’0’ = “logical 0”; ‘1’ =“logical 1”; ‘X’ =“don’t care”; ‘R’= “0-to-1 transition”; ‘F’= “1-to-0
transition”; ‘B’= “any transition”; ‘N’ = “no transition”.
0 Kudos
Instructor
Instructor
17,067 Views
Registered: ‎08-14-2007

Re: How to trigger and capture only on change

Jump to solution

What did you mean by enabling conditional storage?  I think I am missing something there?

 

It's called "Storage Qualification" on the same screen where you set up the match units.  See

the attached picture.  It's not checked by default.

 

With the trig_on_change code, you are creating a reg that will act as a trigger by going high whenever the old data does not equal the new data right?  Then in chipscope, I could trigger whenever it is high, and then look at whatever the current data is, right?  I guess I am failing to see why the KEEP attribute is needed (the rest makes sense).

 

In ChipScope you can then use trig_on_change = 1 as a trigger (if that's what you really want, or as a

storage qualifier (i.e. only store cycles when trig_on_change == 1).  The KEEP attribute is to prevent

the removal of trig_on_change because it doesn't drive any outputs of the design (ChipScope is not

considered an "output", and when using the inserter it's not even known to exist at synthesis time).

 

I like the counter approach, that seems pretty slick and could be very telling about your signal!

 

As I said, this is something that would have been built in to a more robust logic analyzer.  In this

case it's required to overcome a shortcoming of ChipScope.

 

-- Gabor

-- Gabor

View solution in original post

SorageQualification.PNG
Voyager
Voyager
11,673 Views
Registered: ‎04-10-2012

Re: How to trigger and capture only on change

Jump to solution

Looks like we posted at just about the same time.

 

The KEEP attribute is to prevent the removal of trig_on_change because it doesn't drive any outputs of the design (ChipScope is not considered an "output", and when using the inserter it's not even known to exist at synthesis time).

 


OK, that makes perfect sense.  I figured somehow you were protecting the data from being optimized out, but I couldn't figure out why.  I will have to remember that in the future!

 

Do you see a benefit to your approach (using the reg in code as a trigger) versus the setup I had started in the beginning of this post and then modified with the 'B' attribute for "any" change?  It seems like in the end it would be the same, but I can say that in simple testing (since I already had it synthesizing when you posted), I can see triggers on succesive counts that have not changed, but in my mind they shouldn't have triggered (I am wondering if it had something to do withe the lower 12bits (my other ADC data) changing even though I left them as 'X'.

0 Kudos
Instructor
Instructor
11,664 Views
Registered: ‎08-14-2007

Re: How to trigger and capture only on change

Jump to solution

Do you see a benefit to your approach (using the reg in code as a trigger) versus the setup I had started in the beginning of this post and then modified with the 'B' attribute for "any" change?

 

Your method is more flexible.  There's no reason your 12 match units must be used

to generate edge-based triggers.  My idea works fairly simply and can probably significantly

reduce the logic usage of the ChipScope system (provided you also reduce the number

of match units).  The neat thing about FPGA's in general is that if you don't see what you want

you can just build it yourself.  Creating a complex trigger for ChipScope is just one example

of this.

 

-- Gabor

-- Gabor
0 Kudos
Voyager
Voyager
11,653 Views
Registered: ‎04-10-2012

Re: How to trigger and capture only on change

Jump to solution

I never thought about adding the extra logic for more sophisticated trigger into the Verilog, that seems to be working great, thank you for the help!

0 Kudos