Visible to Intel only — GUID: lsi1494970076622
Ixiasoft
Visible to Intel only — GUID: lsi1494970076622
Ixiasoft
5.3.9.2.4. One-Bit PIO Peripheral
A one-bit PIO peripheral is needed to control the Nios® II cpu_resetrequest signal from the external processor. The external processor accesses the Avalon® -mapped PIO peripheral through the external processor bridge. The external processor writes the value 1 to the PIO to assert the cpu_resetrequest pin, or the value 0 to de-assert it.
The external processor can also read the state of the cpu_resettaken signal using the same PIO peripheral. However, the Nios® II processor asserts the cpu_resettaken signal for only one clock cycle at a time. Therefore, sampling this signal from software to see when reset has been achieved does not work. The signal can easily assert and de-assert again between samples, so that a valid assertion of cpu_resettaken by the Nios® II processor might never be captured by the external processor.
The PIO component included with Platform Designer includes an edge-capture feature to use in this situation. The edge-capture feature sets a bit in the edge-capture register of the PIO whenever an edge of the predefined type is seen on that bit of the PIO’s input port. The external processor can read the edge-capture register any time after it asserts cpu_resetrequest. If the cpu_resettaken signal was asserted any time since the cpu_resetrequest assertion, the relevant bit in the PIO’s edge-capture register is set.
To add a PIO component configured to use the edge-capture feature to detect assertions of cpu_resettaken to your system, perform the following steps:
- Open your system in Platform Designer.
- On the System Contents tab, under Peripherals, and then under Microcontroller Peripherals, click the PIO (Parallel I/O) component.
- Click Add.
- In the PIO MegaWizard interface, set the width to one bit and select InOut for Directions.
- Under the Edge capture register section, check the Synchronously Capture box, and then select RISING for Edge type.
- Click Finish to add the PIO component to your system.