Permalink
Browse files

Fixed for boot up issues

  • Loading branch information...
1 parent 185aebc commit a8c6b214c739378c97f407630bf2e82493785065 Brad Robinson committed Sep 20, 2012
Showing with 69 additions and 92 deletions.
  1. +6 −52 cpu/moxielite.sublime-workspace
  2. +13 −4 cpu/moxielite.vhd
  3. +4 −0 cpu/moxielite_package.vhd
  4. +46 −36 ctest/ctest.sublime-workspace
@@ -309,17 +309,6 @@
]
]
},
- "buffers":
- [
- {
- "file": "makefile",
- "settings":
- {
- "buffer_size": 1364,
- "line_ending": "Windows"
- }
- }
- ],
"build_system": "Packages/VHDL/Xilinx Makefile.sublime-build",
"command_palette":
{
@@ -580,6 +569,11 @@
"case_sensitive": false,
"find_history":
[
+ "jsr",
+ "sp_plus_offset",
+ "jsr",
+ "BIG_END",
+ "big_end",
"pc_plus_oper",
"brk",
"BIG_END",
@@ -702,12 +696,7 @@
"st_l",
"ptr_base",
"decoder",
- "memptr_load",
- "ldo",
- "wr_h",
- "sta_",
- "execute_store",
- "ldi_l"
+ "memptr_load"
],
"highlight": true,
"in_selection": false,
@@ -809,41 +798,6 @@
"whole_word": false,
"wrap": true
},
- "groups":
- [
- {
- "selected": 0,
- "sheets":
- [
- {
- "buffer": 0,
- "file": "makefile",
- "settings":
- {
- "buffer_size": 1364,
- "regions":
- {
- },
- "selection":
- [
- [
- 1230,
- 1268
- ]
- ],
- "settings":
- {
- "syntax": "Packages/Makefile/Makefile.tmLanguage"
- },
- "translation.x": 0.0,
- "translation.y": 575.0,
- "zoom_level": 1.0
- },
- "type": "text"
- }
- ]
- }
- ],
"incremental_find":
{
"height": 0.0
View
@@ -32,7 +32,7 @@ ARCHITECTURE behavior OF moxielite IS
signal reset : std_logic;
-- Program counter
- signal PC : std_logic_vector(31 downto 0);
+ signal PC : std_logic_vector(31 downto 0) := BOOT_ADDRESS;
signal PC_plus_2 : std_logic_vector(31 downto 0);
signal PC_plus_operand_A : std_logic_vector(31 downto 0);
@@ -57,14 +57,14 @@ ARCHITECTURE behavior OF moxielite IS
-- Instruction decode
signal instruction : std_logic_vector(15 downto 0);
- signal execute_state : state_type;
+ signal execute_state : state_reset;
signal aluop : aluop_type;
signal condition : condition_type;
signal addrmode : addrmode_type;
signal instruction_form : instruction_form_type;
-- State machine
- signal state : state_type;
+ signal state : state_type := state_fetch_pre;
signal state_next : state_type;
signal state_resolved : state_type;
signal has_imm : std_logic;
@@ -574,7 +574,7 @@ BEGIN
if reset_n='0' then
PC <= BOOT_ADDRESS;
- state <= state_fetch_pre;
+ state <= state_reset;
addr_reg <= (others => '0');
data_reg <= (others => '0');
data_byte_index <= (others => '0');
@@ -595,6 +595,15 @@ BEGIN
-- Handle state
case state_resolved is
+ when state_reset =>
+ state <= state_reset_1;
+
+ when state_reset_1 =>
+ state <= state_reset_2
+
+ when state_reset_2 =>
+ state <= state_fetch_pre;
+
when state_fetch_pre =>
state <= state_fetch_memcycle;
@@ -40,6 +40,10 @@ type aluop_type is
type state_type is
(
+ state_reset,
+ state_reset_1,
+ state_reset_2,
+
-- Instruction fetch stage
state_fetch_pre,
state_fetch_memcycle,
@@ -4,6 +4,10 @@
"selected_items":
[
[
+ "port_led",
+ "port_leds_7seg"
+ ],
+ [
"cpu",
"cpu_wr_h_n"
],
@@ -312,10 +316,18 @@
"build_system": "Packages/Makefile/Make.sublime-build",
"command_palette":
{
- "height": 392.0,
+ "height": 81.0,
"selected_items":
[
[
+ "clean",
+ "Build: Clean"
+ ],
+ [
+ "clea",
+ "Build: Clean"
+ ],
+ [
"ent",
"VHDL: Paste Entity Instance"
],
@@ -360,10 +372,6 @@
"Build: Core Generator"
],
[
- "clea",
- "Build: Clean"
- ],
- [
"run",
"Build: Run"
],
@@ -421,10 +429,27 @@
},
"file_history":
[
+ "/C/Users/bradr/dev/fpga/moxie/ctest/threading.c",
+ "/C/Users/bradr/dev/fpga/.git/modules",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/startup.s",
+ "/C/Users/bradr/dev/fpga/moxie/ToolChain/moxie-elf/lib/ldscripts/elf32moxie.x",
+ "/C/Users/bradr/dev/fpga/moxie/ToolChain/moxie-elf/lib/moxie-elf-common.ld",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/main.c",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/build/ctest.map",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/moxie-elf-embedded.ld",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/makefile",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/makemakefile",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/threading.c: makefile",
+ "/cygdrive/z/gcc/newlib/src/newlib/libc/stdlib/exit.c",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/.gitignore",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/build/ctest.bin",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/main.s",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/main.i",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/build/ctest.elf.dis",
+ "/C/Users/bradr/dev/fpga/moxie/ctest/build/ctest.elf",
"/C/Users/bradr/AppData/Roaming/Sublime Text 2/Packages/Makefile/Make.sublime-build",
"/C/Users/bradr/AppData/Roaming/Sublime Text 2/Packages/Makefile/Cygwin Makefile.sublime-build",
"/C/Users/bradr/AppData/Roaming/Sublime Text 2/Packages/Makefile/NMake.sublime-build",
- "/C/Users/bradr/dev/fpga/moxie/ctest/main.c",
"/C/Users/bradr/dev/fpga/moxie/cpu/rom.elf.dis",
"/C/Users/bradr/dev/fpga/moxie/cpu/rom.s",
"/C/Users/bradr/dev/fpga/moxie/cpu/moxielite_alu.vhd",
@@ -531,24 +556,7 @@
"/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/cpu86/proc_rtl.vhd",
"/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/cpu86/regshiftmux_regshift.vhd",
"/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/cpu86/segregfile_rtl.vhd",
- "/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/cpu86/alu_rtl.vhd",
- "/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/cpu86/biu_struct.vhd",
- "/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/cpu86bench.vhd",
- "/C/Users/bradr/dev/fpga/Nexys3/zet/cores/zet/rtl/rom_def.v",
- "/C/Users/bradr/dev/fpga/Nexys3/zet/cores/zet/rtl/micro_rom.dat",
- "/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/.gitignore",
- "/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/urep_cpu86",
- "/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/urep_z80",
- "/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/ERROR:HDLCompiler",
- "/Z/FPGA/cpu86bench/PeripheralController.vhd",
- "/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/PeripheralController.vhd",
- "/C/Users/bradr/AppData/Roaming/Sublime Text 2/Packages/User/Preferences.sublime-settings",
- "/C/Users/bradr/AppData/Roaming/Sublime Text 2/Packages/Default/Preferences.sublime-settings",
- "/Z/FPGA/cpu86bench/ipcore_dir/coregen.cgc",
- "/Z/FPGA/cpu86bench/cpu86bench.vhd",
- "/Z/FPGA/cpu86bench/Crtc6545.vhd",
- "/Z/FPGA/cpu86bench/ipcore_dir/.gitignore",
- "/C/Users/bradr/AppData/Roaming/Sublime Text 2/Packages/VHDL/VhdlUtils.sublime-commands"
+ "/C/Users/bradr/dev/fpga/Nexys3/cpu86bench/cpu86/alu_rtl.vhd"
],
"find":
{
@@ -569,6 +577,17 @@
"case_sensitive": false,
"find_history":
[
+ "g_exit_sp",
+ "g_pFirst",
+ "\\n\\t\\",
+ "99",
+ "ports",
+ ":",
+ "dma",
+ " - ",
+ "strcpu",
+ "libc",
+ "78",
"pc_plus_oper",
"brk",
"BIG_END",
@@ -685,25 +704,16 @@
"state_deref",
"deref",
"data_reg",
- "din",
- "ptr_size",
- "ptrsize",
- "st_l",
- "ptr_base",
- "decoder",
- "memptr_load",
- "ldo",
- "wr_h",
- "sta_",
- "execute_store",
- "ldi_l"
+ "din"
],
"highlight": true,
"in_selection": false,
"preserve_case": true,
"regex": false,
"replace_history":
[
+ "\\n\\",
+ "",
"mem_16",
"mem_15",
"mem_14",

1 comment on commit a8c6b21

@atgreen
Collaborator

Did this fix the intermittent hard reset issue you mentioned?

Please sign in to comment.