FPGARelated.com
Forums

Stupid tools question...

Started by Nicholas Weaver November 30, 2004
I'm doing a pretty complex state machine, which is perfect for in
memory (blockRAM based) encoding.

Before I go through and build my own state machine compiler out of
python hack-scripts or Excel macros, does someone already have such a
compiler available?
-- 
Nicholas C. Weaver.  to reply email to "nweaver" at the domain
icsi.berkeley.edu
"Nicholas Weaver" <nweaver@soda.csua.berkeley.edu> schrieb im Newsbeitrag
news:coikr1$11p9$1@agate.berkeley.edu...
> I'm doing a pretty complex state machine, which is perfect for in > memory (blockRAM based) encoding. > > Before I go through and build my own state machine compiler out of > python hack-scripts or Excel macros, does someone already have such a > compiler available?
XST offers an option to put logic into BRAMS. But I dont know if it is smart enough to put the FSM into the BRAM. Regards Falk
>I'm doing a pretty complex state machine, which is perfect for in >memory (blockRAM based) encoding. > >Before I go through and build my own state machine compiler out of >python hack-scripts or Excel macros, does someone already have such a >compiler available?
There really should be a couple of good examples out there someplace, if nothing else, for times like this. I know of two general ways to do it: One is to think like a state machine. Write a program that iterates through each address, unpacks the address into current-state and input signals, sets up default output conditions... Then the body of the loop acts like the state machine - big case statement, inspecting the input flags, setting up next-state and output bits... Then the tail of the program packs up the output and writes out the ROM data. The other way is to think like microcode. For that, you want an assembler. This is basically encoding the current-state in the PC. The assembler can be really really simple, but it sure helps to have one to copy from. Branching is usually done by ORing/MUXing bits into the PC. I'm likely to get a hack-attack sometime. What's a good sample state machine that will run on the Spartan 3 starter kit? (Maybe blink LEDs or something) -- The suespammers.org mail server is located in California. So are all my other mailboxes. Please do not send unsolicited bulk e-mail or unsolicited commercial e-mail to my suespammers.org address or any of my other addresses. These are my opinions, not necessarily my employer's. I hate spam.
Hal Murray wrote:

>>I'm doing a pretty complex state machine, which is perfect for in >>memory (blockRAM based) encoding. >> >>Before I go through and build my own state machine compiler out of >>python hack-scripts or Excel macros, does someone already have such a >>compiler available? > > > There really should be a couple of good examples out there someplace, > if nothing else, for times like this.
Or, the tools should support it directly ? :)
> > I know of two general ways to do it: > > One is to think like a state machine. Write a program that iterates > through each address, unpacks the address into current-state and > input signals, sets up default output conditions... Then the body > of the loop acts like the state machine - big case statement, > inspecting the input flags, setting up next-state and output bits... > Then the tail of the program packs up the output and writes out > the ROM data. > > The other way is to think like microcode. For that, you want > an assembler. This is basically encoding the current-state in the > PC. The assembler can be really really simple, but it sure helps to have > one to copy from. Branching is usually done by ORing/MUXing bits into > the PC. > > I'm likely to get a hack-attack sometime. What's a good sample > state machine that will run on the Spartan 3 starter kit? (Maybe > blink LEDs or something)
Traffic lights is a common one. You can use a Macro Assembler to create new opcodes, and so use the framework of a standard assembler for this task. I'm not sure if the assemblers that Xilinx include are this powerful, but they would be a natural choice. If you want to create your own variant assembler, then this is a good starting point : http://john.ccac.rwth-aachen.de:8000/as/ and I saw this recently, and thought it had to have a use, sometime... Your RAM state engine could be it ? http://www.pascalmacro.com/ The old registered PROMS were often used as state engines, and that's really what you have here, might be some old tools about that support this ? -jg
"Nicholas Weaver" <nweaver@soda.csua.berkeley.edu> wrote in message
news:coikr1$11p9$1@agate.berkeley.edu...
> I'm doing a pretty complex state machine, which is perfect for in > memory (blockRAM based) encoding. > > Before I go through and build my own state machine compiler out of > python hack-scripts or Excel macros, does someone already have such a > compiler available?
picoblaze might be a good fit. HTH, Jim jimwu88NOOOSPAM@yahoo.com (remove capital letters) http://www.geocities.com/jimwu88/chips
"Falk Brunner" <Falk.Brunner@gmx.de> wrote in message
news:31495nF35d628U1@individual.net...
> > "Nicholas Weaver" <nweaver@soda.csua.berkeley.edu> schrieb im Newsbeitrag > news:coikr1$11p9$1@agate.berkeley.edu... > > I'm doing a pretty complex state machine, which is perfect for in > > memory (blockRAM based) encoding. > > > > Before I go through and build my own state machine compiler out of > > python hack-scripts or Excel macros, does someone already have such a > > compiler available? > > XST offers an option to put logic into BRAMS. But I dont know if it is
smart
> enough to put the FSM into the BRAM.
NO Antti
Nicholas Weaver <nweaver@soda.csua.berkeley.edu> wrote:
> Before I go through and build my own state machine compiler out of > python hack-scripts or Excel macros, does someone already have such a > compiler available?
if you are using xilinx devices, picoblaze could be a smart solution for (medium) complex state machines... VHDL source and some (mostly DOS/Win32 based) assemblers are avaiable (for free). Just take a look at: <http://www.xilinx.com/products/design_resources/proc_central/grouping/picoblaze.htm> WD --
In article <colg9a$aeo1@cliff.xsj.xilinx.com>,
Jim Wu <nospam@nospam.com> wrote:
>picoblaze might be a good fit.
Picoblaze is probably significantly slower and larger: The core of the state machine needs to be at 125 MHz. But thanks for the suggestion. -- Nicholas C. Weaver. to reply email to "nweaver" at the domain icsi.berkeley.edu
"Nicholas Weaver" <nweaver@soda.csua.berkeley.edu> wrote in message
news:cosqsi$214r$1@agate.berkeley.edu...
> In article <colg9a$aeo1@cliff.xsj.xilinx.com>, > Jim Wu <nospam@nospam.com> wrote: > >picoblaze might be a good fit. > > Picoblaze is probably significantly slower and larger: The core of > the state machine needs to be at 125 MHz. > > But thanks for the suggestion. > -- > Nicholas C. Weaver. to reply email to "nweaver" at the domain > icsi.berkeley.edu
picoblaze could possible run at 125MHz too, but it takes a little more resources than BRAM based statemachine. http://ipcores.openchip.org/rsm.html :) I really wonder there is no BlockRAM statemachine tool yet available, the "core" itself itself is plain simple so only some script is needed to prepare the rom contents. I hope I could find time todo it ! Antti
Check our web site www.mvd-fpga.com at MVD Products => Perfidia;

( second posting, the first never appears )

Walter.

"Nicholas Weaver" <nweaver@soda.csua.berkeley.edu> a &#4294967295;crit dans le message
de news:coikr1$11p9$1@agate.berkeley.edu...
> I'm doing a pretty complex state machine, which is perfect for in > memory (blockRAM based) encoding. > > Before I go through and build my own state machine compiler out of > python hack-scripts or Excel macros, does someone already have such a > compiler available? > -- > Nicholas C. Weaver. to reply email to "nweaver" at the domain > icsi.berkeley.edu