diff --git a/ghdl_lattice.sh b/ghdl_lattice.sh index 342f0df..369d19a 100644 --- a/ghdl_lattice.sh +++ b/ghdl_lattice.sh @@ -8,8 +8,6 @@ ghdl -a data_bus_pkg.vhd monitor_pkg.vhd ram_init.vhd lattice_ebr.vhd bus_monit ghdl -a --work=sb_ice40_components_syn clk_sim.vhd -ghdl -a ../disp_drv/disp_drv_pkg.vhd ../disp_drv/disp_drv.vhd - ghdl -a cpu_lattice.vhd lattice_tb.vhd ghdl -e lattice_tb diff --git a/ram.img b/ram.img index 802784f..185e570 100755 Binary files a/ram.img and b/ram.img differ diff --git a/ram_init.vhd b/ram_init.vhd index bf690ab..2d2a149 100644 --- a/ram_init.vhd +++ b/ram_init.vhd @@ -6,70 +6,70 @@ use ieee.numeric_std.all; package bootrom is type rom_t is array (0 to 2047) of std_logic_vector(31 downto 0); constant rom : rom_t := ( - x"000004ac", + x"000003c8", x"00001ffc", - x"000004ac", + x"000003c8", x"00001ffc", - x"0000124e", - x"0000122e", - x"0000124e", - x"0000122e", - x"0000122e", - x"0000125e", - x"0000125e", - x"0000123e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"000011f0", - x"00001206", - x"00001222", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", - x"0000122e", + x"0000116a", + x"0000114a", + x"0000116a", + x"0000114a", + x"0000114a", + x"0000117a", + x"0000117a", + x"0000115a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000110c", + x"00001122", + x"0000113e", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", + x"0000114a", x"d1012142", x"000b0009", x"abcd0000", @@ -85,7 +85,7 @@ package bootrom is x"60804f26", x"6af669f6", x"000b68f6", - x"0000155c", + x"00001478", x"2f869223", x"d1124f22", x"21227ffc", @@ -108,8 +108,8 @@ package bootrom is x"00c00009", x"abcd0000", x"0000010c", - x"00001638", - x"00001644", + x"00001554", + x"00001560", x"92317ffc", x"d1182122", x"e1002f12", @@ -150,7 +150,7 @@ package bootrom is x"73fce000", x"8068d001", x"000b68f6", - x"00001ac8", + x"000019d8", x"d1036012", x"c8018bfc", x"d1012142", @@ -208,94 +208,37 @@ package bootrom is x"4f266bf6", x"6af669f6", x"412b68f6", - x"0000165c", + x"0000156c", x"00000244", - x"2f862f96", - x"2fa6d84b", - x"918bd04b", - x"4f222812", - x"400b7ffc", - x"9186e600", - x"e5032812", - x"d847d448", - x"480b0009", - x"88ff8f0f", - x"e601d445", - x"480be503", - x"88ff8f0c", - x"e602d442", - x"480be503", - x"88ff8d07", - x"e8509870", - x"a005e100", - x"986ea002", - x"e100986c", - x"e100d93c", - x"9a6a2f12", - x"60f2019c", - x"611c31a0", - x"890960f2", - x"d138049c", - x"410b644c", - x"61f27101", - x"2f12aff1", - x"0009d135", - x"d435410b", - x"e907e100", - x"da342f12", - x"61f23197", - x"8d19e100", - x"66f2e101", - x"67f26413", - x"62f27708", - x"447d63f2", - x"72106713", - x"472d6213", - x"426d247b", - x"242b6233", - x"7218412d", - x"4a0b241b", - x"61f27101", - x"2f12afe3", - x"00099236", - x"2f1261f2", - x"31278904", - x"61f27101", - x"2f12aff8", - x"0009d118", - x"922b2182", - x"e1002f12", + x"7ffce100", + x"92322f12", + x"61f23127", + x"890461f2", + x"71012f12", + x"aff80009", + x"d115e250", + x"2122e100", + x"92242f12", x"61f23127", x"8d05e700", x"61f27101", x"2f12aff7", - x"0009d111", - x"921ed619", - x"21222f72", - x"63f23367", - x"890463f2", - x"73012f32", - x"aff80009", - x"21822f72", - x"63f23367", - x"890463f2", - x"73012f32", - x"aff80009", - x"2122afea", - x"000900c0", - x"00e100e4", - x"00e200e3", - x"00ff031f", - x"00aa0009", + x"0009d10e", + x"9219e550", + x"d60d2122", + x"2f7263f2", + x"33678904", + x"63f27301", + x"2f32aff8", + x"00092152", + x"2f7263f2", + x"33678904", + x"63f27301", + x"2f32aff8", + x"00092122", + x"afea0009", + x"031f00aa", x"abcd0000", - x"000015bc", - x"00000570", - x"10000000", - x"000018d8", - x"00000258", - x"0000010c", - x"00001650", - x"00000244", x"00124f7f", x"d027d124", x"2102d327", @@ -330,26 +273,26 @@ package bootrom is x"d002400b", x"0009c320", x"00090009", - x"00000564", - x"00000a5c", - x"0000048c", - x"0000049a", + x"00000480", + x"00000978", + x"000003a8", + x"000003b6", x"abcd0000", x"000000ff", x"0000004f", x"00000011", - x"000004ba", + x"000003d6", x"d1042f86", x"684c4f22", x"410b6483", x"60834f26", x"000b68f6", - x"0000155c", + x"00001478", x"d0034f22", x"400b0009", x"4f26000b", x"00090009", - x"00001574", + x"00001490", x"000b0009", x"d101412b", x"00090009", @@ -440,11 +383,11 @@ package bootrom is x"6bf66af6", x"69f6000b", x"68f60009", - x"00001628", - x"0000183c", - x"0000190c", - x"00001900", - x"000018e8", + x"00001544", + x"0000174c", + x"0000181c", + x"00001810", + x"000017f8", x"614c6213", x"729f622c", x"e3053236", @@ -475,7 +418,7 @@ package bootrom is x"6bf66af6", x"69f6000b", x"68f60009", - x"000006dc", + x"000005f8", x"2f86e000", x"2f96e903", x"2fa62fb6", @@ -519,7 +462,7 @@ package bootrom is x"6bf66af6", x"69f6000b", x"68f60009", - x"0000189c", + x"000017ac", x"2f86e800", x"2f966953", x"2fa66a53", @@ -534,7 +477,7 @@ package bootrom is x"6bf66af6", x"69f6000b", x"68f60009", - x"00000534", + x"00000450", x"2f862f96", x"2fa66a43", x"2fb62fc6", @@ -563,10 +506,10 @@ package bootrom is x"6bf66af6", x"69f6000b", x"68f60009", - x"00000534", - x"00000808", - x"0000189c", - x"0000054c", + x"00000450", + x"00000724", + x"000017ac", + x"00000468", x"2f862f96", x"2fa62fb6", x"6b632fc6", @@ -629,8 +572,8 @@ package bootrom is x"6cf66bf6", x"6af669f6", x"000b68f6", - x"000006dc", - x"00001558", + x"000005f8", + x"00001474", x"2f862f96", x"2fa66a53", x"2fb62fc6", @@ -665,10 +608,10 @@ package bootrom is x"6bf66af6", x"69f6000b", x"68f60009", - x"00000534", - x"00000808", - x"00001848", - x"0000189c", + x"00000450", + x"00000724", + x"00001758", + x"000017ac", x"2f862f96", x"2fa62fb6", x"2fc62fd6", @@ -854,23 +797,23 @@ package bootrom is x"1f75490b", x"1f16afe5", x"56f60009", - x"000014f8", - x"000006dc", - x"0000054c", - x"00000534", - x"00000844", - x"00001854", - x"000012b0", - x"00000714", - x"000008c4", - x"00001404", - x"00000758", - x"00000808", - x"0000184c", - x"0000189c", - x"000014e0", - x"00001474", - x"000012b0", + x"00001414", + x"000005f8", + x"00000468", + x"00000450", + x"00000760", + x"00001764", + x"000011cc", + x"00000630", + x"000007e0", + x"00001320", + x"00000674", + x"00000724", + x"0000175c", + x"000017ac", + x"000013fc", + x"00001390", + x"000011cc", x"1fc77a01", x"e90064a4", x"6043883d", @@ -960,16 +903,16 @@ package bootrom is x"6bf66af6", x"69f6000b", x"68f60009", - x"00001404", - x"000008c4", + x"00001320", + x"000007e0", + x"00001390", + x"00000760", + x"00001768", + x"00001568", + x"00000630", + x"000011d8", x"00001474", - x"00000844", - x"00001858", - x"0000164c", - x"00000714", - x"000012bc", - x"00001558", - x"00001854", + x"00001764", x"2f862448", x"2f962fa6", x"2fb62fc6", @@ -1037,15 +980,15 @@ package bootrom is x"6bf66af6", x"69f6000b", x"68f60009", - x"00000534", - x"00000808", - x"000018c4", - x"000018b0", - x"00000758", - x"0000186c", - x"00001870", - x"0000189c", - x"00000a5c", + x"00000450", + x"00000724", + x"000017d4", + x"000017c0", + x"00000674", + x"0000177c", + x"00001780", + x"000017ac", + x"00000978", x"2f866043", x"2f964009", x"2fa64009", @@ -1129,12 +1072,12 @@ package bootrom is x"6cf66bf6", x"6af669f6", x"000b68f6", - x"00000534", - x"0000189c", - x"00001404", - x"0000054c", - x"00000a5c", - x"0000126e", + x"00000450", + x"000017ac", + x"00001320", + x"00000468", + x"00000978", + x"0000118a", x"d01151f4", x"201251f3", x"201661f3", @@ -1152,8 +1095,8 @@ package bootrom is x"40134022", x"d00164f2", x"400b0009", - x"00001040", - x"000019c4", + x"00000f5c", + x"000018d4", x"2f062f16", x"e0f0400e", x"e0052f06", @@ -1201,7 +1144,7 @@ package bootrom is x"70c05101", x"6002002b", x"00090009", - x"0000196c", + x"0000187c", x"ef046ff2", x"e0006002", x"402b0009", @@ -1274,19 +1217,19 @@ package bootrom is x"f80007ff", x"402b400b", x"c3200009", - x"000019ac", + x"000018bc", x"0000fb00", x"00008900", x"00008b00", x"0000f000", x"0000a000", x"0000f0ff", - x"0000196c", + x"0000187c", x"0000b000", x"0000ff00", x"0000c300", - x"00001ad2", - x"0000126e", + x"000019e2", + x"0000118a", x"e1163416", x"8d2de000", x"6243c702", @@ -1313,8 +1256,8 @@ package bootrom is x"5116e004", x"2512000b", x"00090009", - x"0000196c", - x"000019ac", + x"0000187c", + x"000018bc", x"e1163416", x"8d2ce000", x"6243c702", @@ -1340,25 +1283,25 @@ package bootrom is x"1154d103", x"1156e004", x"000b0009", - x"0000196c", - x"000019ac", + x"0000187c", + x"000018bc", x"24488901", x"d1021145", x"d102412b", x"00090009", - x"000019ac", - x"0000126e", + x"000018bc", + x"0000118a", x"d1056211", x"22288904", x"d3045335", x"2321e200", x"2121000b", x"00090009", - x"00001ad2", - x"000019ac", + x"000019e2", + x"000018bc", x"d001402b", x"00090009", - x"00000f10", + x"00000e2c", x"d2096122", x"21188d03", x"e33271ff", @@ -1369,8 +1312,8 @@ package bootrom is x"91032212", x"2312000b", x"00090088", - x"00001918", - x"00001968", + x"00001828", + x"00001878", x"abcd0000", x"000b0009", x"d104644c", @@ -1391,8 +1334,8 @@ package bootrom is x"64036083", x"4f26000b", x"68f60009", - x"00001574", - x"0000155c", + x"00001490", + x"00001478", x"d102e202", x"1123000b", x"00090009", @@ -1434,9 +1377,6 @@ package bootrom is x"20646574", x"6563740a", x"00000000", - x"4c434420", - x"696e6974", - x"0a000000", x"00000000", x"0000005f", x"00000007", @@ -1591,11 +1531,11 @@ package bootrom is x"00000006", x"00000007", x"00000007", - x"00001874", - x"0000187c", - x"00001884", - x"0000188c", - x"00001894", + x"00001784", + x"0000178c", + x"00001794", + x"0000179c", + x"000017a4", x"40a1c0a6", x"a22ff800", x"23811fac", @@ -1619,17 +1559,17 @@ package bootrom is x"616e6765", x"7365743a", x"20202032", - x"313a3362", - x"30613139", - x"39653735", - x"39310a62", + x"333a6361", + x"62633432", + x"37323264", + x"36630a62", x"75696c64", - x"3a204d6f", - x"6e204d61", - x"72203235", - x"2031383a", - x"33313a30", - x"31204544", + x"3a205765", + x"64204d61", + x"72203237", + x"2032303a", + x"32313a34", + x"34204544", x"54203230", x"31390a00", others => x"00000000" ); diff --git a/testrom/main_up5k_42s.c b/testrom/main_up5k_42s.c index d287753..3abcf28 100644 --- a/testrom/main_up5k_42s.c +++ b/testrom/main_up5k_42s.c @@ -124,6 +124,7 @@ main_sh (void) { volatile int i; unsigned int stat = 0x50; +#if 0 KEYPORT = KEY_PRECHARGE; @@ -147,7 +148,6 @@ main_sh (void) for (i=0; lcd_init[i] != 0xff; i++) lcd_inst(lcd_init[i]); putstr ("LCD init\n"); -#if 0 lcd_loc(0, 1); lcd_puts("Hit a Key!"); @@ -162,7 +162,6 @@ main_sh (void) #if 0 lcd_loc(0, 0); lcd_puts(hex(0x123ab678)); -#endif for (i=0; i<8; i++) { lcd_data( (1<<(i+0 )) | @@ -170,6 +169,7 @@ main_sh (void) (1<<(i+16)) | (1<<(i+24))); } +#endif for (i=0; i<800; i++) {} led(stat); for (i=0; i<800; i++) {} diff --git a/up5k.pcf b/up5k.pcf deleted file mode 100644 index 579f6d0..0000000 --- a/up5k.pcf +++ /dev/null @@ -1,18 +0,0 @@ - -#set_io led[0] 39 -#set_io led[1] 40 -#set_io led[2] 41 -#set_io led[3] 44 -#set_io led[4] 45 -#set_io led[5] 46 -#set_io led[6] 47 -#set_io led[7] 48 - -set_io led[0] 26 -set_io led[1] 27 -set_io led[2] 32 -set_io led[3] 35 -set_io led[4] 31 -set_io led[5] 37 -set_io led[6] 34 -set_io led[7] 43 diff --git a/upduino2.pcf b/upduino2.pcf new file mode 100644 index 0000000..daef512 --- /dev/null +++ b/upduino2.pcf @@ -0,0 +1,9 @@ + +set_io led[0] 26 +set_io led[1] 27 +set_io led[2] 32 +set_io led[3] 35 +set_io led[4] 31 +set_io led[5] 37 +set_io led[6] 34 +set_io led[7] 43