Altera_Forum
Honored Contributor
18 years agoImplementing registers on a high-spee interface
Hi all
I'm doing a design which includes a highly configurable piece of logic, and I need a register interface to configure it. The link to the CPU is a high speed parallel interface. Also I don't want register accesses to always just store and regurgitate values - in some cases I need a register write to perform some simple action, like resetting a counter or flushing a buffer. In previous designs I've used logic along the lines of: IF mclk'event AND mclk = '1' THEN IF (read_condition) THEN CASE address IS WHEN 0 => result <= device_version; WHEN 1 => result <= interesting_parameter; WHEN 2 => result <= interrupt_outstanding AND NOT interrupt_acknowledged; WHEN 3 => result <= something_else; . . END CASE; ELSE CASE address IS WHEN 0 => NULL; -- version register is read-only WHEN 1 => interesting_parameter <= cpu_data; WHEN 2 => interrupt_acknowledged <= interrupt_acknowledged OR cpu_data; WHEN 3 => something_else <= cpu_data; . . END CASE; END IF; END IF; This works absolutely fine, but it makes for rather a lot of logic to be evaluated on every clock, which limits the speed at which it can run. In my current design, however, I need the interface to run fast for other reasons, so I need to find a way to speed up access to the registers. On writes, I guess I could store address/data pairs in a dcfifo and read / process them more slowly, but this would create a new clock domain which isn't ideal. Is there a 'standard' way to implement a register interface of this type that doesn't rely on a slow clock? The nature of the CPU interface is such that cycle latency isn't a problem provided the clock speed remains high. Thanks :) Andy.