diff --git a/Cortex-M0/soclabs_demo/software/common/bootloader/bootloader.c b/Cortex-M0/soclabs_demo/software/common/bootloader/bootloader.c index d0d0ece84a8a92935afa680b9ac0cc9a1b8be48f..33838c9357735f6e7fcaf539e7185ee7b8e9284b 100644 --- a/Cortex-M0/soclabs_demo/software/common/bootloader/bootloader.c +++ b/Cortex-M0/soclabs_demo/software/common/bootloader/bootloader.c @@ -44,8 +44,10 @@ void UartStdOutInit(void) { - CMSDK_UART2->BAUDDIV = 16; - CMSDK_UART2->CTRL = 0x41; // High speed test mode, TX only +// CMSDK_UART2->BAUDDIV = 16; +// CMSDK_UART2->CTRL = 0x41; // High speed test mode, TX only + CMSDK_UART2->BAUDDIV = 208; //(1MHz/9600) + CMSDK_UART2->CTRL = 0x01; //TX only, standard UART CMSDK_GPIO1->ALTFUNCSET = (1<<5); return; } @@ -117,8 +119,8 @@ int main (void) // UART init UartStdOutInit(); - UartPuts("\nCMSDK Boot Loader\n"); - UartPuts("- load flash\n"); + UartPuts("\nGTRI-soclabs: ARM Cortex-M0 SDK\n"); // CMSDK boot loader\n"); + UartPuts(" - load flash\n\n"); FlashLoader(); return 0; } diff --git a/Cortex-M0/soclabs_demo/software/common/retarget/uart_stdout.c b/Cortex-M0/soclabs_demo/software/common/retarget/uart_stdout.c index c46781ccd3d3fda25203cf4ccd12f4202e698fba..7259de0717338e9951bcdddb3a85677b4c2c8945 100644 --- a/Cortex-M0/soclabs_demo/software/common/retarget/uart_stdout.c +++ b/Cortex-M0/soclabs_demo/software/common/retarget/uart_stdout.c @@ -45,8 +45,10 @@ void UartStdOutInit(void) { - CMSDK_UART2->BAUDDIV = 16; - CMSDK_UART2->CTRL = 0x41; // High speed test mode, TX only +// CMSDK_UART2->BAUDDIV = 16; +// CMSDK_UART2->CTRL = 0x41; // High speed test mode, TX only + CMSDK_UART2->BAUDDIV = 208; //(1MHz/9600) + CMSDK_UART2->CTRL = 0x01; //TX only, standard UART CMSDK_GPIO1->ALTFUNCSET = (1<<5); return; } diff --git a/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/bootrom.v b/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/bootrom.v index f5b0e7f2e5c11f2e9c8dd7c2017e2e776e585bc9..d3f9d94c55ac65f489ae582b657e0f934578c207 100644 --- a/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/bootrom.v +++ b/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/bootrom.v @@ -6,262 +6,262 @@ module bootrom ( reg [9:2] addr_r; always @(posedge CLK) if (EN) addr_r <= ADDR; always @(addr_r) case(addr_r[9:2]) - 8'h000 : RDATA <= 32'h20000368; // 0x0000 - 8'h001 : RDATA <= 32'h010002d1; // 0x0004 - 8'h002 : RDATA <= 32'h010002d9; // 0x0008 - 8'h003 : RDATA <= 32'h010002db; // 0x000c - 8'h004 : RDATA <= 32'h00000000; // 0x0010 - 8'h005 : RDATA <= 32'h00000000; // 0x0014 - 8'h006 : RDATA <= 32'h00000000; // 0x0018 - 8'h007 : RDATA <= 32'h00000000; // 0x001c - 8'h008 : RDATA <= 32'h00000000; // 0x0020 - 8'h009 : RDATA <= 32'h00000000; // 0x0024 - 8'h00a : RDATA <= 32'h00000000; // 0x0028 - 8'h00b : RDATA <= 32'h010002dd; // 0x002c - 8'h00c : RDATA <= 32'h00000000; // 0x0030 - 8'h00d : RDATA <= 32'h00000000; // 0x0034 - 8'h00e : RDATA <= 32'h010002df; // 0x0038 - 8'h00f : RDATA <= 32'h010002e1; // 0x003c - 8'h010 : RDATA <= 32'h010002e3; // 0x0040 - 8'h011 : RDATA <= 32'h010002e3; // 0x0044 - 8'h012 : RDATA <= 32'h010002e3; // 0x0048 - 8'h013 : RDATA <= 32'h010002e3; // 0x004c - 8'h014 : RDATA <= 32'h010002e3; // 0x0050 - 8'h015 : RDATA <= 32'h010002e3; // 0x0054 - 8'h016 : RDATA <= 32'h010002e3; // 0x0058 - 8'h017 : RDATA <= 32'h010002e3; // 0x005c - 8'h018 : RDATA <= 32'h010002e3; // 0x0060 - 8'h019 : RDATA <= 32'h010002e3; // 0x0064 - 8'h01a : RDATA <= 32'h010002e3; // 0x0068 - 8'h01b : RDATA <= 32'h00000000; // 0x006c - 8'h01c : RDATA <= 32'h010002e3; // 0x0070 - 8'h01d : RDATA <= 32'h010002e3; // 0x0074 - 8'h01e : RDATA <= 32'h010002e3; // 0x0078 - 8'h01f : RDATA <= 32'h010002e3; // 0x007c - 8'h020 : RDATA <= 32'h010002e3; // 0x0080 - 8'h021 : RDATA <= 32'h010002e3; // 0x0084 - 8'h022 : RDATA <= 32'h010002e3; // 0x0088 - 8'h023 : RDATA <= 32'h010002e3; // 0x008c - 8'h024 : RDATA <= 32'h010002e3; // 0x0090 - 8'h025 : RDATA <= 32'h010002e3; // 0x0094 - 8'h026 : RDATA <= 32'h010002e3; // 0x0098 - 8'h027 : RDATA <= 32'h010002e3; // 0x009c - 8'h028 : RDATA <= 32'h010002e3; // 0x00a0 - 8'h029 : RDATA <= 32'h010002e3; // 0x00a4 - 8'h02a : RDATA <= 32'h010002e3; // 0x00a8 - 8'h02b : RDATA <= 32'h010002e3; // 0x00ac - 8'h02c : RDATA <= 32'h010002e3; // 0x00b0 - 8'h02d : RDATA <= 32'h010002e3; // 0x00b4 - 8'h02e : RDATA <= 32'h010002e3; // 0x00b8 - 8'h02f : RDATA <= 32'h010002e3; // 0x00bc - 8'h030 : RDATA <= 32'hf802f000; // 0x00c0 - 8'h031 : RDATA <= 32'hf83ef000; // 0x00c4 - 8'h032 : RDATA <= 32'hc830a00c; // 0x00c8 - 8'h033 : RDATA <= 32'h18243808; // 0x00cc - 8'h034 : RDATA <= 32'h46a2182d; // 0x00d0 - 8'h035 : RDATA <= 32'h46ab1e67; // 0x00d4 - 8'h036 : RDATA <= 32'h465d4654; // 0x00d8 - 8'h037 : RDATA <= 32'hd10142ac; // 0x00dc - 8'h038 : RDATA <= 32'hf830f000; // 0x00e0 - 8'h039 : RDATA <= 32'h3e0f467e; // 0x00e4 - 8'h03a : RDATA <= 32'h46b6cc0f; // 0x00e8 - 8'h03b : RDATA <= 32'h42332601; // 0x00ec - 8'h03c : RDATA <= 32'h1afbd000; // 0x00f0 - 8'h03d : RDATA <= 32'h46ab46a2; // 0x00f4 - 8'h03e : RDATA <= 32'h47184333; // 0x00f8 - 8'h03f : RDATA <= 32'h00000278; // 0x00fc - 8'h040 : RDATA <= 32'h00000298; // 0x0100 - 8'h041 : RDATA <= 32'hd3023a10; // 0x0104 - 8'h042 : RDATA <= 32'hc178c878; // 0x0108 - 8'h043 : RDATA <= 32'h0752d8fa; // 0x010c - 8'h044 : RDATA <= 32'hc830d301; // 0x0110 - 8'h045 : RDATA <= 32'hd501c130; // 0x0114 - 8'h046 : RDATA <= 32'h600c6804; // 0x0118 - 8'h047 : RDATA <= 32'h00004770; // 0x011c - 8'h048 : RDATA <= 32'h24002300; // 0x0120 - 8'h049 : RDATA <= 32'h26002500; // 0x0124 - 8'h04a : RDATA <= 32'hd3013a10; // 0x0128 - 8'h04b : RDATA <= 32'hd8fbc178; // 0x012c - 8'h04c : RDATA <= 32'hd3000752; // 0x0130 - 8'h04d : RDATA <= 32'hd500c130; // 0x0134 - 8'h04e : RDATA <= 32'h4770600b; // 0x0138 - 8'h04f : RDATA <= 32'hbd1fb51f; // 0x013c - 8'h050 : RDATA <= 32'hbd10b510; // 0x0140 - 8'h051 : RDATA <= 32'hf8e3f000; // 0x0144 - 8'h052 : RDATA <= 32'hf7ff4611; // 0x0148 - 8'h053 : RDATA <= 32'hf000fff7; // 0x014c - 8'h054 : RDATA <= 32'hf000f84a; // 0x0150 - 8'h055 : RDATA <= 32'hb403f8fb; // 0x0154 - 8'h056 : RDATA <= 32'hfff2f7ff; // 0x0158 - 8'h057 : RDATA <= 32'hf000bc03; // 0x015c - 8'h058 : RDATA <= 32'h0000f901; // 0x0160 - 8'h059 : RDATA <= 32'h68012000; // 0x0164 - 8'h05a : RDATA <= 32'h6841468d; // 0x0168 - 8'h05b : RDATA <= 32'h00004708; // 0x016c - 8'h05c : RDATA <= 32'h2110483c; // 0x0170 - 8'h05d : RDATA <= 32'h21416101; // 0x0174 - 8'h05e : RDATA <= 32'h493b6081; // 0x0178 - 8'h05f : RDATA <= 32'h61882020; // 0x017c - 8'h060 : RDATA <= 32'h49384770; // 0x0180 - 8'h061 : RDATA <= 32'h07d2684a; // 0x0184 - 8'h062 : RDATA <= 32'h6008d1fc; // 0x0188 - 8'h063 : RDATA <= 32'h49354770; // 0x018c - 8'h064 : RDATA <= 32'h2b007803; // 0x0190 - 8'h065 : RDATA <= 32'h684ad006; // 0x0194 - 8'h066 : RDATA <= 32'hd1fc07d2; // 0x0198 - 8'h067 : RDATA <= 32'h1c40600b; // 0x019c - 8'h068 : RDATA <= 32'hd1f52b00; // 0x01a0 - 8'h069 : RDATA <= 32'hb5104770; // 0x01a4 - 8'h06a : RDATA <= 32'h68014830; // 0x01a8 - 8'h06b : RDATA <= 32'hd0082900; // 0x01ac - 8'h06c : RDATA <= 32'h60012100; // 0x01b0 - 8'h06d : RDATA <= 32'h8f4ff3bf; // 0x01b4 - 8'h06e : RDATA <= 32'h8f6ff3bf; // 0x01b8 - 8'h06f : RDATA <= 32'hffd2f7ff; // 0x01bc - 8'h070 : RDATA <= 32'h4828bd10; // 0x01c0 - 8'h071 : RDATA <= 32'h781aa32a; // 0x01c4 - 8'h072 : RDATA <= 32'hd0062a00; // 0x01c8 - 8'h073 : RDATA <= 32'h07c96841; // 0x01cc - 8'h074 : RDATA <= 32'h6002d1fc; // 0x01d0 - 8'h075 : RDATA <= 32'h2a001c5b; // 0x01d4 - 8'h076 : RDATA <= 32'h2104d1f5; // 0x01d8 - 8'h077 : RDATA <= 32'h07d26842; // 0x01dc - 8'h078 : RDATA <= 32'h6001d1fc; // 0x01e0 - 8'h079 : RDATA <= 32'hb510e7fe; // 0x01e4 - 8'h07a : RDATA <= 32'h2110481e; // 0x01e8 - 8'h07b : RDATA <= 32'h21416101; // 0x01ec - 8'h07c : RDATA <= 32'h4a1d6081; // 0x01f0 - 8'h07d : RDATA <= 32'h61912120; // 0x01f4 - 8'h07e : RDATA <= 32'h781aa326; // 0x01f8 - 8'h07f : RDATA <= 32'hd0062a00; // 0x01fc - 8'h080 : RDATA <= 32'h07c96841; // 0x0200 - 8'h081 : RDATA <= 32'h6002d1fc; // 0x0204 - 8'h082 : RDATA <= 32'h2a001c5b; // 0x0208 - 8'h083 : RDATA <= 32'ha326d1f5; // 0x020c - 8'h084 : RDATA <= 32'h2a00781a; // 0x0210 - 8'h085 : RDATA <= 32'h6841d006; // 0x0214 - 8'h086 : RDATA <= 32'hd1fc07c9; // 0x0218 - 8'h087 : RDATA <= 32'h1c5b6002; // 0x021c - 8'h088 : RDATA <= 32'hd1f52a00; // 0x0220 - 8'h089 : RDATA <= 32'h680a4911; // 0x0224 - 8'h08a : RDATA <= 32'hd0092a00; // 0x0228 - 8'h08b : RDATA <= 32'h60082000; // 0x022c - 8'h08c : RDATA <= 32'h8f4ff3bf; // 0x0230 - 8'h08d : RDATA <= 32'h8f6ff3bf; // 0x0234 - 8'h08e : RDATA <= 32'hff94f7ff; // 0x0238 - 8'h08f : RDATA <= 32'hbd102000; // 0x023c - 8'h090 : RDATA <= 32'h781aa30b; // 0x0240 - 8'h091 : RDATA <= 32'hd0062a00; // 0x0244 - 8'h092 : RDATA <= 32'h07c96841; // 0x0248 - 8'h093 : RDATA <= 32'h6002d1fc; // 0x024c - 8'h094 : RDATA <= 32'h2a001c5b; // 0x0250 - 8'h095 : RDATA <= 32'h2204d1f5; // 0x0254 - 8'h096 : RDATA <= 32'h07c96841; // 0x0258 - 8'h097 : RDATA <= 32'h6002d1fc; // 0x025c - 8'h098 : RDATA <= 32'h0000e7fe; // 0x0260 - 8'h099 : RDATA <= 32'h40006000; // 0x0264 - 8'h09a : RDATA <= 32'h40011000; // 0x0268 - 8'h09b : RDATA <= 32'h4001f000; // 0x026c - 8'h09c : RDATA <= 32'h7245202d; // 0x0270 - 8'h09d : RDATA <= 32'h3a726f72; // 0x0274 - 8'h09e : RDATA <= 32'h4d455220; // 0x0278 - 8'h09f : RDATA <= 32'h69205041; // 0x027c - 8'h0a0 : RDATA <= 32'h6c612073; // 0x0280 - 8'h0a1 : RDATA <= 32'h64616572; // 0x0284 - 8'h0a2 : RDATA <= 32'h6c632079; // 0x0288 - 8'h0a3 : RDATA <= 32'h0a726165; // 0x028c - 8'h0a4 : RDATA <= 32'h00000000; // 0x0290 - 8'h0a5 : RDATA <= 32'h534d430a; // 0x0294 - 8'h0a6 : RDATA <= 32'h42204b44; // 0x0298 - 8'h0a7 : RDATA <= 32'h20746f6f; // 0x029c - 8'h0a8 : RDATA <= 32'h64616f4c; // 0x02a0 - 8'h0a9 : RDATA <= 32'h000a7265; // 0x02a4 - 8'h0aa : RDATA <= 32'h6f6c202d; // 0x02a8 - 8'h0ab : RDATA <= 32'h66206461; // 0x02ac - 8'h0ac : RDATA <= 32'h6873616c; // 0x02b0 - 8'h0ad : RDATA <= 32'h0000000a; // 0x02b4 - 8'h0ae : RDATA <= 32'h48034904; // 0x02b8 - 8'h0af : RDATA <= 32'h47706008; // 0x02bc - 8'h0b0 : RDATA <= 32'h48014902; // 0x02c0 - 8'h0b1 : RDATA <= 32'h47706008; // 0x02c4 - 8'h0b2 : RDATA <= 32'h05f5e100; // 0x02c8 - 8'h0b3 : RDATA <= 32'h20000000; // 0x02cc - 8'h0b4 : RDATA <= 32'h47804807; // 0x02d0 - 8'h0b5 : RDATA <= 32'h47004807; // 0x02d4 - 8'h0b6 : RDATA <= 32'he7fee7fe; // 0x02d8 - 8'h0b7 : RDATA <= 32'he7fee7fe; // 0x02dc - 8'h0b8 : RDATA <= 32'he7fee7fe; // 0x02e0 - 8'h0b9 : RDATA <= 32'h49054804; // 0x02e4 - 8'h0ba : RDATA <= 32'h4b064a05; // 0x02e8 - 8'h0bb : RDATA <= 32'h00004770; // 0x02ec - 8'h0bc : RDATA <= 32'h010002c1; // 0x02f0 - 8'h0bd : RDATA <= 32'h010000c1; // 0x02f4 - 8'h0be : RDATA <= 32'h20000068; // 0x02f8 - 8'h0bf : RDATA <= 32'h20000368; // 0x02fc - 8'h0c0 : RDATA <= 32'h20000168; // 0x0300 - 8'h0c1 : RDATA <= 32'h20000168; // 0x0304 - 8'h0c2 : RDATA <= 32'h47704770; // 0x0308 - 8'h0c3 : RDATA <= 32'h46754770; // 0x030c - 8'h0c4 : RDATA <= 32'hf824f000; // 0x0310 - 8'h0c5 : RDATA <= 32'h000546ae; // 0x0314 - 8'h0c6 : RDATA <= 32'h46534669; // 0x0318 - 8'h0c7 : RDATA <= 32'h00c008c0; // 0x031c - 8'h0c8 : RDATA <= 32'hb0184685; // 0x0320 - 8'h0c9 : RDATA <= 32'hf7ffb520; // 0x0324 - 8'h0ca : RDATA <= 32'hbc60ffdd; // 0x0328 - 8'h0cb : RDATA <= 32'h08492700; // 0x032c - 8'h0cc : RDATA <= 32'h260046b6; // 0x0330 - 8'h0cd : RDATA <= 32'hc5c0c5c0; // 0x0334 - 8'h0ce : RDATA <= 32'hc5c0c5c0; // 0x0338 - 8'h0cf : RDATA <= 32'hc5c0c5c0; // 0x033c - 8'h0d0 : RDATA <= 32'hc5c0c5c0; // 0x0340 - 8'h0d1 : RDATA <= 32'h00493d40; // 0x0344 - 8'h0d2 : RDATA <= 32'h4770468d; // 0x0348 - 8'h0d3 : RDATA <= 32'h4604b510; // 0x034c - 8'h0d4 : RDATA <= 32'h46c046c0; // 0x0350 - 8'h0d5 : RDATA <= 32'hf7ff4620; // 0x0354 - 8'h0d6 : RDATA <= 32'hbd10fefe; // 0x0358 - 8'h0d7 : RDATA <= 32'h47704800; // 0x035c - 8'h0d8 : RDATA <= 32'h20000004; // 0x0360 - 8'h0d9 : RDATA <= 32'h20184901; // 0x0364 - 8'h0da : RDATA <= 32'he7febeab; // 0x0368 - 8'h0db : RDATA <= 32'h00020026; // 0x036c - 8'h0dc : RDATA <= 32'h00004770; // 0x0370 - 8'h0dd : RDATA <= 32'h01000394; // 0x0374 - 8'h0de : RDATA <= 32'h20000000; // 0x0378 - 8'h0df : RDATA <= 32'h00000004; // 0x037c - 8'h0e0 : RDATA <= 32'h01000104; // 0x0380 - 8'h0e1 : RDATA <= 32'h01000398; // 0x0384 - 8'h0e2 : RDATA <= 32'h20000004; // 0x0388 - 8'h0e3 : RDATA <= 32'h00000364; // 0x038c - 8'h0e4 : RDATA <= 32'h01000120; // 0x0390 - 8'h0e5 : RDATA <= 32'h05f5e100; // 0x0394 - 8'h0e6 : RDATA <= 32'h00000000; // 0x0398 - 8'h0e7 : RDATA <= 32'h00000000; // 0x039c - 8'h0e8 : RDATA <= 32'h00000000; // 0x03a0 - 8'h0e9 : RDATA <= 32'h00000000; // 0x03a4 - 8'h0ea : RDATA <= 32'h00000000; // 0x03a8 - 8'h0eb : RDATA <= 32'h00000000; // 0x03ac - 8'h0ec : RDATA <= 32'h00000000; // 0x03b0 - 8'h0ed : RDATA <= 32'h00000000; // 0x03b4 - 8'h0ee : RDATA <= 32'h00000000; // 0x03b8 - 8'h0ef : RDATA <= 32'h00000000; // 0x03bc - 8'h0f0 : RDATA <= 32'h00000000; // 0x03c0 - 8'h0f1 : RDATA <= 32'h00000000; // 0x03c4 - 8'h0f2 : RDATA <= 32'h00000000; // 0x03c8 - 8'h0f3 : RDATA <= 32'h00000000; // 0x03cc - 8'h0f4 : RDATA <= 32'h00000000; // 0x03d0 - 8'h0f5 : RDATA <= 32'h00000000; // 0x03d4 - 8'h0f6 : RDATA <= 32'h00000000; // 0x03d8 - 8'h0f7 : RDATA <= 32'h00000000; // 0x03dc - 8'h0f8 : RDATA <= 32'h00000000; // 0x03e0 - 8'h0f9 : RDATA <= 32'h00000000; // 0x03e4 - 8'h0fa : RDATA <= 32'h00000000; // 0x03e8 - 8'h0fb : RDATA <= 32'h00000000; // 0x03ec - 8'h0fc : RDATA <= 32'h00000000; // 0x03f0 - 8'h0fd : RDATA <= 32'h00000000; // 0x03f4 - 8'h0fe : RDATA <= 32'h00000000; // 0x03f8 - 8'h0ff : RDATA <= 32'h00000000; // 0x03fc + 8'h00 : RDATA <= 32'h20000368; // 0x0000 + 8'h01 : RDATA <= 32'h010002e1; // 0x0004 + 8'h02 : RDATA <= 32'h010002e9; // 0x0008 + 8'h03 : RDATA <= 32'h010002eb; // 0x000c + 8'h04 : RDATA <= 32'h00000000; // 0x0010 + 8'h05 : RDATA <= 32'h00000000; // 0x0014 + 8'h06 : RDATA <= 32'h00000000; // 0x0018 + 8'h07 : RDATA <= 32'h00000000; // 0x001c + 8'h08 : RDATA <= 32'h00000000; // 0x0020 + 8'h09 : RDATA <= 32'h00000000; // 0x0024 + 8'h0a : RDATA <= 32'h00000000; // 0x0028 + 8'h0b : RDATA <= 32'h010002ed; // 0x002c + 8'h0c : RDATA <= 32'h00000000; // 0x0030 + 8'h0d : RDATA <= 32'h00000000; // 0x0034 + 8'h0e : RDATA <= 32'h010002ef; // 0x0038 + 8'h0f : RDATA <= 32'h010002f1; // 0x003c + 8'h10 : RDATA <= 32'h010002f3; // 0x0040 + 8'h11 : RDATA <= 32'h010002f3; // 0x0044 + 8'h12 : RDATA <= 32'h010002f3; // 0x0048 + 8'h13 : RDATA <= 32'h010002f3; // 0x004c + 8'h14 : RDATA <= 32'h010002f3; // 0x0050 + 8'h15 : RDATA <= 32'h010002f3; // 0x0054 + 8'h16 : RDATA <= 32'h010002f3; // 0x0058 + 8'h17 : RDATA <= 32'h010002f3; // 0x005c + 8'h18 : RDATA <= 32'h010002f3; // 0x0060 + 8'h19 : RDATA <= 32'h010002f3; // 0x0064 + 8'h1a : RDATA <= 32'h010002f3; // 0x0068 + 8'h1b : RDATA <= 32'h00000000; // 0x006c + 8'h1c : RDATA <= 32'h010002f3; // 0x0070 + 8'h1d : RDATA <= 32'h010002f3; // 0x0074 + 8'h1e : RDATA <= 32'h010002f3; // 0x0078 + 8'h1f : RDATA <= 32'h010002f3; // 0x007c + 8'h20 : RDATA <= 32'h010002f3; // 0x0080 + 8'h21 : RDATA <= 32'h010002f3; // 0x0084 + 8'h22 : RDATA <= 32'h010002f3; // 0x0088 + 8'h23 : RDATA <= 32'h010002f3; // 0x008c + 8'h24 : RDATA <= 32'h010002f3; // 0x0090 + 8'h25 : RDATA <= 32'h010002f3; // 0x0094 + 8'h26 : RDATA <= 32'h010002f3; // 0x0098 + 8'h27 : RDATA <= 32'h010002f3; // 0x009c + 8'h28 : RDATA <= 32'h010002f3; // 0x00a0 + 8'h29 : RDATA <= 32'h010002f3; // 0x00a4 + 8'h2a : RDATA <= 32'h010002f3; // 0x00a8 + 8'h2b : RDATA <= 32'h010002f3; // 0x00ac + 8'h2c : RDATA <= 32'h010002f3; // 0x00b0 + 8'h2d : RDATA <= 32'h010002f3; // 0x00b4 + 8'h2e : RDATA <= 32'h010002f3; // 0x00b8 + 8'h2f : RDATA <= 32'h010002f3; // 0x00bc + 8'h30 : RDATA <= 32'hf802f000; // 0x00c0 + 8'h31 : RDATA <= 32'hf83ef000; // 0x00c4 + 8'h32 : RDATA <= 32'hc830a00c; // 0x00c8 + 8'h33 : RDATA <= 32'h18243808; // 0x00cc + 8'h34 : RDATA <= 32'h46a2182d; // 0x00d0 + 8'h35 : RDATA <= 32'h46ab1e67; // 0x00d4 + 8'h36 : RDATA <= 32'h465d4654; // 0x00d8 + 8'h37 : RDATA <= 32'hd10142ac; // 0x00dc + 8'h38 : RDATA <= 32'hf830f000; // 0x00e0 + 8'h39 : RDATA <= 32'h3e0f467e; // 0x00e4 + 8'h3a : RDATA <= 32'h46b6cc0f; // 0x00e8 + 8'h3b : RDATA <= 32'h42332601; // 0x00ec + 8'h3c : RDATA <= 32'h1afbd000; // 0x00f0 + 8'h3d : RDATA <= 32'h46ab46a2; // 0x00f4 + 8'h3e : RDATA <= 32'h47184333; // 0x00f8 + 8'h3f : RDATA <= 32'h00000288; // 0x00fc + 8'h40 : RDATA <= 32'h000002a8; // 0x0100 + 8'h41 : RDATA <= 32'hd3023a10; // 0x0104 + 8'h42 : RDATA <= 32'hc178c878; // 0x0108 + 8'h43 : RDATA <= 32'h0752d8fa; // 0x010c + 8'h44 : RDATA <= 32'hc830d301; // 0x0110 + 8'h45 : RDATA <= 32'hd501c130; // 0x0114 + 8'h46 : RDATA <= 32'h600c6804; // 0x0118 + 8'h47 : RDATA <= 32'h00004770; // 0x011c + 8'h48 : RDATA <= 32'h24002300; // 0x0120 + 8'h49 : RDATA <= 32'h26002500; // 0x0124 + 8'h4a : RDATA <= 32'hd3013a10; // 0x0128 + 8'h4b : RDATA <= 32'hd8fbc178; // 0x012c + 8'h4c : RDATA <= 32'hd3000752; // 0x0130 + 8'h4d : RDATA <= 32'hd500c130; // 0x0134 + 8'h4e : RDATA <= 32'h4770600b; // 0x0138 + 8'h4f : RDATA <= 32'hbd1fb51f; // 0x013c + 8'h50 : RDATA <= 32'hbd10b510; // 0x0140 + 8'h51 : RDATA <= 32'hf8ebf000; // 0x0144 + 8'h52 : RDATA <= 32'hf7ff4611; // 0x0148 + 8'h53 : RDATA <= 32'hf000fff7; // 0x014c + 8'h54 : RDATA <= 32'hf000f84a; // 0x0150 + 8'h55 : RDATA <= 32'hb403f903; // 0x0154 + 8'h56 : RDATA <= 32'hfff2f7ff; // 0x0158 + 8'h57 : RDATA <= 32'hf000bc03; // 0x015c + 8'h58 : RDATA <= 32'h0000f909; // 0x0160 + 8'h59 : RDATA <= 32'h68012000; // 0x0164 + 8'h5a : RDATA <= 32'h6841468d; // 0x0168 + 8'h5b : RDATA <= 32'h00004708; // 0x016c + 8'h5c : RDATA <= 32'h21d0483c; // 0x0170 + 8'h5d : RDATA <= 32'h21016101; // 0x0174 + 8'h5e : RDATA <= 32'h493b6081; // 0x0178 + 8'h5f : RDATA <= 32'h61882020; // 0x017c + 8'h60 : RDATA <= 32'h49384770; // 0x0180 + 8'h61 : RDATA <= 32'h07d2684a; // 0x0184 + 8'h62 : RDATA <= 32'h6008d1fc; // 0x0188 + 8'h63 : RDATA <= 32'h49354770; // 0x018c + 8'h64 : RDATA <= 32'h2b007803; // 0x0190 + 8'h65 : RDATA <= 32'h684ad006; // 0x0194 + 8'h66 : RDATA <= 32'hd1fc07d2; // 0x0198 + 8'h67 : RDATA <= 32'h1c40600b; // 0x019c + 8'h68 : RDATA <= 32'hd1f52b00; // 0x01a0 + 8'h69 : RDATA <= 32'hb5104770; // 0x01a4 + 8'h6a : RDATA <= 32'h68014830; // 0x01a8 + 8'h6b : RDATA <= 32'hd0082900; // 0x01ac + 8'h6c : RDATA <= 32'h60012100; // 0x01b0 + 8'h6d : RDATA <= 32'h8f4ff3bf; // 0x01b4 + 8'h6e : RDATA <= 32'h8f6ff3bf; // 0x01b8 + 8'h6f : RDATA <= 32'hffd2f7ff; // 0x01bc + 8'h70 : RDATA <= 32'h4828bd10; // 0x01c0 + 8'h71 : RDATA <= 32'h781aa32a; // 0x01c4 + 8'h72 : RDATA <= 32'hd0062a00; // 0x01c8 + 8'h73 : RDATA <= 32'h07c96841; // 0x01cc + 8'h74 : RDATA <= 32'h6002d1fc; // 0x01d0 + 8'h75 : RDATA <= 32'h2a001c5b; // 0x01d4 + 8'h76 : RDATA <= 32'h2104d1f5; // 0x01d8 + 8'h77 : RDATA <= 32'h07d26842; // 0x01dc + 8'h78 : RDATA <= 32'h6001d1fc; // 0x01e0 + 8'h79 : RDATA <= 32'hb510e7fe; // 0x01e4 + 8'h7a : RDATA <= 32'h21d0481e; // 0x01e8 + 8'h7b : RDATA <= 32'h21016101; // 0x01ec + 8'h7c : RDATA <= 32'h4a1d6081; // 0x01f0 + 8'h7d : RDATA <= 32'h61912120; // 0x01f4 + 8'h7e : RDATA <= 32'h781aa326; // 0x01f8 + 8'h7f : RDATA <= 32'hd0062a00; // 0x01fc + 8'h80 : RDATA <= 32'h07c96841; // 0x0200 + 8'h81 : RDATA <= 32'h6002d1fc; // 0x0204 + 8'h82 : RDATA <= 32'h2a001c5b; // 0x0208 + 8'h83 : RDATA <= 32'ha32ad1f5; // 0x020c + 8'h84 : RDATA <= 32'h2a00781a; // 0x0210 + 8'h85 : RDATA <= 32'h6841d006; // 0x0214 + 8'h86 : RDATA <= 32'hd1fc07c9; // 0x0218 + 8'h87 : RDATA <= 32'h1c5b6002; // 0x021c + 8'h88 : RDATA <= 32'hd1f52a00; // 0x0220 + 8'h89 : RDATA <= 32'h680a4911; // 0x0224 + 8'h8a : RDATA <= 32'hd0092a00; // 0x0228 + 8'h8b : RDATA <= 32'h60082000; // 0x022c + 8'h8c : RDATA <= 32'h8f4ff3bf; // 0x0230 + 8'h8d : RDATA <= 32'h8f6ff3bf; // 0x0234 + 8'h8e : RDATA <= 32'hff94f7ff; // 0x0238 + 8'h8f : RDATA <= 32'hbd102000; // 0x023c + 8'h90 : RDATA <= 32'h781aa30b; // 0x0240 + 8'h91 : RDATA <= 32'hd0062a00; // 0x0244 + 8'h92 : RDATA <= 32'h07c96841; // 0x0248 + 8'h93 : RDATA <= 32'h6002d1fc; // 0x024c + 8'h94 : RDATA <= 32'h2a001c5b; // 0x0250 + 8'h95 : RDATA <= 32'h2204d1f5; // 0x0254 + 8'h96 : RDATA <= 32'h07c96841; // 0x0258 + 8'h97 : RDATA <= 32'h6002d1fc; // 0x025c + 8'h98 : RDATA <= 32'h0000e7fe; // 0x0260 + 8'h99 : RDATA <= 32'h40006000; // 0x0264 + 8'h9a : RDATA <= 32'h40011000; // 0x0268 + 8'h9b : RDATA <= 32'h4001f000; // 0x026c + 8'h9c : RDATA <= 32'h7245202d; // 0x0270 + 8'h9d : RDATA <= 32'h3a726f72; // 0x0274 + 8'h9e : RDATA <= 32'h4d455220; // 0x0278 + 8'h9f : RDATA <= 32'h69205041; // 0x027c + 8'ha0 : RDATA <= 32'h6c612073; // 0x0280 + 8'ha1 : RDATA <= 32'h64616572; // 0x0284 + 8'ha2 : RDATA <= 32'h6c632079; // 0x0288 + 8'ha3 : RDATA <= 32'h0a726165; // 0x028c + 8'ha4 : RDATA <= 32'h00000000; // 0x0290 + 8'ha5 : RDATA <= 32'h5254470a; // 0x0294 + 8'ha6 : RDATA <= 32'h6f732d49; // 0x0298 + 8'ha7 : RDATA <= 32'h62616c63; // 0x029c + 8'ha8 : RDATA <= 32'h41203a73; // 0x02a0 + 8'ha9 : RDATA <= 32'h43204d52; // 0x02a4 + 8'haa : RDATA <= 32'h6574726f; // 0x02a8 + 8'hab : RDATA <= 32'h304d2d78; // 0x02ac + 8'hac : RDATA <= 32'h4b445320; // 0x02b0 + 8'had : RDATA <= 32'h0000000a; // 0x02b4 + 8'hae : RDATA <= 32'h6c202d20; // 0x02b8 + 8'haf : RDATA <= 32'h2064616f; // 0x02bc + 8'hb0 : RDATA <= 32'h73616c66; // 0x02c0 + 8'hb1 : RDATA <= 32'h000a0a68; // 0x02c4 + 8'hb2 : RDATA <= 32'h48034904; // 0x02c8 + 8'hb3 : RDATA <= 32'h47706008; // 0x02cc + 8'hb4 : RDATA <= 32'h48014902; // 0x02d0 + 8'hb5 : RDATA <= 32'h47706008; // 0x02d4 + 8'hb6 : RDATA <= 32'h05f5e100; // 0x02d8 + 8'hb7 : RDATA <= 32'h20000000; // 0x02dc + 8'hb8 : RDATA <= 32'h47804807; // 0x02e0 + 8'hb9 : RDATA <= 32'h47004807; // 0x02e4 + 8'hba : RDATA <= 32'he7fee7fe; // 0x02e8 + 8'hbb : RDATA <= 32'he7fee7fe; // 0x02ec + 8'hbc : RDATA <= 32'he7fee7fe; // 0x02f0 + 8'hbd : RDATA <= 32'h49054804; // 0x02f4 + 8'hbe : RDATA <= 32'h4b064a05; // 0x02f8 + 8'hbf : RDATA <= 32'h00004770; // 0x02fc + 8'hc0 : RDATA <= 32'h010002d1; // 0x0300 + 8'hc1 : RDATA <= 32'h010000c1; // 0x0304 + 8'hc2 : RDATA <= 32'h20000068; // 0x0308 + 8'hc3 : RDATA <= 32'h20000368; // 0x030c + 8'hc4 : RDATA <= 32'h20000168; // 0x0310 + 8'hc5 : RDATA <= 32'h20000168; // 0x0314 + 8'hc6 : RDATA <= 32'h47704770; // 0x0318 + 8'hc7 : RDATA <= 32'h46754770; // 0x031c + 8'hc8 : RDATA <= 32'hf824f000; // 0x0320 + 8'hc9 : RDATA <= 32'h000546ae; // 0x0324 + 8'hca : RDATA <= 32'h46534669; // 0x0328 + 8'hcb : RDATA <= 32'h00c008c0; // 0x032c + 8'hcc : RDATA <= 32'hb0184685; // 0x0330 + 8'hcd : RDATA <= 32'hf7ffb520; // 0x0334 + 8'hce : RDATA <= 32'hbc60ffdd; // 0x0338 + 8'hcf : RDATA <= 32'h08492700; // 0x033c + 8'hd0 : RDATA <= 32'h260046b6; // 0x0340 + 8'hd1 : RDATA <= 32'hc5c0c5c0; // 0x0344 + 8'hd2 : RDATA <= 32'hc5c0c5c0; // 0x0348 + 8'hd3 : RDATA <= 32'hc5c0c5c0; // 0x034c + 8'hd4 : RDATA <= 32'hc5c0c5c0; // 0x0350 + 8'hd5 : RDATA <= 32'h00493d40; // 0x0354 + 8'hd6 : RDATA <= 32'h4770468d; // 0x0358 + 8'hd7 : RDATA <= 32'h4604b510; // 0x035c + 8'hd8 : RDATA <= 32'h46c046c0; // 0x0360 + 8'hd9 : RDATA <= 32'hf7ff4620; // 0x0364 + 8'hda : RDATA <= 32'hbd10fef6; // 0x0368 + 8'hdb : RDATA <= 32'h47704800; // 0x036c + 8'hdc : RDATA <= 32'h20000004; // 0x0370 + 8'hdd : RDATA <= 32'h20184901; // 0x0374 + 8'hde : RDATA <= 32'he7febeab; // 0x0378 + 8'hdf : RDATA <= 32'h00020026; // 0x037c + 8'he0 : RDATA <= 32'h00004770; // 0x0380 + 8'he1 : RDATA <= 32'h010003a4; // 0x0384 + 8'he2 : RDATA <= 32'h20000000; // 0x0388 + 8'he3 : RDATA <= 32'h00000004; // 0x038c + 8'he4 : RDATA <= 32'h01000104; // 0x0390 + 8'he5 : RDATA <= 32'h010003a8; // 0x0394 + 8'he6 : RDATA <= 32'h20000004; // 0x0398 + 8'he7 : RDATA <= 32'h00000364; // 0x039c + 8'he8 : RDATA <= 32'h01000120; // 0x03a0 + 8'he9 : RDATA <= 32'h05f5e100; // 0x03a4 + 8'hea : RDATA <= 32'h00000000; // 0x03a8 + 8'heb : RDATA <= 32'h00000000; // 0x03ac + 8'hec : RDATA <= 32'h00000000; // 0x03b0 + 8'hed : RDATA <= 32'h00000000; // 0x03b4 + 8'hee : RDATA <= 32'h00000000; // 0x03b8 + 8'hef : RDATA <= 32'h00000000; // 0x03bc + 8'hf0 : RDATA <= 32'h00000000; // 0x03c0 + 8'hf1 : RDATA <= 32'h00000000; // 0x03c4 + 8'hf2 : RDATA <= 32'h00000000; // 0x03c8 + 8'hf3 : RDATA <= 32'h00000000; // 0x03cc + 8'hf4 : RDATA <= 32'h00000000; // 0x03d0 + 8'hf5 : RDATA <= 32'h00000000; // 0x03d4 + 8'hf6 : RDATA <= 32'h00000000; // 0x03d8 + 8'hf7 : RDATA <= 32'h00000000; // 0x03dc + 8'hf8 : RDATA <= 32'h00000000; // 0x03e0 + 8'hf9 : RDATA <= 32'h00000000; // 0x03e4 + 8'hfa : RDATA <= 32'h00000000; // 0x03e8 + 8'hfb : RDATA <= 32'h00000000; // 0x03ec + 8'hfc : RDATA <= 32'h00000000; // 0x03f0 + 8'hfd : RDATA <= 32'h00000000; // 0x03f4 + 8'hfe : RDATA <= 32'h00000000; // 0x03f8 + 8'hff : RDATA <= 32'h00000000; // 0x03fc default : RDATA <=32'h0; endcase endmodule diff --git a/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/cmsdk_mcu.v b/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/cmsdk_mcu.v index 2df06e50a28ff85804f49cdce634fc6320d4abd7..84ea9be58987b5fae7f07bb7a09a9b4bc52f012e 100644 --- a/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/cmsdk_mcu.v +++ b/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/cmsdk_mcu.v @@ -36,7 +36,7 @@ //----------------------------------------------------------------------------- // -// `define SYNTHBOOT 1 +`define SYNTHBOOT 1 `include "cmsdk_mcu_defs.v" @@ -775,8 +775,8 @@ cmsdk_ahb_rom //---------------------------------------- // Only use if BOOT_MEM_TYPE is not zero `ifdef SYNTHBOOTROM -//ahb_bootrom -ahb_bootrom__mangled +ahb_bootrom +//ahb_bootrom__mangled // #(.AW(10) ) // 1K bytes ROM u_ahb_bootloader ( .HCLK (HCLKSYS), diff --git a/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/tb_cmsdk_mcu.v b/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/tb_cmsdk_mcu.v index 95e2aa6a67fe4b8ca04df4290ed82f66dc39edd7..d1d2e7c527722f51130860024b7998e13c967b4f 100644 --- a/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/tb_cmsdk_mcu.v +++ b/Cortex-M0/soclabs_demo/systems/cortex_m0_mcu/verilog/tb_cmsdk_mcu.v @@ -291,11 +291,67 @@ SROM_Ax32 assign PCLK = XTAL1; `endif + // -------------------------------------------------------------------------------- + // external UART phase lock to (known) baud rate + +// seem unable to use the following (due to generate instance naming?) +// wire baudx16_clk = u_cmsdk_mcu.u_cmsdk_mcu_system.u_apb_subsystem.u_apb_uart_2.BAUDTICK; + +// 2000000/208 = 9615 baud (+0.16%) +// 208 / 16 +`define BAUDPROG 13 + + reg [3:0] bauddiv; + wire baudclken = (bauddiv == 4'b0000); + + always @(negedge NRST or posedge PCLK) + if (!NRST) + bauddiv <=0; + else + bauddiv <= (baudclken) ? (`BAUDPROG-1) : (bauddiv -1) ; // count down of 13 + + wire baudx16_clk = bauddiv[3]; + + wire UARTXD = P1[5]; + reg UARTXD_del; + always @(negedge NRST or posedge baudx16_clk) + if (!NRST) + UARTXD_del <= 1'b0; + else + UARTXD_del <= UARTXD; // delay one BAUD_TICK-time + + wire UARTXD_edge = UARTXD_del ^ UARTXD; // edge detect + + reg [3:0] pllq; + always @(negedge NRST or posedge baudx16_clk) + if (!NRST) + pllq[3:0] <= 4'b0000; // phase lock ready for Q[3] to go high + else + if (UARTXD_edge) + pllq[3:0] <= 4'b0110; // sync to mid bit-time + else + pllq[3:0] <= pllq[3:0] - 1; // count down divide-by-16 + + wire baud_clk = pllq[3]; + +reg baud_clk_del; + always @(negedge NRST or posedge PCLK) + if (!NRST) + baud_clk_del <= 1'b1; + else + baud_clk_del <= baud_clk; + + // -------------------------------------------------------------------------------- + // set FASTMODE true if UART simulation mode is programmed + wire FASTMODE = 1'b0; + wire uart_clk = (FASTMODE) ? PCLK : baud_clk; //(baud_clk & !baud_clk_del); + + cmsdk_uart_capture #(.LOGFILENAME("uart2.log")) u_cmsdk_uart_capture( .RESETn (NRST), - .CLK (PCLK), - .RXD (P1[5]), // UART 2 use for StdOut + .CLK (uart_clk), //PCLK), + .RXD (UARTXD), // UART 2 use for StdOut .DEBUG_TESTER_ENABLE (debug_test_en), .SIMULATIONEND (), // This signal set to 1 at the end of simulation. .AUXCTRL () @@ -305,6 +361,10 @@ SROM_Ax32 assign P1[0] = P1[3]; // UART 0 RXD = UART 1 TXD assign P1[2] = P1[1]; // UART 1 RXD = UART 0 TXD + // -------------------------------------------------------------------------------- + // Tracking CPU with Tarmac trace support + // -------------------------------------------------------------------------------- + `ifdef CORTEX_M0 `ifdef USE_TARMAC