Synchronous FSM, testing procedures

Thread Starter

amilton542

Joined Nov 13, 2010
497
I'm currently building a synchronous FSM in a lab' demo, and I'm critically marked on my log book for testing procedures associated with the circuit. The prep' work I did before the lab was a paper test to ensure it worked, but for the hand's on side, how do I modulate an FSM into sections to be tested?

I have great faith in my lab' partner and myself, but there's wires absolutely everywhere. I want to try and modulate the whole thing and do a hand's on test on each section if that makes sense.
 

Papabravo

Joined Feb 24, 2006
21,227
I would design a procedure to go from an initial state to all of the other states in the minimum number of states. Second I would design a procedure to go from any initial state to any other state in the minimum number of states. That should give you some confidence that the machine is controllable.
 

WBahn

Joined Mar 31, 2012
30,077
Another thing to consider is what happens if the FSM gets put into an abnormal/unused state. Depending on your system design, it should either recover automatically and gracefully or it should failsafe and issue some kind of alert. If you have the ability to force it into all of the "bad" states, your test plan might include that, as well. Keep in mind that as the complexity of your system grows, the physical ability to test all possible situations simply goes away.
 

Thread Starter

amilton542

Joined Nov 13, 2010
497
I'm grateful for the help, but these procedures require the circuit to be working. What I'm trying to get at is, when I said there's "wires absolutely everywhere", if just one of these is in the wrong place the FSM isn't going to work. I want to try and modulate the whole circuit and perform tests in order to ensure each counterpart is functional then I'll proceed with the help claimed to drive it into abnormal states.
 

WBahn

Joined Mar 31, 2012
30,077
It sounds like what you need to do is break your design into modules (the way to do it in the first place) and test each module separately. Then start connecting them together a few at a time into larger modules and test those.

As for the wires everywhere, you want to get into the practice, even on very small projects, of routing your wires neatly and making sure that you can easily tell what is going where and also that you can change out components without disturbing any of the wiring. It takes more time, but saves you a lot more time and frustration in the long run.
 

WBahn

Joined Mar 31, 2012
30,077
Well, first you have to make sure that it is isolated from other modules so that they can't mess up the one you are testing. Then you have to decide what inputs make sense to use for your tests and what the outputs should be given those inputs. Then you apply the test inputs (often called test vectors) and see if the outputs are what you expect.

For much more than a generic description like that, you are going to have to give us more information. You might pick one or two modules and discuss them so that we can get into specifics.
 

Thread Starter

amilton542

Joined Nov 13, 2010
497
I finally finished it and it works! Several hours of troubleshooting and it all came down to a loose wire! One of the pin outputs on the 'scope was just just oscillating from HIGH to LOW. I replaced the chip and came over a hole on the breadboard and that seemed to do the trick!

I've never built an FSM before but for other peeps out there this was my approach.

1) Do not, and I repeat, do not wire up your transitional logic first. Work backwards.
2) Install your chips, wire up the supply, clock and ground connections.
3) Lay your conductors in such a way they will lie uniform with the breadboard and circulate around each other in a grouped fashion. In this way you will not experience any difficulties in order to get the probe at the chips.
4) Select 2 x feedback paths as rails to tap-off for the transition logic.
4) I find every colour of the rainbow a bit Mickey Mouse in a circuit but this helped considerably. For each stage of gating choose one colour only. For example, the final stage feeding the flip-flop inputs make this a colour and so on.
5) Wire up the inputs to your transition logic using the same colour as your feedback paths.
5) O.K you made it and it doesn't work.

For troubleshooting, get a probe and read the above posts and you'll do just fine.
 
Top