Btw, I read back MyPWM16_1_StatusRegi_STATUS_REG with correct value, the low 2 bit are 0x01 / 0x03 toggled,
MyPWM16_1_ControlReg__MASK_CTL_AUX_CTL_REG read back correct value 0x10 as set,
MyPWM16_1_ControlReg__CONTROL_AUX_CTL_REG read back correct value 0x03 as set.
but IRQ has not triggered. And the MSB of MyPWM16_1_StatusRegi_STATUS_REG is not toggled.
Several things to check:
1) Make sure you are accessing the correct AUX_CTL Register. Your 2nd post said that you checked MyPWM16_1_ControlReg__MASK_CTL_AUX_CTL_REG. The correct register you need to write to to enable the interrupt output is:MyPWM16_1_StatusRegi_STATUS_AUX_CTL_REG. You might be lucky and the control register and the statusi register might share the same physical control register, but you should NOT assume it.
2) Also, the correct way to set the bit is to read /modify/write to that register. For example, create an alias to the StatusRegi like this in your .h file:
#define MyPWM16_1_Statusi_AuxCtl (* (reg8 *) MyPWM16_1_Statusi_STATUS_AUX_CTL_REG )
Then in your .c file:
MyPWM16_1_Statusi_AuxCtl |= 0x01; /* Set bit 4 */
3) Regarding the error about the routed reset. Which revision of device are you using? If you are using an older revision, just leave the reset port disconnected and it will be fine.
4) Your StatusRegi example code showed this port assignment to the 6 bit status bus:
But your post refers to 2 bits toggling (0x01, 0x03) in the status register when you read it, so I don't understand how this is possible. Are you certain your status bus assignment is correct?
I have some working example of using the statusi register, but the verilog looks almost exactly the same as yours. Your .md_select, .cy_int_mask parameters are correct. If you follow the example code I showed in 2) above and enable global interrupts it should work fine.
Great, Thanks. It's fixed, I accessed wrong address for status_control register.
Thanks very much.
No problem. Glad to be of help. Enjoy your datapath development adventure!