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: 
Visitor zoumin
Visitor
6,957 Views
Registered: ‎07-13-2009

[Help !] How to use Chipscope to monitor the running of a StateMachine?

     Help me!

     In my design, I want to add a StateMachine into the .cdc file, using the Chipscope to monitor how the StateMachine works. The StateMachine ,which I give the name  "reg [9:0] CBLTDataBuildIIStateManchine" in my code, has ten-state. However, when come to editing the Chipscope  cdc file, the states increased to more than 10 states in the Net name list. As you can see in the picture, the states has increased to 18 states, many suffixes being added, and I don't  know what these suffixes want to tell me?

     My question is: How I can Monitor this StateMachine? Within these 18 states, which ones should I choose in my "Data Signals" Tab.

     I appreciate for your help! ^_^

20110812ChipScope观察状态机.jpg

 

0 Kudos
6 Replies
Highlighted
Advisor evgenis1
Advisor
6,955 Views
Registered: ‎12-03-2007

Re: [Help !] How to use Chipscope to monitor the running of a StateMachine?

Hi,

 

It's often the case that synthesis tool implements state machines differently than they're coded in HDL. For example, the default behaviour of XST is to implement small state machines as one-hot.

You can search the synthesis report for "CBLTDataBuildIIStateMachine" to get better idea how it's being synthesized. 

 

One way to monitor a state machine without interfering with the synthesis tool optimizations is to assign states and not bits, as follows:

    assign chipscope_bit_0 = CBLTDataBuildIIStateManchine == MY_STATE_0;

    assign chipscope_bit_1 = CBLTDataBuildIIStateManchine == MY_STATE_1;

    ... etc.

 

The disadvantage of this method is that it has to be done before synthesis.

 

 

Thanks,

Evgeni

  

Tags (1)
Scholar joelby
Scholar
6,948 Views
Registered: ‎10-05-2010

Re: [Help !] How to use Chipscope to monitor the running of a StateMachine?

Another thing you can do is force the FSM to use 'user' encoding, though this might result in poorer timing if XST determined that some other method was superior.

 

(* fsm_encoding = "user" *)
reg [6:0] state = 0;

 

Instructor
Instructor
6,938 Views
Registered: ‎08-14-2007

Re: [Help !] How to use Chipscope to monitor the running of a StateMachine?

It looks to me like your machine actually coded into fewer state variables.  When looking

for your state variable, watch the right column "Base Type" and select the signals that

are coming from flip-flops rather than LUTs.  In your case that would be:

 

FSM_FFd1

FSM_FFd2

FSM_FFd3

FSM_FFd4

 

Another thing I found is that XST likes to reverse the bit numbering when encoding

states.  So if this is actually binary encoded, I would expect FSM_FFd1 to be the

most significant bit.  Even if it is binary encoded, the states may not match your source

unless you took Joelby's advice and used "user" encoding.

 

HTH,

Gabor

 

-- Gabor
0 Kudos
Visitor zoumin
Visitor
6,919 Views
Registered: ‎07-13-2009

Re: [Help !] How to use Chipscope to monitor the running of a StateMachine?

I have tried it , but it didn't work , some states stil were optimized.
0 Kudos
Scholar joelby
Scholar
6,916 Views
Registered: ‎10-05-2010

Re: [Help !] How to use Chipscope to monitor the running of a StateMachine?

What exactly did you try?

 

Are you sure that all of your states are actually reachable? They'll be optimised out if they can never be reached.

 

Looking at your screenshot again, most of the signals you highlighted are LUTs of uncertain function. In this case, you probably only care about the state register, which are the ones of base type FDC_1. Have a look at your synthesis output to see how your FSM states have been translated to hardware.

0 Kudos
Visitor zoumin
Visitor
6,911 Views
Registered: ‎07-13-2009

Re: [Help !] How to use Chipscope to monitor the running of a StateMachine?

Ok, I will try it again, thank you very much! ^_^

0 Kudos