Forum Discussion
Altera_Forum
Honored Contributor
9 years ago --- Quote Start --- Yes, the state machine is much clearer. However this design was based on an attempt to make the bridge as fast as possible. Therefore the main part is a combinational process, which translates signals between the AXI4 Lite side and the IPbus (or WishBone in the second bridge) as fast as possible. So the combinational connections are just results of the combinational process used here. An example may be, that in the write transaction: If S_AXI_AWVALID = '1' and S_AXI_WVALID = '1' and there is no uncompleted transaction, then if S_AXI_WSTRB = "1111", finally S_AXI_AWREADY and S_AXI_WREADY are set to '1'. The above is done in a fully combinational way, creating the combinational connection between the input signals (AWVALID, WVALID, WSTRB ) and output signals (AWREADY, WREADY) at the AXI4-Lite side of the bridge. Probably to comply to the requirement of avoiding combinational connections, I'll have to rewrite it as a state machine (hopefully for translated signals it will be the Mealy one). However, almost for sure it will result in slightly slower (but safer) operation... Regards, Wojtek --- Quote End --- Now your original code as hidden state! Where a State Machine proper will clearly indicate what your intentions are, in the case of a bunch of equations one has to decode all the equations and draw a timing diagram to understand what is going on. I even write State Machines with 2 (yes even only 2) states! Now whether it is Mealy or Moore or a hybrid form doesn't really matter, that's for the academics. I divide my state machines in three parts:
- a combinatorial part to decide on the next state, plus combinatorial outputs
- a registered part with a reset to register the state, and to register possible output signals that require a known reset state
- a registered part for the dataflow-type signals