Thanks for the response.
Yes - the issue is to avoid writing out hundreds of lines of code where the same state machine is used a number of times but with different values passed to it.
Ref chip selects, these are used to select which mode of operation I am running a sensor chip in and they therefore determine the parameters that I pass to the state machine. The chipselects are passed to the FPGA on the host processor bus as an address and correseponding read or write enable depending on the operation to be performed by the sensor.
So, the logical process I'm trying to follow is
if (chipselect_1)
execute the state machine with parameter_set_1
if (chipselect_2)
execute the state machine with parameter_set_2
etc etc
I think I have figured out a way to solve the probelm by hosting the state machine in a seperate module but instead of trying to initiate the state machine from the main module, I pass all the chipselects to the state machine module and generate the appropriate parameter set within the second module. As mentioned in the previous mail, my first thoughts had been to determine the mode of operation from within an if - else statement in the main module and call the state machine from there which seems to be impossible.
I'm hoping to simulate this today - I'll let you know how I get on.
Thanks again,
John