Altera_Forum
Honored Contributor
17 years agoUsing FPGA to map I/Os into address space
Hello All,
I am working on a project to implement a simple mapping of several control and status I/Os from various chips into certain address space for a MCU to read/write. I wrote the code in VHDL. Simulation suggests that it is working ok, but I feel it's not a very well written piece of code..The read/write operation is done via a FSM (because the FPGA has to generate the correct control signals to the MCU to terminate the read/write)... I am posting it here, maybe someone can take a look and let me know if there's any improvement I can use? Many thanks and have a nice weekend! BTW..Is my implementation of the FSM a good practice? I use three processes..The first one is simply to advance state machine on the rising edge of clk..The second one determines next state based on input and current state. The third one, generate the output on the rising edge of clk...In Altera's Quartus II Handbook (and several other places), it seems that people combaining second and third process together. Is there a advantage that way? I'd like to make my code clear..plus, the third process gives me the freedom to choose whether I can have my output on the rising edge or falling edge..