--- /dev/null
+LOCATE COMP "ext_clk" SITE "G2";
+IOBUF PORT "ext_clk" IO_TYPE=LVCMOS33;
+
+LOCATE COMP "ext_rst" SITE "D6";
+IOBUF PORT "ext_rst" PULLMODE=UP IO_TYPE=LVCMOS33 DRIVE=4;
+
+LOCATE COMP "uart0_txd" SITE "L4";
+LOCATE COMP "uart0_rxd" SITE "M1";
+
+IOBUF PORT "uart0_txd" IO_TYPE=LVCMOS33;
+IOBUF PORT "uart0_rxd" IO_TYPE=LVCMOS33;
+
+LOCATE COMP "led_a" SITE "B2";
+LOCATE COMP "led_b" SITE "C2";
+LOCATE COMP "led_c" SITE "C1";
+
+IOBUF PORT "led_a" IO_TYPE=LVCMOS25 DRIVE=4;
+IOBUF PORT "led_b" IO_TYPE=LVCMOS25 DRIVE=4;
+IOBUF PORT "led_c" IO_TYPE=LVCMOS25 DRIVE=4;
end generate;
wb_uart0_out.dat <= x"000000" & uart0_dat8;
- wb_uart0_out.stall <= not wb_uart0_out.ack;
+ wb_uart0_out.stall <= wb_uart0_in.cyc and not wb_uart0_out.ack;
--
-- UART1
end if;
end process;
wb_uart1_out.dat <= x"000000" & uart1_dat8;
- wb_uart1_out.stall <= not wb_uart1_out.ack;
+ wb_uart1_out.stall <= wb_uart1_in.cyc and not wb_uart1_out.ack;
end generate;
no_uart1 : if not HAS_UART1 generate
no_bram: if MEMORY_SIZE = 0 generate
wb_bram_out.ack <= wb_bram_in.cyc and wb_bram_in.stb;
wb_bram_out.dat <= x"FFFFFFFFFFFFFFFF";
- wb_bram_out.stall <= not wb_bram_out.ack;
+ wb_bram_out.stall <= wb_bram_in.cyc and not wb_bram_out.ack;
end generate;
-- DMI(debug bus) <-> JTAG bridge
void map(void *ea, void *pa, unsigned long perm_attr)
{
unsigned long epn = (unsigned long) ea >> 12;
- unsigned long i, j;
+ unsigned long i, j, pte;
unsigned long *ptep;
i = (epn >> 9) & 0x3ff;
j = epn & 0x1ff;
+
+ /*print_string(" ea ");
+ print_hex((unsigned long)ea);
+ print_string(" epn ");
+ print_hex(epn);
+ print_string(" i ");
+ print_hex(i);
+ print_string(" j ");
+ print_hex(j);
+ */
+
if (pgdir[i] == 0) {
zero_memory((void *)free_ptr, 512 * sizeof(unsigned long));
- store_pte(&pgdir[i], 0x8000000000000000 | free_ptr | 9);
+ pte = 0x8000000000000000 | free_ptr | 9;
+ store_pte(&pgdir[i], pte);
+/*
+ print_string("store PDE @ ");
+ print_hex((unsigned long)pgdir[i]);
+ print_string(" => ");
+ print_hex(pte);
+ print_string(" ");
+*/
free_ptr += 512 * sizeof(unsigned long);
}
ptep = read_pgd(i);
- store_pte(&ptep[j], 0xc000000000000000 | ((unsigned long)pa & 0x00fffffffffff000) | perm_attr);
+ pte = 0xc000000000000000 | ((unsigned long)pa & 0x00fffffffffff000) | perm_attr;
+ store_pte(&ptep[j], pte);
+ print_string("store PTE @ ");
+ print_hex((unsigned long)&ptep[j]);
+ print_string(" => ");
+ print_hex(pte);
+ print_string(" ");
eas_mapped[neas_mapped++] = ea;
}
int main(void)
{
console_init();
+ print_string("starting\r\n");
init_mmu();
+/* */
do_test(1, mmu_test_1);
do_test(2, mmu_test_2);
do_test(3, mmu_test_3);
do_test(4, mmu_test_4);
do_test(5, mmu_test_5);
do_test(6, mmu_test_6);
+/* */
do_test(7, mmu_test_7);
do_test(8, mmu_test_8);
do_test(9, mmu_test_9);
do_test(17, mmu_test_17);
do_test(18, mmu_test_18);
do_test(19, mmu_test_19);
-
+ /* */
return fail;
}
// sigh yes, all these should be runtime commandline options
#define TRIGGER_ENABLE
#define TRIGGER_OCCURENCES 1
-//#define TRIGGER_COUNTDOWN 10000
+#define TRIGGER_COUNTDOWN 20000
//#define TERMINATE_AT_COUNTDOWN
//#define TRIGGER_NIA 0xa580
//#define TRIGGER_INSN 0xe8628008
//#define TRIGGER_INSN 0x7db243a6
//define TRIGGER_NIA 0x603348
//#define TRIGGER_INSN 0x7c842a14
-#define TRIGGER_NIA 0xc00000000042f788
-#define TRIGGER_INSN 0x7c0802a6
+//#define TRIGGER_NIA 0xc00000000042f788
+//#define TRIGGER_INSN 0x7c0802a6
+//#define TRIGGER_INSN 0x7c842a14
+//#define TRIGGER_NIA 0xc00000000042f788
+//#define TRIGGER_INSN 0x7c0802a6
+//#define TRIGGER_NIA 0xc000000000434fc0
+//#define TRIGGER_INSN 0x4bddc159
+//#define TRIGGER_NIA 0x300
+//#define TRIGGER_INSN 0x7db243a6
+//#define TRIGGER_NIA 0xc0000000000d0cbc
+//#define TRIGGER_INSN 0xf93e0000
+#define TRIGGER_NIA 0xc00000000011e46c
+#define TRIGGER_INSN 0x60000000
//#define TRIGGER_NIA 0xc000000000077b90
//#define TRIGGER_NIA 0xc0000000000cf600
//#define TRIGGER_INSN 0x38210040