module MicroBlaze_MCS_Test(
input wire clk,
input wire reset,
// input wire UART_Rx,
// output wire UART_Tx,
output wire [7:0] LED_out
);
wire PIT1_Interrupt;
wire PIT1_Toggle;
wire INTC_IRQ;
wire [7:0] GPI1;
wire FIT1_Interrupt;
wire FIT1_Toggle;
assign GPI1 = {6'd0, FIT1_Toggle, PIT1_Toggle};
MB_MCS mcs_0 (
.Clk(clk), // input Clk
.Reset(reset), // input Reset
// .UART_Rx(UART_Rx), // input UART_Rx
// .UART_Tx(UART_Tx), // output UART_Tx
.FIT1_Interrupt(FIT1_Interrupt), // output FIT1_Interrupt
.FIT1_Toggle(FIT1_Toggle), // output FIT1_Toggle
.PIT1_Enable(1'b1), // input PIT1_Enable
.PIT1_Interrupt(PIT1_Interrupt), // output PIT1_Interrupt
.PIT1_Toggle(PIT1_Toggle), // output PIT1_Toggle
.GPO1(LED_out), // output [7 : 0] GPO1
.GPI1(GPI1), // input [7 : 0] GPI1
.INTC_IRQ(INTC_IRQ) // output INTC_IRQ
);
endmodule
#define GPO1_ADDR 0x80000010
#define GPI1_ADDR 0x80000020
#define COUNT_VALUE 100
int main()
{
unsigned int b_GPI1 = 0;
unsigned int c_GPI1 = 0;
unsigned int led = 0x55;
*(volatile unsigned int *)(GPO1_ADDR) = led;
while(1){
c_GPI1 = 0x2 & (*(volatile unsigned int *)(GPI1_ADDR));
if (c_GPI1 != b_GPI1){
*(volatile unsigned int *)(GPO1_ADDR) = led++;
}
b_GPI1 = c_GPI1;
}
}
日 | 月 | 火 | 水 | 木 | 金 | 土 |
---|---|---|---|---|---|---|
- | - | - | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | - | - | - |