diff --git a/Common/sim/ModelSim SE .lnk b/Common/sim/ModelSim SE .lnk
deleted file mode 100644
index ecadd02..0000000
Binary files a/Common/sim/ModelSim SE .lnk and /dev/null differ
diff --git a/Common/sim/compile_fixed.do b/Common/sim/compile_fixed.do
deleted file mode 100644
index 0c17180..0000000
--- a/Common/sim/compile_fixed.do
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Compile script for Modeltech
-#
-vlib ieee_proposed
-vmap ieee_proposedx ieee_proposed
-vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/standard_additions_c.vhdl"
-vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/env_c.vhdl"
-vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/standard_textio_additions_c.vhdl"
-vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/std_logic_1164_additions.vhdl"
-vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/numeric_std_additions.vhdl"
-vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/numeric_std_unsigned_c.vhdl"
-vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/math_utility_pkg_c.vhdl"
-vcom -work ieee_proposed -93 "../../lib/fixed/modelsim/fixed_pkg_c.vhdl"
diff --git a/Common/sim/compile_simprim.do b/Common/sim/compile_simprim.do
deleted file mode 100644
index 9f7ba37..0000000
--- a/Common/sim/compile_simprim.do
+++ /dev/null
@@ -1,8 +0,0 @@
-vlib simprim
-
-set XILINX $env(XILINX)
-
-vcom -93 -work simprim $XILINX/vhdl/src/simprims/simprim_Vcomponents_mti.vhd
-vcom -93 -work simprim $XILINX/vhdl/src/simprims/simprim_Vpackage_mti.vhd
-vcom -93 -work simprim $XILINX/vhdl/src/simprims/simprim_SMODEL_mti.vhd
-vcom -93 -work simprim $XILINX/vhdl/src/simprims/simprim_VITAL_mti.vhd
diff --git a/Common/sim/compile_unisim.do b/Common/sim/compile_unisim.do
deleted file mode 100644
index 4aec199..0000000
--- a/Common/sim/compile_unisim.do
+++ /dev/null
@@ -1,8 +0,0 @@
-vlib unisim
-
-set XILINX $env(XILINX)
-
-vcom -93 -work unisim $XILINX/vhdl/src/unisims/unisim_vpkg.vhd
-vcom -93 -work unisim $XILINX/vhdl/src/unisims/unisim_vcomp.vhd
-vcom -93 -work unisim $XILINX/vhdl/src/unisims/unisim_smodel.vhd
-vcom -93 -work unisim $XILINX/vhdl/src/unisims/unisim_vital.vhd
diff --git a/Common/ucf/ml402.ucf b/Common/ucf/ml402.ucf
deleted file mode 100644
index 318e778..0000000
--- a/Common/ucf/ml402.ucf
+++ /dev/null
@@ -1,675 +0,0 @@
-#
-# XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
-# SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR
-# XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION
-# AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION
-# OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS
-# IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,
-# AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE
-# FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY
-# WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE
-# IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
-# REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF
-# INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-# (c) Copyright 2005 Xilinx, Inc.
-# All rights reserved.
-#
-
-# Bus clock nets
-NET "sys_clk" TNM_NET = "sys_clk";
-NET "tft_clk" TNM_NET = "tft_clk";
-NET sys_clk_in TNM_NET = "sys_clk_in";
-TIMESPEC "TSSYSCLK" = PERIOD "sys_clk_in" 9.9 ns HIGH 50 %;
-
-NET sys_clk_in LOC = AE14;
-NET sys_clk_in IOSTANDARD = LVCMOS33;
-NET sys_rst_in LOC = D6;
-NET sys_rst_in PULLUP;
-NET sys_rst_in TIG;
-
-NET uart_RX LOC = W2;
-NET uart_RX IOSTANDARD = LVCMOS33;
-NET uart_RX TIG;
-NET uart_TX LOC = W1;
-NET uart_TX IOSTANDARD = LVCMOS33;
-NET uart_TX TIG;
-
-NET ext_irq TIG;
-
-# Reset timing ignore - treat as async paths
-NET sys_rst TIG;
-NET opb_v20_0_OPB_Rst TIG;
-NET lmb_v10_1_OPB_Rst TIG;
-NET lmb_v10_0_OPB_Rst TIG;
-NET opb_v20_0_Debug_SYS_Rst TIG;
-NET Debug_Rst TIG;
-NET plb_v34_0_PLB_Rst TIG;
-NET dcm_locked TIG;
-
-# Locate DCM/BUFG - Tools can probably figure them out automatically
-# but just LOC them down to be safe
-INST dcm_0/dcm_0/DCM_ADV_INST LOC = DCM_ADV_X0Y2;
-INST dcm_1/dcm_1/DCM_ADV_INST LOC = DCM_ADV_X0Y4;
-INST dcm_2/dcm_2/DCM_ADV_INST LOC = DCM_ADV_X0Y1;
-
-INST dcm_0/dcm_0/CLK0_BUFG_INST LOC = BUFGCTRL_X0Y0;
-INST dcm_0/dcm_0/CLK90_BUFG_INST LOC = BUFGCTRL_X0Y1;
-INST dcm_0/dcm_0/CLKDV_BUFG_INST LOC = BUFGCTRL_X0Y2;
-
-INST dcm_1/dcm_1/CLK0_BUFG_INST LOC = BUFGCTRL_X0Y31;
-INST dcm_1/dcm_1/CLK90_BUFG_INST LOC = BUFGCTRL_X0Y30;
-
-////////////////////////////////////////////////////////////////////////////
-// Buttons, LEDs, and DIP Switches
-////////////////////////////////////////////////////////////////////////////
-
-# GPLED 0-3
-NET gpio<0> LOC = G5; #GPLED0
-NET gpio<1> LOC = G6; #GPLED1
-NET gpio<2> LOC = A11; #GPLED2
-NET gpio<3> LOC = A12; #GPLED3
-# North-East-South-West-Center LEDs
-NET gpio<4> LOC = C6; # C LED
-NET gpio<5> LOC = F9; # W LED
-NET gpio<6> LOC = A5; # S LED
-NET gpio<7> LOC = E10; # E LED
-NET gpio<8> LOC = E2; # N LED
-# North-East-South-West-Center Buttons
-NET gpio<9> LOC = B6; # C Button
-NET gpio<10> LOC = E9; # W Button
-NET gpio<11> LOC = A6; # S Button
-NET gpio<12> LOC = F10; # E Button
-NET gpio<13> LOC = E7; # N Button
-# Dip Switches 1-8
-NET gpio<14> LOC = U24; # DIP SW 8
-NET gpio<15> LOC = U25; # DIP SW 7
-NET gpio<16> LOC = V23; # DIP SW 6
-NET gpio<17> LOC = U23; # DIP SW 5
-NET gpio<18> LOC = U26; # DIP SW 4
-NET gpio<19> LOC = T26; # DIP SW 3
-NET gpio<20> LOC = R19; # DIP SW 2
-NET gpio<21> LOC = R20; # DIP SW 1
-NET gpio<14> IOSTANDARD = LVCMOS33;
-NET gpio<15> IOSTANDARD = LVCMOS33;
-NET gpio<16> IOSTANDARD = LVCMOS33;
-NET gpio<17> IOSTANDARD = LVCMOS33;
-NET gpio<18> IOSTANDARD = LVCMOS33;
-NET gpio<19> IOSTANDARD = LVCMOS33;
-NET gpio<20> IOSTANDARD = LVCMOS33;
-NET gpio<21> IOSTANDARD = LVCMOS33;
-#SMA Connectors
-NET gpio<22> LOC = C12; # SMA_IN_N
-NET gpio<23> LOC = C13; # SMA_IN_P
-NET gpio<24> LOC = D7; # SMA_OUT_N
-NET gpio<25> LOC = D8; # SMA_OUT_P
-NET gpio<26> LOC = AD12;# USERCLK
-NET gpio<26> IOSTANDARD = LVCMOS33;
-
-NET "gpio<*>" PULLDOWN;
-NET "gpio<*>" TIG;
-NET "gpio<*>" SLEW = SLOW;
-NET "gpio<*>" DRIVE = 2;
-
-NET "gpio<22>" SLEW = FAST;
-NET "gpio<22>" DRIVE = 12;
-NET "gpio<23>" SLEW = FAST;
-NET "gpio<23>" DRIVE = 12;
-NET "gpio<24>" SLEW = FAST;
-NET "gpio<24>" DRIVE = 12;
-NET "gpio<25>" SLEW = FAST;
-NET "gpio<25>" DRIVE = 12;
-
-NET "gpio2_d_out<*>" TIG;
-NET "gpio2_t_out<*>" TIG;
-NET "gpio2_in<*>" TIG;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for PS/2 Ports
-#------------------------------------------------------------------------------
-
-#Keyboard
-NET ps2_keyb_clk LOC = D2;
-NET ps2_keyb_clk SLEW = SLOW;
-NET ps2_keyb_clk DRIVE = 2;
-NET ps2_keyb_clk TIG;
-NET ps2_keyb_data LOC = G9;
-NET ps2_keyb_data SLEW = SLOW;
-NET ps2_keyb_data DRIVE = 2;
-NET ps2_keyb_data TIG;
-
-#Mouse
-NET ps2_mouse_clk LOC = B14;
-NET ps2_mouse_clk SLEW = SLOW;
-NET ps2_mouse_clk DRIVE = 2;
-NET ps2_mouse_clk TIG;
-NET ps2_mouse_data LOC = C14;
-NET ps2_mouse_data SLEW = SLOW;
-NET ps2_mouse_data DRIVE = 2;
-NET ps2_mouse_data TIG;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for IIC Controller
-#------------------------------------------------------------------------------
-
-NET iic_scl LOC = A17;
-NET iic_sda LOC = B17;
-NET iic_scl SLEW = SLOW;
-NET iic_scl DRIVE = 6;
-NET iic_scl TIG;
-NET iic_sda SLEW = SLOW;
-NET iic_sda DRIVE = 6;
-NET iic_sda TIG;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for AC97 Sound Controller
-#------------------------------------------------------------------------------
-
-NET ac97_bit_clk LOC = AE10;
-NET ac97_bit_clk IOSTANDARD = LVCMOS33;
-NET ac97_bit_clk PERIOD = 80;
-NET ac97_sdata_in LOC = AD16;
-NET ac97_sdata_in IOSTANDARD = LVCMOS33;
-NET ac97_reset_n LOC = AD10;
-NET ac97_reset_n IOSTANDARD = LVCMOS33;
-NET ac97_reset_n TIG;
-NET ac97_sdata_out LOC = C8;
-NET ac97_sync LOC = D9;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for System ACE MPU / USB
-#------------------------------------------------------------------------------
-
-NET sysace_clk_in LOC = AF11;
-NET sysace_clk_in IOSTANDARD = LVCMOS33;
-NET sysace_clk_in TNM_NET = "sysace_clk_in";
-# Leave 1 ns margin
-TIMESPEC "TSSYSACE" = PERIOD "sysace_clk_in" 29 ns;
-
-NET sace_usb_a<0> LOC = U22;
-NET sace_usb_a<1> LOC = Y10;
-NET sace_usb_a<2> LOC = AA10;
-NET sace_usb_a<3> LOC = AC7;
-NET sace_usb_a<4> LOC = Y7;
-NET sace_usb_a<5> LOC = AA9;
-NET sace_usb_a<6> LOC = Y9;
-NET sace_usb_a<*> IOSTANDARD = LVCMOS33;
-NET sace_usb_a<*> SLEW = FAST;
-NET sace_usb_a<*> DRIVE = 8;
-NET sace_mpce LOC = AD5;
-NET sace_mpce IOSTANDARD = LVCMOS33;
-NET sace_mpce SLEW = FAST;
-NET sace_mpce DRIVE = 8;
-NET sace_usb_d<0> LOC = AB7;
-NET sace_usb_d<1> LOC = AC9;
-NET sace_usb_d<2> LOC = AB9;
-NET sace_usb_d<3> LOC = AE6;
-NET sace_usb_d<4> LOC = AD6;
-NET sace_usb_d<5> LOC = AF9;
-NET sace_usb_d<6> LOC = AE9;
-NET sace_usb_d<7> LOC = AD8;
-NET sace_usb_d<8> LOC = AC8;
-NET sace_usb_d<9> LOC = AF4;
-NET sace_usb_d<10> LOC = AE4;
-NET sace_usb_d<11> LOC = AD3;
-NET sace_usb_d<12> LOC = AC3;
-NET sace_usb_d<13> LOC = AF6;
-NET sace_usb_d<14> LOC = AF5;
-NET sace_usb_d<15> LOC = AA7;
-NET sace_usb_d<*> IOSTANDARD = LVCMOS33;
-NET sace_usb_d<*> SLEW = FAST;
-NET sace_usb_d<*> DRIVE = 8;
-NET sace_usb_d<*> PULLDOWN;
-NET sace_usb_oen LOC = AA8;
-NET sace_usb_oen IOSTANDARD = LVCMOS33;
-NET sace_usb_oen SLEW = FAST;
-NET sace_usb_oen DRIVE = 8;
-NET sace_usb_wen LOC = Y8;
-NET sace_usb_wen IOSTANDARD = LVCMOS33;
-NET sace_usb_wen SLEW = FAST;
-NET sace_usb_wen DRIVE = 8;
-NET sysace_mpirq LOC = AD4;
-NET sysace_mpirq IOSTANDARD = LVCMOS33;
-NET sysace_mpirq TIG;
-NET sysace_mpirq PULLDOWN;
-
-NET usb_csn LOC = AF10;
-NET usb_csn IOSTANDARD = LVCMOS33;
-NET usb_csn SLEW = FAST;
-NET usb_csn DRIVE = 8;
-NET usb_hpi_reset_n LOC = A7;
-NET usb_hpi_reset_n IOSTANDARD = LVCMOS25;
-NET usb_hpi_reset_n TIG;
-NET usb_hpi_int LOC = V5;
-NET usb_hpi_int IOSTANDARD = LVCMOS33;
-NET usb_hpi_int TIG;
-NET usb_hpi_int PULLDOWN;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for DDR Controllers
-#------------------------------------------------------------------------------
-
-NET ddr_ad<0> LOC = C26; # DDR_A0
-NET ddr_ad<1> LOC = E17; # DDR_A1
-NET ddr_ad<2> LOC = D18; # DDR_A2
-NET ddr_ad<3> LOC = C19; # DDR_A3
-NET ddr_ad<4> LOC = F17; # DDR_A4
-NET ddr_ad<5> LOC = B18; # DDR_A5
-NET ddr_ad<6> LOC = B20; # DDR_A6
-NET ddr_ad<7> LOC = C20; # DDR_A7
-NET ddr_ad<8> LOC = D20; # DDR_A8
-NET ddr_ad<9> LOC = C21; # DDR_A9
-NET ddr_ad<10> LOC = A18; # DDR_A10
-NET ddr_ad<11> LOC = B21; # DDR_A11
-NET ddr_ad<12> LOC = A24; # DDR_A12
-NET ddr_ba<0> LOC = B12; # DDR_BA0
-NET ddr_ba<1> LOC = A16; # DDR_BA1
-NET ddr_casb LOC = F23; # DDR_CAS_N
-NET ddr_cke LOC = G22; # DDR_CKE
-NET ddr_csb LOC = G21; # DDR_CS_N
-NET ddr_rasb LOC = F24; # DDR_RAS_N
-NET ddr_web LOC = A23; # DDR_WE_N
-
-NET ddr_clk LOC = A10; # DDR_CK1_P
-NET ddr_clk_fb LOC = B13; # DDR_CK1_P (FEEDBACK)
-NET ddr_clkb LOC = B10; # DDR_CK1_N
-
-NET ddr_dm<0> LOC = G19; # DDR_DM0
-NET ddr_dm<1> LOC = G24; # DDR_DM1
-NET ddr_dm<2> LOC = G20; # DDR_DM2
-NET ddr_dm<3> LOC = C22; # DDR_DM3
-
-NET ddr_dqs<0> LOC = D25; # DDR_DQS0
-NET ddr_dqs<1> LOC = G18; # DDR_DQS1
-NET ddr_dqs<2> LOC = G17; # DDR_DQS2
-NET ddr_dqs<3> LOC = D26; # DDR_DQS3
-
-NET ddr_dq<0> LOC = H20; # DDR_D0
-NET ddr_dq<1> LOC = E23; # DDR_D1
-NET ddr_dq<2> LOC = H26; # DDR_D2
-NET ddr_dq<3> LOC = H22; # DDR_D3
-NET ddr_dq<4> LOC = E25; # DDR_D4
-NET ddr_dq<5> LOC = E26; # DDR_D5
-NET ddr_dq<6> LOC = F26; # DDR_D6
-NET ddr_dq<7> LOC = E24; # DDR_D7
-NET ddr_dq<8> LOC = E20; # DDR_D8
-NET ddr_dq<9> LOC = A22; # DDR_D9
-NET ddr_dq<10> LOC = C23; # DDR_D10
-NET ddr_dq<11> LOC = C24; # DDR_D11
-NET ddr_dq<12> LOC = A20; # DDR_D12
-NET ddr_dq<13> LOC = A21; # DDR_D13
-NET ddr_dq<14> LOC = D24; # DDR_D14
-NET ddr_dq<15> LOC = E18; # DDR_D15
-NET ddr_dq<16> LOC = F18; # DDR_D16
-NET ddr_dq<17> LOC = A19; # DDR_D17
-NET ddr_dq<18> LOC = F19; # DDR_D18
-NET ddr_dq<19> LOC = B23; # DDR_D19
-NET ddr_dq<20> LOC = E21; # DDR_D20
-NET ddr_dq<21> LOC = D22; # DDR_D21
-NET ddr_dq<22> LOC = D23; # DDR_D22
-NET ddr_dq<23> LOC = B24; # DDR_D23
-NET ddr_dq<24> LOC = E22; # DDR_D24
-NET ddr_dq<25> LOC = F20; # DDR_D25
-NET ddr_dq<26> LOC = H23; # DDR_D26
-NET ddr_dq<27> LOC = G25; # DDR_D27
-NET ddr_dq<28> LOC = G26; # DDR_D28
-NET ddr_dq<29> LOC = H25; # DDR_D29
-NET ddr_dq<30> LOC = H24; # DDR_D30
-NET ddr_dq<31> LOC = H21; # DDR_D31
-
-NET ddr_ad<*> IOSTANDARD = SSTL2_I;
-NET ddr_ba<*> IOSTANDARD = SSTL2_I;
-NET ddr_casb IOSTANDARD = SSTL2_I;
-NET ddr_cke IOSTANDARD = SSTL2_I;
-NET ddr_clk IOSTANDARD = SSTL2_I;
-NET ddr_clk_fb IOSTANDARD = LVCMOS25;
-NET ddr_clkb IOSTANDARD = SSTL2_I;
-NET ddr_casb IOSTANDARD = SSTL2_I;
-NET ddr_csb IOSTANDARD = SSTL2_I;
-NET ddr_rasb IOSTANDARD = SSTL2_I;
-NET ddr_web IOSTANDARD = SSTL2_I;
-
-NET ddr_dqs<*> IOSTANDARD = SSTL2_II;
-NET ddr_dm<*> IOSTANDARD = SSTL2_II;
-NET ddr_dq<*> IOSTANDARD = SSTL2_II;
-
-// Timing Constraint for DDR Feedback Clock
-NET "ddr_clk_fb" TNM_NET = "ddr_clk_fb";
-TIMESPEC "TSDDR_FB" = PERIOD "ddr_clk_fb" 9.9 ns;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for TFT VGA LCD Controller
-#------------------------------------------------------------------------------
-
-NET tft_lcd_b<0> LOC = L26; # VGA_B2
-NET tft_lcd_b<0> IOSTANDARD = LVCMOS33;
-NET tft_lcd_b<1> LOC = C5; # VGA_B3
-NET tft_lcd_b<2> LOC = C7; # VGA_B4
-NET tft_lcd_b<3> LOC = B7; # VGA_B5
-NET tft_lcd_b<4> LOC = G8; # VGA_B6
-NET tft_lcd_b<5> LOC = F8; # VGA_B7
-NET tft_lcd_b<*> SLEW = FAST;
-NET tft_lcd_b<*> DRIVE = 8;
-
-NET tft_lcd_clk LOC = AF8;
-NET tft_lcd_clk IOSTANDARD = LVDCI_33;
-NET tft_lcd_clk SLEW = FAST;
-NET tft_lcd_clk DRIVE = 8;
-
-NET tft_lcd_g<0> LOC = M20; # VGA_G2
-NET tft_lcd_g<0> IOSTANDARD = LVCMOS33;
-NET tft_lcd_g<1> LOC = E4; # VGA_G3
-NET tft_lcd_g<2> LOC = D3; # VGA_G4
-NET tft_lcd_g<3> LOC = H7; # VGA_G5
-NET tft_lcd_g<4> LOC = H8; # VGA_G6
-NET tft_lcd_g<5> LOC = C1; # VGA_G7
-NET tft_lcd_g<*> SLEW = FAST;
-NET tft_lcd_g<*> DRIVE = 8;
-
-NET tft_lcd_hsync LOC = C10;
-NET tft_lcd_hsync SLEW = FAST;
-NET tft_lcd_hsync DRIVE = 8;
-
-NET tft_lcd_r<0> LOC = N25; #VGA_R2
-NET tft_lcd_r<0> IOSTANDARD = LVCMOS33;
-NET tft_lcd_r<1> LOC = C2; #VGA_R3
-NET tft_lcd_r<2> LOC = G7; #VGA_R4
-NET tft_lcd_r<3> LOC = F7; #VGA_R5
-NET tft_lcd_r<4> LOC = E5; #VGA_R6
-NET tft_lcd_r<5> LOC = E6; #VGA_R7
-NET tft_lcd_r<*> SLEW = FAST;
-NET tft_lcd_r<*> DRIVE = 8;
-
-NET tft_lcd_vsync LOC = A8;
-NET tft_lcd_vsync SLEW = FAST;
-NET tft_lcd_vsync DRIVE = 8;
-
-TIMESPEC "TSPLB_TFT" = FROM "sys_clk" TO "tft_clk" TIG;
-TIMESPEC "TSTFT_PLB" = FROM "tft_clk" TO "sys_clk" TIG;
-
-////////////////////////////////////////////////////////////////////////////
-// Misc Board Signals
-////////////////////////////////////////////////////////////////////////////
-
-NET plb_error LOC = L24;
-NET plb_error IOSTANDARD = LVCMOS33;
-NET plb_error TIG;
-NET opb_error LOC = V6;
-NET opb_error IOSTANDARD = LVCMOS33;
-NET opb_error TIG;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for Ethernet
-#------------------------------------------------------------------------------
-
-NET phy_col LOC = E3;
-NET phy_crs LOC = D5;
-NET phy_dv LOC = A9;
-NET phy_rx_clk LOC = B15;
-NET phy_rx_data<3> LOC = C4;
-NET phy_rx_data<2> LOC = D4;
-NET phy_rx_data<1> LOC = E1;
-NET phy_rx_data<0> LOC = F1;
-
-NET phy_rx_er LOC = B9;
-NET phy_tx_clk LOC = C15;
-NET phy_mii_clk LOC = D1;
-NET phy_mii_int_n LOC = H4;
-NET phy_rst_n LOC = D10;
-NET phy_tx_data<3> LOC = G1;
-NET phy_tx_data<2> LOC = H3;
-NET phy_tx_data<1> LOC = H2;
-NET phy_tx_data<0> LOC = H1;
-NET phy_tx_en LOC = F4;
-NET phy_tx_er LOC = F3;
-NET phy_mii_data LOC = G4;
-
-NET phy_mii_int_n PULLUP;
-
-NET phy_mii_int_n TIG;
-NET phy_rst_n TIG;
-
-# Timing Constraints (these are recommended in documentation and
-# are unaltered except for the TIG)
-NET "phy_rx_clk" TNM_NET = "RXCLK_GRP";
-NET "phy_tx_clk" TNM_NET = "TXCLK_GRP";
-TIMESPEC "TSTXOUT" = FROM "TXCLK_GRP" TO "PADS" 10 ns;
-TIMESPEC "TSRXIN" = FROM "PADS" TO "RXCLK_GRP" 6 ns;
-
-NET "phy_tx_clk" MAXSKEW= 1.0 ns;
-NET "phy_rx_clk" MAXSKEW= 1.0 ns;
-NET "phy_rx_clk" PERIOD = 40 ns HIGH 14 ns;
-NET "phy_tx_clk" PERIOD = 40 ns HIGH 14 ns;
-
-NET "phy_rx_data<3>" IOBDELAY=NONE;
-NET "phy_rx_data<2>" IOBDELAY=NONE;
-NET "phy_rx_data<1>" IOBDELAY=NONE;
-NET "phy_rx_data<0>" IOBDELAY=NONE;
-NET "phy_dv" IOBDELAY=NONE;
-NET "phy_rx_er" IOBDELAY=NONE;
-NET "phy_crs" IOBDELAY=NONE;
-NET "phy_col" IOBDELAY=NONE;
-
-# Workaround to help meet "phy_rx_clk MAXSKEW= 1.0 ns" constraint
-INST "opb_ethernet_0/opb_ethernet_0/RX_FF_I0" IOB=FALSE;
-INST "opb_ethernet_0/opb_ethernet_0/RX_FF_I1" IOB=FALSE;
-INST "opb_ethernet_0/opb_ethernet_0/RX_FF_I2" IOB=FALSE;
-INST "opb_ethernet_0/opb_ethernet_0/RX_FF_I3" IOB=FALSE;
-INST "opb_ethernet_0/opb_ethernet_0/DVD_FF" IOB=FALSE;
-INST "opb_ethernet_0/opb_ethernet_0/RER_FF" IOB=FALSE;
-
-# Timing ignores (to specify unconstrained paths)
-TIMESPEC "TS_PHYTX_OPB" = FROM "TXCLK_GRP" TO "sys_clk" TIG;
-TIMESPEC "TS_OPB_PHYTX" = FROM "sys_clk" TO "TXCLK_GRP" TIG;
-TIMESPEC "TS_PHYRX_OPB" = FROM "RXCLK_GRP" TO "sys_clk" TIG;
-TIMESPEC "TS_OPB_PHYRX" = FROM "sys_clk" TO "RXCLK_GRP" TIG;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for SRAM/FLASH
-#------------------------------------------------------------------------------
-
-NET sram_clk LOC = AF7;
-NET sram_clk_fb LOC = AD17;
-NET flash_a23 LOC = T21;
-NET sram_flash_addr<22> LOC = U20;
-NET sram_flash_addr<21> LOC = T19;
-NET sram_flash_addr<20> LOC = AC5;
-NET sram_flash_addr<19> LOC = AB5;
-NET sram_flash_addr<18> LOC = AC4;
-NET sram_flash_addr<17> LOC = AB4;
-
-NET sram_flash_addr<16> LOC = AB3;
-NET sram_flash_addr<15> LOC = AA4;
-NET sram_flash_addr<14> LOC = AA3;
-NET sram_flash_addr<13> LOC = W5;
-NET sram_flash_addr<12> LOC = W6;
-NET sram_flash_addr<11> LOC = W3;
-NET sram_flash_addr<10> LOC = AF3;
-NET sram_flash_addr<9> LOC = AE3;
-NET sram_flash_addr<8> LOC = AD2;
-NET sram_flash_addr<7> LOC = AD1;
-NET sram_flash_addr<6> LOC = AC2;
-NET sram_flash_addr<5> LOC = AC1;
-NET sram_flash_addr<4> LOC = AB2;
-NET sram_flash_addr<3> LOC = AB1;
-NET sram_flash_addr<2> LOC = AA1;
-NET sram_flash_addr<1> LOC = Y2;
-NET sram_flash_addr<0> LOC = Y1;
-NET sram_flash_data<31> LOC = F14;
-NET sram_flash_data<30> LOC = F13;
-NET sram_flash_data<29> LOC = F12;
-NET sram_flash_data<28> LOC = F11;
-NET sram_flash_data<27> LOC = F16;
-NET sram_flash_data<26> LOC = F15;
-NET sram_flash_data<25> LOC = D14;
-NET sram_flash_data<24> LOC = D13;
-NET sram_flash_data<23> LOC = D15;
-NET sram_flash_data<22> LOC = E14;
-NET sram_flash_data<21> LOC = C11;
-NET sram_flash_data<20> LOC = D11;
-NET sram_flash_data<19> LOC = D16;
-NET sram_flash_data<18> LOC = C16;
-NET sram_flash_data<17> LOC = E13;
-NET sram_flash_data<16> LOC = D12;
-NET sram_flash_data<15> LOC = AA14;
-NET sram_flash_data<14> LOC = AB14;
-NET sram_flash_data<13> LOC = AC12;
-NET sram_flash_data<12> LOC = AC11;
-NET sram_flash_data<11> LOC = AA16;
-NET sram_flash_data<10> LOC = AA15;
-NET sram_flash_data<9> LOC = AB13;
-NET sram_flash_data<8> LOC = AA13;
-NET sram_flash_data<7> LOC = AC14;
-NET sram_flash_data<6> LOC = AD14;
-NET sram_flash_data<5> LOC = AA12;
-NET sram_flash_data<4> LOC = AA11;
-NET sram_flash_data<3> LOC = AC16;
-NET sram_flash_data<2> LOC = AC15;
-NET sram_flash_data<1> LOC = AC13;
-NET sram_flash_data<0> LOC = AD13;
-NET sram_cen LOC = V7;
-NET sram_flash_oe_n LOC = AC6;
-NET sram_flash_we_n LOC = AB6;
-NET sram_bw<3> LOC = Y3; #Y4;
-NET sram_bw<2> LOC = Y4; #Y3;
-NET sram_bw<1> LOC = Y5; #Y6;
-NET sram_bw<0> LOC = Y6; #Y5;
-NET flash_ce LOC = W7;
-NET sram_adv_ld_n LOC = W4;
-NET sram_mode LOC = V26;
-
-NET sram_clk IOSTANDARD = LVCMOS33;
-NET sram_clk DRIVE = 16;
-NET sram_clk SLEW = FAST;
-NET sram_clk_fb IOSTANDARD = LVCMOS33;
-
-NET flash_a23 IOSTANDARD = LVDCI_33;
-NET flash_a23 SLEW = FAST;
-NET flash_a23 DRIVE = 8;
-
-NET sram_mode IOSTANDARD = LVDCI_33;
-NET sram_mode SLEW = FAST;
-NET sram_mode DRIVE = 8;
-
-NET sram_flash_addr<*> IOSTANDARD = LVDCI_33;
-NET sram_flash_addr<*> SLEW = FAST;
-NET sram_flash_addr<*> DRIVE = 8;
-
-NET sram_flash_data<*> IOSTANDARD = LVCMOS33;
-NET sram_flash_data<*> DRIVE = 12;
-NET sram_flash_data<*> SLEW = FAST;
-NET sram_flash_data<*> PULLDOWN;
-
-NET sram_flash_oe_n IOSTANDARD = LVDCI_33;
-NET sram_flash_oe_n SLEW = FAST;
-NET sram_flash_oe_n DRIVE = 8;
-
-NET sram_flash_we_n IOSTANDARD = LVDCI_33;
-NET sram_flash_we_n SLEW = FAST;
-NET sram_flash_we_n DRIVE = 8;
-
-NET sram_bw<*> IOSTANDARD = LVDCI_33;
-NET sram_bw<*> SLEW = FAST;
-NET sram_bw<*> DRIVE = 8;
-
-NET flash_ce IOSTANDARD = LVDCI_33;
-NET flash_ce SLEW = FAST;
-NET flash_ce DRIVE = 8;
-
-NET sram_cen IOSTANDARD = LVDCI_33;
-NET sram_cen SLEW = FAST;
-NET sram_cen DRIVE = 8;
-
-NET sram_adv_ld_n IOSTANDARD = LVDCI_33;
-NET sram_adv_ld_n SLEW = FAST;
-NET sram_adv_ld_n DRIVE = 8;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for Expansion Header GPIO
-#------------------------------------------------------------------------------
-
-NET gpio_exp_hdr1<31> LOC = AF24; # HDR1_64
-NET gpio_exp_hdr1<30> LOC = AE24; # HDR1_62
-NET gpio_exp_hdr1<29> LOC = AD22; # HDR1_8
-NET gpio_exp_hdr1<28> LOC = AB21; # HDR1_58
-NET gpio_exp_hdr1<27> LOC = W20; # HDR1_44
-NET gpio_exp_hdr1<26> LOC = W21; # HDR1_48
-NET gpio_exp_hdr1<25> LOC = AB22; # HDR1_14
-NET gpio_exp_hdr1<24> LOC = AD25; # HDR1_20
-NET gpio_exp_hdr1<23> LOC = W22; # HDR1_46
-NET gpio_exp_hdr1<22> LOC = V21; # HDR1_56
-NET gpio_exp_hdr1<21> LOC = V22; # HDR1_54
-NET gpio_exp_hdr1<20> LOC = AC22; # HDR1_16
-NET gpio_exp_hdr1<19> LOC = AD26; # HDR1_18
-NET gpio_exp_hdr1<18> LOC = AC26; # HDR1_34
-NET gpio_exp_hdr1<17> LOC = AD23; # HDR1_6
-NET gpio_exp_hdr1<16> LOC = AB25; # HDR1_30
-NET gpio_exp_hdr1<15> LOC = AC23; # HDR1_4
-NET gpio_exp_hdr1<14> LOC = AB26; # HDR1_24
-NET gpio_exp_hdr1<13> LOC = AC21; # HDR1_60
-NET gpio_exp_hdr1<12> LOC = AA23; # HDR1_10
-NET gpio_exp_hdr1<11> LOC = AA26; # HDR1_22
-NET gpio_exp_hdr1<10> LOC = Y25; # HDR1_40
-NET gpio_exp_hdr1<9> LOC = Y26; # HDR1_38
-NET gpio_exp_hdr1<8> LOC = W26; # HDR1_50
-NET gpio_exp_hdr1<7> LOC = AB23; # HDR1_12
-NET gpio_exp_hdr1<6> LOC = Y24; # HDR1_26
-NET gpio_exp_hdr1<5> LOC = AB24; # HDR1_32
-NET gpio_exp_hdr1<4> LOC = W25; # HDR1_52
-NET gpio_exp_hdr1<3> LOC = AC24; # HDR1_2
-NET gpio_exp_hdr1<2> LOC = AC25; # HDR1_36
-NET gpio_exp_hdr1<1> LOC = V20; # HDR1_42
-NET gpio_exp_hdr1<0> LOC = AA24; # HDR1_28
-NET gpio_exp_hdr1<*> TIG;
-NET gpio_exp_hdr1<*> PULLDOWN;
-
-NET gpio_exp_hdr2<31> LOC = AF18; # HDR2_40
-NET gpio_exp_hdr2<30> LOC = AE18; # HDR2_38
-NET gpio_exp_hdr2<29> LOC = AF19; # HDR2_32
-NET gpio_exp_hdr2<28> LOC = AF20; # HDR2_30
-NET gpio_exp_hdr2<27> LOC = AF21; # HDR2_44
-NET gpio_exp_hdr2<26> LOC = AF22; # HDR2_42
-NET gpio_exp_hdr2<25> LOC = AF23; # HDR2_24
-NET gpio_exp_hdr2<24> LOC = AE23; # HDR2_22
-NET gpio_exp_hdr2<23> LOC = AC18; # HDR2_48
-NET gpio_exp_hdr2<22> LOC = AB18; # HDR2_46
-NET gpio_exp_hdr2<21> LOC = AD19; # HDR2_64
-NET gpio_exp_hdr2<20> LOC = AC19; # HDR2_62
-NET gpio_exp_hdr2<19> LOC = AE20; # HDR2_16
-NET gpio_exp_hdr2<18> LOC = AD20; # HDR2_14
-NET gpio_exp_hdr2<17> LOC = AE21; # HDR2_36
-NET gpio_exp_hdr2<16> LOC = AD21; # HDR2_34
-NET gpio_exp_hdr2<15> LOC = AB20; # HDR2_52
-NET gpio_exp_hdr2<14> LOC = AC20; # HDR2_50
-NET gpio_exp_hdr2<13> LOC = Y17; # HDR2_56
-NET gpio_exp_hdr2<12> LOC = AA17; # HDR2_54
-NET gpio_exp_hdr2<11> LOC = AA19; # HDR2_60
-NET gpio_exp_hdr2<10> LOC = AA20; # HDR2_58
-NET gpio_exp_hdr2<9> LOC = Y22; # HDR2_8
-NET gpio_exp_hdr2<8> LOC = Y23; # HDR2_6
-NET gpio_exp_hdr2<7> LOC = W23; # HDR2_12
-NET gpio_exp_hdr2<6> LOC = W24; # HDR2_10
-NET gpio_exp_hdr2<5> LOC = Y20; # HDR2_20
-NET gpio_exp_hdr2<4> LOC = Y21; # HDR2_18
-NET gpio_exp_hdr2<3> LOC = Y19; # HDR2_28
-NET gpio_exp_hdr2<2> LOC = W19; # HDR2_26
-NET gpio_exp_hdr2<1> LOC = AA18; # HDR2_4
-NET gpio_exp_hdr2<0> LOC = Y18; # HDR2_2
-NET gpio_exp_hdr2<*> TIG;
-NET gpio_exp_hdr2<*> PULLDOWN;
-
-#------------------------------------------------------------------------------
-# IO Pad Location Constraints / Properties for Character LCD GPIO
-#------------------------------------------------------------------------------
-
-NET gpio_char_lcd<6> LOC = AE13; # LCD_E
-NET gpio_char_lcd<5> LOC = AC17; # LCD_RS
-NET gpio_char_lcd<4> LOC = AB17; # LCD_RW
-NET gpio_char_lcd<3> LOC = AF12; # LCD_DB7
-NET gpio_char_lcd<2> LOC = AE12; # LCD_DB6
-NET gpio_char_lcd<1> LOC = AC10; # LCD_DB5
-NET gpio_char_lcd<0> LOC = AB10; # LCD_DB4
-NET gpio_char_lcd<*> IOSTANDARD = LVCMOS33;
-NET gpio_char_lcd<*> TIG;
-NET gpio_char_lcd<*> PULLDOWN;
diff --git a/lib/CPUs/J1/doc/j1.pdf b/lib/CPUs/J1/doc/j1.pdf
deleted file mode 100644
index 188ac02..0000000
Binary files a/lib/CPUs/J1/doc/j1.pdf and /dev/null differ
diff --git a/lib/CPUs/J1/sim/tb_j1.do b/lib/CPUs/J1/sim/tb_j1.do
deleted file mode 100644
index 4fa1a55..0000000
--- a/lib/CPUs/J1/sim/tb_j1.do
+++ /dev/null
@@ -1,15 +0,0 @@
-## NOTE: Do not edit this file.
-##
-vlib work
-vcom -explicit -93 "../src/core/ram_2c_2r_2w.vhd"
-vcom -explicit -93 "../src/core/j1.vhd"
-vcom -explicit -93 "../src/tb_j1.vhd"
-
-vmap work
-
-vsim -t 1ps -lib work tb_j1
-do {tb_j1.wave.do}
-view wave
-view structure
-view signals
-run 1us
diff --git a/lib/CPUs/J1/sim/tb_j1.wave.do b/lib/CPUs/J1/sim/tb_j1.wave.do
deleted file mode 100644
index 58c0f66..0000000
--- a/lib/CPUs/J1/sim/tb_j1.wave.do
+++ /dev/null
@@ -1,58 +0,0 @@
-onerror {resume}
-quietly WaveActivateNextPane {} 0
-add wave -noupdate -format Logic /tb_j1/sys_clk_i
-add wave -noupdate -format Logic /tb_j1/sys_rst_i
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/io_din
-add wave -noupdate -format Logic /tb_j1/io_rd
-add wave -noupdate -format Logic /tb_j1/io_wr
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/io_addr
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/io_dout
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/inst_addr
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/inst_din
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/data_addr
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/data_din
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/data_dout
-add wave -noupdate -format Logic /tb_j1/data_we
-add wave -noupdate -format Logic /tb_j1/data_en
-add wave -noupdate -divider {J1 internals}
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/insn
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/immediate
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/ramrd
-add wave -noupdate -format Literal /tb_j1/uut/dsp
-add wave -noupdate -format Literal /tb_j1/uut/dsp2
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/st0
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/st02
-add wave -noupdate -format Logic /tb_j1/uut/dstkw2
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/pc
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/pc2
-add wave -noupdate -format Literal /tb_j1/uut/rsp
-add wave -noupdate -format Literal /tb_j1/uut/rsp2
-add wave -noupdate -format Logic /tb_j1/uut/rstkw2
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/rstkd2
-add wave -noupdate -format Logic /tb_j1/uut/ramwe2
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/pc_plus_1
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/dstack
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/rstack
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/st1
-add wave -noupdate -format Literal -radix hexadecimal /tb_j1/uut/rst0
-add wave -noupdate -format Literal /tb_j1/uut/st0sel
-add wave -noupdate -format Logic /tb_j1/uut/is_alu
-add wave -noupdate -format Logic /tb_j1/uut/is_lit
-add wave -noupdate -format Literal /tb_j1/uut/dd
-add wave -noupdate -format Literal /tb_j1/uut/rd
-TreeUpdate [SetDefaultTree]
-WaveRestoreCursors {{Cursor 1} {1600185 ps} 0}
-configure wave -namecolwidth 150
-configure wave -valuecolwidth 100
-configure wave -justifyvalue left
-configure wave -signalnamewidth 1
-configure wave -snapdistance 10
-configure wave -datasetprefix 0
-configure wave -rowmargin 4
-configure wave -childrowmargin 2
-configure wave -gridoffset 0
-configure wave -gridperiod 1
-configure wave -griddelta 40
-configure wave -timeline 0
-update
-WaveRestoreZoom {0 ps} {1050 ns}
diff --git a/lib/CPUs/J1/src/core/j1.v b/lib/CPUs/J1/src/core/j1.v
deleted file mode 100644
index 861cb3c..0000000
--- a/lib/CPUs/J1/src/core/j1.v
+++ /dev/null
@@ -1,187 +0,0 @@
-module j1(
- input sys_clk_i, input sys_rst_i, input [15:0] io_din,
- output io_rd, output io_wr, output [15:0] io_addr, output [15:0] io_dout);
-
- wire [15:0] insn;
- wire [15:0] immediate = { 1'b0, insn[14:0] };
-
- wire [15:0] ramrd;
-
- reg [4:0] dsp; // Data stack pointer
- reg [4:0] _dsp;
- reg [15:0] st0; // Return stack pointer
- reg [15:0] _st0;
- wire _dstkW; // D stack write
-
- reg [12:0] pc;
- reg [12:0] _pc;
- reg [4:0] rsp;
- reg [4:0] _rsp;
- reg _rstkW; // R stack write
- reg [15:0] _rstkD;
- wire _ramWE; // RAM write enable
-
- wire [15:0] pc_plus_1;
- assign pc_plus_1 = pc + 1;
-
- // The D and R stacks
- reg [15:0] dstack[0:31];
- reg [15:0] rstack[0:31];
- always @(posedge sys_clk_i)
- begin
- if (_dstkW)
- dstack[_dsp] = st0;
- if (_rstkW)
- rstack[_rsp] = _rstkD;
- end
- wire [15:0] st1 = dstack[dsp];
- wire [15:0] rst0 = rstack[rsp];
-
- // st0sel is the ALU operation. For branch and call the operation
- // is T, for 0branch it is N. For ALU ops it is loaded from the instruction
- // field.
- reg [3:0] st0sel;
- always @*
- begin
- case (insn[14:13])
- 2'b00: st0sel = 0; // ubranch
- 2'b10: st0sel = 0; // call
- 2'b01: st0sel = 1; // 0branch
- 2'b11: st0sel = insn[11:8]; // ALU
- default: st0sel = 4'bxxxx;
- endcase
- end
-
-`define RAMS 3
-
- genvar i;
-
-`define w (16 >> `RAMS)
-`define w1 (`w - 1)
-
- generate
- for (i = 0; i < (1 << `RAMS); i=i+1) begin : ram
- // RAMB16_S18_S18
- RAMB16_S2_S2
- ram(
- .DIA(0),
- // .DIPA(0),
- .DOA(insn[`w*i+`w1:`w*i]),
- .WEA(0),
- .ENA(1),
- .CLKA(sys_clk_i),
- .ADDRA({_pc}),
-
- .DIB(st1[`w*i+`w1:`w*i]),
- // .DIPB(2'b0),
- .WEB(_ramWE & (_st0[15:14] == 0)),
- .ENB(|_st0[15:14] == 0),
- .CLKB(sys_clk_i),
- .ADDRB(_st0[15:1]),
- .DOB(ramrd[`w*i+`w1:`w*i]));
- end
- endgenerate
-
- // Compute the new value of T.
- always @*
- begin
- if (insn[15])
- _st0 = immediate;
- else
- case (st0sel)
- 4'b0000: _st0 = st0;
- 4'b0001: _st0 = st1;
- 4'b0010: _st0 = st0 + st1;
- 4'b0011: _st0 = st0 & st1;
- 4'b0100: _st0 = st0 | st1;
- 4'b0101: _st0 = st0 ^ st1;
- 4'b0110: _st0 = ~st0;
- 4'b0111: _st0 = {16{(st1 == st0)}};
- 4'b1000: _st0 = {16{($signed(st1) < $signed(st0))}};
- 4'b1001: _st0 = st1 >> st0[3:0];
- 4'b1010: _st0 = st0 - 1;
- 4'b1011: _st0 = rst0;
- 4'b1100: _st0 = |st0[15:14] ? io_din : ramrd;
- 4'b1101: _st0 = st1 << st0[3:0];
- 4'b1110: _st0 = {rsp, 3'b000, dsp};
- 4'b1111: _st0 = {16{(st1 < st0)}};
- default: _st0 = 16'hxxxx;
- endcase
- end
-
- wire is_alu = (insn[15:13] == 3'b011);
- wire is_lit = (insn[15]);
-
- assign io_rd = (is_alu & (insn[11:8] == 4'hc));
- assign io_wr = _ramWE;
- assign io_addr = st0;
- assign io_dout = st1;
-
- assign _ramWE = is_alu & insn[5];
- assign _dstkW = is_lit | (is_alu & insn[7]);
-
- wire [1:0] dd = insn[1:0]; // D stack delta
- wire [1:0] rd = insn[3:2]; // R stack delta
-
- always @*
- begin
- if (is_lit) begin // literal
- _dsp = dsp + 1;
- _rsp = rsp;
- _rstkW = 0;
- _rstkD = _pc;
- end else if (is_alu) begin
- _dsp = dsp + {dd[1], dd[1], dd[1], dd};
- _rsp = rsp + {rd[1], rd[1], rd[1], rd};
- _rstkW = insn[6];
- _rstkD = st0;
- end else begin // jump/call
- // predicated jump is like DROP
- if (insn[15:13] == 3'b001) begin
- _dsp = dsp - 1;
- end else begin
- _dsp = dsp;
- end
- if (insn[15:13] == 3'b010) begin // call
- _rsp = rsp + 1;
- _rstkW = 1;
- _rstkD = {pc_plus_1[14:0], 1'b0};
- end else begin
- _rsp = rsp;
- _rstkW = 0;
- _rstkD = _pc;
- end
- end
- end
-
- always @*
- begin
- if (sys_rst_i)
- _pc = pc;
- else
- if ((insn[15:13] == 3'b000) |
- ((insn[15:13] == 3'b001) & (|st0 == 0)) |
- (insn[15:13] == 3'b010))
- _pc = insn[12:0];
- else if (is_alu & insn[12])
- _pc = rst0[15:1];
- else
- _pc = pc_plus_1;
- end
-
- always @(posedge sys_clk_i)
- begin
- if (sys_rst_i) begin
- pc <= 0;
- dsp <= 0;
- st0 <= 0;
- rsp <= 0;
- end else begin
- dsp <= _dsp;
- pc <= _pc;
- st0 <= _st0;
- rsp <= _rsp;
- end
- end
-
-endmodule // j1
diff --git a/lib/CPUs/J1/src/core/j1.vhd b/lib/CPUs/J1/src/core/j1.vhd
deleted file mode 100644
index d5c9f14..0000000
--- a/lib/CPUs/J1/src/core/j1.vhd
+++ /dev/null
@@ -1,282 +0,0 @@
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-entity j1 is
- Generic
- (
- R_STACK_SIZE : natural := 32;
- D_STACK_SIZE : natural := 32
-
- );
- Port
- (
- sys_clk_i : in std_logic;
- sys_rst_i : in std_logic;
- io_din : in unsigned(15 downto 0);
- io_rd : out std_logic;
- io_wr : out std_logic;
- io_addr : out unsigned(15 downto 0);
- io_dout : out unsigned(15 downto 0);
- inst_din : in unsigned(15 downto 0);
- inst_addr : out unsigned(12 downto 0);
- data_addr : out unsigned(12 downto 0);
- data_we : out std_logic;
- data_en : out std_logic;
- data_din : in unsigned(15 downto 0);
- data_dout : out unsigned(15 downto 0)
-
- );
-end j1;
-
-architecture behave of j1 is
-
-signal insn : unsigned(15 downto 0);
-signal immediate : unsigned(15 downto 0);
-signal ramrd : unsigned(15 downto 0);
-
-signal dsp : unsigned(4 downto 0); -- Data stack pointer (register)
-signal dsp2 : unsigned(4 downto 0); -- register
-signal st0 : unsigned(15 downto 0); -- Return stack pointer (register)
-signal st02 : unsigned(15 downto 0); -- register
-
-signal dstkW2 : std_logic; -- D stack write
-
-signal pc : unsigned(12 downto 0); -- register
-signal pc2 : unsigned(12 downto 0); -- register
-signal rsp : unsigned(4 downto 0); -- register
-signal rsp2 : unsigned(4 downto 0); -- register
-
-signal rstkW2 : std_logic; -- register
-signal rstkD2 : unsigned(15 downto 0); -- register
-signal ramWE2 : std_logic; -- RAM write enable
-
-signal pc_plus_1 : unsigned(15 downto 0);
-
-type stack_t is array (integer range <>) of unsigned(15 downto 0);
-
-signal dstack : stack_t(0 to D_STACK_SIZE-1); -- register
-signal rstack : stack_t(0 to R_STACK_SIZE-1); -- register
-
-signal st1 : unsigned(15 downto 0);
-signal rst0 : unsigned(15 downto 0);
-
-signal st0sel : unsigned(3 downto 0);
-
-signal is_alu : BOOLEAN;
-signal is_lit : BOOLEAN;
-
-signal dd : unsigned(1 downto 0); -- D stack delta
-signal rd : unsigned(1 downto 0); -- R stack delta
-
-signal stack_ram_en : std_logic; -- helper for RAM R/W
-signal stack_ram_we : std_logic; -- helper for RAM R/W
-
-begin
-
--- LINE 25:
-pc_plus_1 <= ("000" & pc) + 1;
-
--- LINE 37:
-st1 <= dstack(to_integer(dsp));
-rst0 <= rstack(to_integer(rsp));
-immediate <= '1' & insn(14 downto 0);
-
--- LINE 112:
-is_alu <= (insn(15 downto 13) = "011");
-is_lit <= (insn(15) = '1');
-
-
--- LINE 115:
-io_rd <= '1' when (is_alu and (insn(11 downto 8) = X"C")) else '0';
-io_wr <= ramWE2;
-io_addr <= st0;
-io_dout <= st1;
-ramWE2 <= '1' when (is_alu and (insn(5) = '1')) else '0';
-dstkW2 <= '1' when (is_lit or (is_alu and insn(7) = '1')) else '0';
-dd <= insn(1 downto 0);
-rd <= insn(3 downto 2);
-
-
--- LINE 27:
--- The D and R stacks
-proc_d_and_r_stack:
-process(sys_clk_i)
-begin
- if rising_edge(sys_clk_i) then
- if dstkW2 = '1' then
- dstack(to_integer(dsp2)) <= st0;
- end if;
- if rstkW2 = '1' then
- rstack(to_integer(rsp2)) <= rstkD2;
- end if;
-
- end if;
-end process;
-
-
--- LINE 40:
--- st0sel is the ALU operation. For branch and call the operation
--- is T, for 0branch it is N. For ALU ops it is loaded from the instruction
--- field.
-
-proc_aluop_sel:
-process(insn)
-begin
-
-
- case insn(14 downto 13) is
-
- when "00" => st0sel <= "0000";
- when "10" => st0sel <= "0000";
- when "01" => st0sel <= "0001";
- when "11" => st0sel <= insn(11 downto 8);
- when others => st0sel <= "XXXX";
-
- end case;
-end process;
-
-
--- LINE 55:
--- define RAMS outside this module
-insn <= inst_din;
-inst_addr <= pc2(12 downto 0);
-data_en <= not (st02(15) or st02(14));
-data_we <= ramWE2 and not (st02(15) or st02(14));
-ramrd <= data_din;
-data_dout <= st1;
-data_addr <= st02(13 downto 1);
-
-
--- LINE 85:
--- Compute the new value of T.
-proc_alu:
-process(insn, immediate, st0sel, st0, st1, rst0, rsp, dsp)
-begin
-
- if insn(15) = '1' then
- st02 <= immediate;
- else
- case st0sel is
-
- when "0000" => st02 <= st0;
- when "0001" => st02 <= st1;
- when "0010" => st02 <= st0 + st1;
- when "0011" => st02 <= st0 and st1;
- when "0100" => st02 <= st0 or st1;
- when "0101" => st02 <= st0 xor st1;
- when "0110" => st02 <= not st0;
- when "0111" =>
- if st1 = st0 then
- st02 <= X"FFFF";
- else
- st02 <= X"0000";
- end if;
-
- when "1000" =>
- if signed(st1) < signed(st0) then
- st02 <= X"FFFF";
- else
- st02 <= X"0000";
- end if;
-
- when "1001" => st02 <= st1 srl to_integer(st0(3 downto 0));
- when "1010" => st02 <= st0 - 1;
- when "1011" => st02 <= rst0;
- when "1100" =>
- if st0(15) = '1' or st0(14) = '1' then -- LINE 104: ????
- st02 <= io_din;
- else
- st02 <= ramrd;
- end if;
-
- when "1101" => st02 <= st1 sll to_integer(st0(3 downto 0));
- when "1110" => st02 <= "000" & rsp & "000" & dsp; -- LINE 106: ????
- when "1111" =>
- if st1 < st0 then
- st02 <= X"FFFF";
- else
- st02 <= X"0000";
- end if;
- when others => st02 <= "XXXXXXXXXXXXXXXX";
-
- end case;
- end if;
-end process;
-
--- LINE 126:
-proc_stack_ctrl:
-process(is_lit, is_alu, pc2, dd, rd, insn, st0, pc_plus_1, rsp, dsp)
-begin
- if is_lit then -- literal
- dsp2 <= dsp + 1;
- rsp2 <= rsp;
- rstkW2 <= '0';
- rstkD2 <= "000" & pc2;
- elsif is_alu then
- dsp2 <= dsp + (dd(1) & dd(1) & dd(1) & dd);
- rsp2 <= rsp + (rd(1) & rd(1) & rd(1) & rd);
- rstkW2 <= insn(6);
- rstkD2 <= st0;
- else -- jump/call
- -- predicated jump is like DROP
- if insn(15 downto 13) = "001" then
- dsp2 <= dsp - 1;
- else
- dsp2 <= dsp; -- *default
- end if;
- if insn(15 downto 13) = "010" then -- call
- rsp2 <= rsp + 1;
- rstkW2 <= '1';
- rstkD2 <= pc_plus_1(14 downto 0) & '0';
- else
- rsp2 <= rsp; -- *default
- rstkW2 <= '0'; -- *default
- rstkD2 <= "000" & pc2; -- *default
- end if;
-
- end if;
-end process;
-
--- LINE 157:
-proc_pc:
-process(sys_rst_i, is_alu, insn, pc, st0, rst0, pc_plus_1)
-begin
-
- if sys_rst_i = '1' then
- pc2 <= pc;
- else
- if ((insn(15 downto 13) = "000")
- or ((insn(15 downto 13) = "001")
- and (st0 = X"0000"))
- or (insn(15 downto 13) = "010")) then
- pc2 <= insn(12 downto 0);
- elsif is_alu and (insn(12) = '1') then -- return
- pc2 <= rst0(13 downto 1); -- LINE 167: ????
- else
- pc2 <= pc_plus_1(12 downto 0); -- LINE 169: truncation ????
- end if;
- end if;
-end process;
-
--- LINE 172:
-proc_next:
-process(sys_clk_i)
-begin
-
- if rising_edge(sys_clk_i) then
- if sys_rst_i = '1' then
- pc <= (others => '0');
- dsp <= (others => '0');
- st0 <= (others => '0');
- rsp <= (others => '0');
- else
- dsp <= dsp2;
- pc <= pc2;
- st0 <= st02;
- rsp <= rsp2;
- end if;
- end if;
-end process;
-
-end behave;
diff --git a/lib/CPUs/J1/src/core/ram_2c_2r_2w.vhd b/lib/CPUs/J1/src/core/ram_2c_2r_2w.vhd
deleted file mode 100644
index 23d8118..0000000
--- a/lib/CPUs/J1/src/core/ram_2c_2r_2w.vhd
+++ /dev/null
@@ -1,84 +0,0 @@
---------------------------------------------------------------------------
--- Project: Generic RAM. Infers BlockRAM for Xilinx
--- This file: On-chip RAM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-entity ram_2c_2r_2w is
- Generic
- (
- addr_width : integer := 3;
- data_width : integer := 8
- );
- Port (
- clka : in STD_LOGIC;
- clkb : in STD_LOGIC;
- en_a : in STD_LOGIC;
- en_b : in STD_LOGIC;
- we_a : in STD_LOGIC;
- we_b : in STD_LOGIC;
- addr_a : in unsigned (addr_width-1 downto 0);
- addr_b : in unsigned (addr_width-1 downto 0);
- din_a : in unsigned (data_width-1 downto 0);
- din_b : in unsigned (data_width-1 downto 0);
- dout_a : out unsigned (data_width-1 downto 0);
- dout_b : out unsigned (data_width-1 downto 0)
- );
-end ram_2c_2r_2w;
-
-architecture Behavioral of ram_2c_2r_2w is
-
- constant depth : integer := 2**addr_width;
- type RAMtype is array (0 to depth-1) of unsigned (data_width-1 downto 0);
- shared variable RAM : RAMtype;
-
-begin
-
-process (clka)
-begin
-if clka'event and clka = '1' then
- if en_a = '1' then
- if we_a = '1' then
- RAM(to_integer(addr_a)) := din_a;
- end if;
- dout_a <= RAM(to_integer(addr_a));
- end if;
-end if;
-end process;
-
-process (clkb)
-begin
-if clkb'event and clkb = '1' then
- if en_b = '1' then
- if we_b = '1' then
- RAM(to_integer(addr_b)) := din_b;
- end if;
- dout_b <= RAM(to_integer(addr_b));
- end if;
-end if;
-end process;
-
-
-end Behavioral;
-
diff --git a/lib/CPUs/J1/src/tb_j1.vhd b/lib/CPUs/J1/src/tb_j1.vhd
deleted file mode 100644
index 8aa4c3c..0000000
--- a/lib/CPUs/J1/src/tb_j1.vhd
+++ /dev/null
@@ -1,150 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: testbench for embedded cpu with rom
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-use std.textio.all; -- Imports the standard textio package.
-
-library work;
-
-ENTITY tb_j1 IS
-END tb_j1;
-
-ARCHITECTURE behavior OF tb_j1 IS
-
- constant CLK_PERIOD : time := 10 ns;
-
- -- Inputs
- signal sys_clk_i : std_logic := '0';
- signal sys_rst_i : std_logic := '1';
- signal io_din : unsigned(15 downto 0) := (others => '0');
- signal inst_din : unsigned(15 downto 0) := (others => '0');
- signal data_din : unsigned(15 downto 0) := (others => '0');
-
- -- Outputs
- signal io_rd : std_logic;
- signal io_wr : std_logic;
- signal io_addr : unsigned(15 downto 0);
- signal io_dout : unsigned(15 downto 0);
- signal data_dout : unsigned(15 downto 0);
- signal inst_addr : unsigned(12 downto 0);
- signal data_addr : unsigned(12 downto 0);
- signal data_we : std_logic;
- signal data_en : std_logic;
-
- type rom_t is array (integer range <>) of unsigned(15 downto 0);
-
- signal rom : rom_t(0 to 15) :=
- (
- X"8123", -- 0000
- X"0002", -- 0001
- X"0005", -- 0002
- X"8456", -- 0003
- X"4008", -- 0004
- X"0003", -- 0005
- X"0000", -- 0006
- X"0000", -- 0007
- X"8456", -- 0008
- X"8451", -- 0009
- X"7000", -- 000A
- X"0000", -- 000B
- X"0000", -- 000C
- X"0000", -- 000D
- X"0000", -- 000E
- X"0000" -- 000F
- );
-
-BEGIN
-
- -- Instruction rom
-process(sys_clk_i)
-begin
- if rising_edge(sys_clk_i) then
- inst_din <= rom(to_integer(inst_addr(3 downto 0)));
- end if;
-end process;
-
-uut: entity work.j1
- PORT MAP
- (
- sys_clk_i => sys_clk_i,
- sys_rst_i => sys_rst_i,
- io_din => io_din,
- io_rd => io_rd,
- io_wr => io_wr,
- io_addr => io_addr,
- inst_din => inst_din,
- inst_addr => inst_addr,
- data_addr => data_addr,
- data_we => data_we,
- data_en => data_en,
- data_din => data_din,
- data_dout => data_dout
- );
-
-inst_ram: entity work.ram_2c_2r_2w
- GENERIC MAP
- (
- addr_width => 13,
- data_width => 16
- )
- PORT MAP(
- clka => sys_clk_i,
- clkb => sys_clk_i,
- en_a => '1',
- en_b => data_en,
- we_a => '0',
- we_b => data_we,
- addr_a => (others => '0'), --inst_addr
- addr_b => data_addr,
- din_a => (others => '0'),
- din_b => data_dout,
- dout_a => open, -- inst_din
- dout_b => data_din
- );
-
-
-CLK_GEN: process
- begin
- wait for CLK_PERIOD/2;
- sys_clk_i <= not sys_clk_i;
- end process;
-
-STIMULUS: process
-
- begin
-
- wait for 3*CLK_PERIOD;
- sys_rst_i <= '0';
- wait for 2*CLK_PERIOD;
-
-
- wait for 1000*CLK_PERIOD;
-
- assert false report "Test finished" severity error;
- wait;
-
- end process;
-
-end behavior;
diff --git a/lib/CPUs/JCpu/asm/dctest.jsm b/lib/CPUs/JCpu/asm/dctest.jsm
deleted file mode 100644
index 38d5947..0000000
--- a/lib/CPUs/JCpu/asm/dctest.jsm
+++ /dev/null
@@ -1,56 +0,0 @@
-; -------------------------------------------------
-; PROJECT "dctest"
-; -------------------------------------------------
-
-include "../../../jasm/cregs.inc.jsm"
-
-; -------------------------------------------------
- xmem
- org 4
-konst: dc 0x01, 0x12,"A"
-gap1: db 16
-mesg: dc "Hallo", 13,0x0A, 0
-name: dc "Jens",0
-msg1: dc "Welcome to JASM CPU",0
-msg2: dc "Ready",0
-msg3: dc "Testing",0
-msg4: dc "Passed",0
-msg5: dc "Error",0
-crlf: dc 0x0D, 0x0A
-
- org 0x00
-shit: db 4
-
- cmem 0
- org 8
-cram1: db 16
-cram2: db 6
-cram3: db 4
-
- cmem 1
-cram4: db 8
-cram5: db 8
- org 0x20
-cram6: db 8
-cram7: db 4
-
-reg_revision: equ 0x00
-reg_testid: equ 0x01
-
-; -------------------------------------------------
- code
- org 0x000
-reset: jmp start
-
-; -------------------------------------------------
- org 0x001
-int_vec: jmp isr
-
-; -------------------------------------------------
- org 0x010
-
-start: jmp start
-
-; -------------------------------------------------
-isr: reti
-
diff --git a/lib/CPUs/JCpu/asm/dctest.tcl b/lib/CPUs/JCpu/asm/dctest.tcl
deleted file mode 100644
index ca88834..0000000
--- a/lib/CPUs/JCpu/asm/dctest.tcl
+++ /dev/null
@@ -1,212 +0,0 @@
-# ----------------------------------------------------------------------
-# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-# This file: The ROM file for upload to target over JTAG
-#
-# Copyright (C) 2007 J. Ahrensfeld
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# For questions and ideas, please contact the author at jens@jayfield.org
-#
-# ---------------------------------------------------------------------
-
-# ---------------------------------------------------------------------
-# For Chipscope 9.1
-# ---------------------------------------------------------------------
-# Source JTAG/TCL frame work
-cd $env(CHIPSCOPE)\\bin\\nt
-source csejtag.tcl
-
-namespace import ::chipscope::*
-
-# Platform USB Cable
-set PLATFORM_USB_CABLE_ARGS [list "port=USB2" "frequency=6000000"]
-# frequency="24000000 | 12000000 | 6000000 | 3000000 | 1500000 | 750000"
-
-# Create session
-set handle [::chipscope::csejtag_session create 0]
-
-# Open JTAG and lock
-set open_result [::chipscope::csejtag_target open $handle $CSEJTAG_TARGET_PLATFORMUSB 0 $PLATFORM_USB_CABLE_ARGS]
-set lock_result [::chipscope::csejtag_target lock $handle 1000]
-
-set devlist [::chipscope::csejtag_tap autodetect_chain $handle $CSEJTAG_SCAN_DEFAULT]
-
-# Get Device ID
-set devtype "Virtex-4SX"
-set devid 2
-set irlength [::chipscope::csejtag_tap get_irlength $handle $devid]
-set idcode [::chipscope::csejtag_tap get_device_idcode $handle $devid]
-
-set CSE_OP $CSEJTAG_SHIFT_READWRITE
-set CSE_ES $CSEJTAG_RUN_TEST_IDLE
-
-# Write Program
-# JASM_ROM_INSERT_HERE
-# Assembled from dctest.jsm
-# ---------------------------------------------------------------
-# Shift the USER2 Instruction (b1111000010) into the Instruction Register of FPGA
-# User 1
-set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C2"]
-
-# 0x000: JMP 0x010
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00030010"
-
-# 0x001: JMP 0x011
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00130011"
-
-# 0x002:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00200000"
-
-# 0x003:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00300000"
-
-# 0x004:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00400000"
-
-# 0x005:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00500000"
-
-# 0x006:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00600000"
-
-# 0x007:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00700000"
-
-# 0x008:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00800000"
-
-# 0x009:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00900000"
-
-# 0x00A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00A00000"
-
-# 0x00B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00B00000"
-
-# 0x00C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00C00000"
-
-# 0x00D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00D00000"
-
-# 0x00E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00E00000"
-
-# 0x00F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00F00000"
-
-# 0x010: JMP 0x010
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01030010"
-
-# 0x011: RETI
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0113F000"
-
-# Assembled from dctest.jsm
-# ---------------------------------------------------------------
-# Shift the USER2 Instruction (b1111000011) into the Instruction Register of FPGA
-# User 2
-set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C3"]
-
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0401"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0512"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0641"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1748"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1861"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "196C"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1A6C"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1B6F"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1C0D"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1D0A"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1F4A"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2065"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "216E"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2273"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2457"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2565"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "266C"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2763"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "286F"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "296D"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2A65"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2B20"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2C74"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2D6F"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2E20"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2F4A"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3041"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3153"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "324D"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3320"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3443"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3550"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3655"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3852"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3965"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3A61"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3B64"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3C79"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3E54"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3F65"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4073"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4174"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4269"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "436E"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4467"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4650"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4761"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4873"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4973"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4A65"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4B64"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4D45"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4E72"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4F72"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "506F"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5172"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "530D"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "540A"
-
-::chipscope::csejtag_target unlock $handle
-::chipscope::csejtag_target close $handle
-::chipscope::csejtag_session destroy $handle
-exit
diff --git a/lib/CPUs/JCpu/asm/itest.jsm b/lib/CPUs/JCpu/asm/itest.jsm
deleted file mode 100644
index 9666253..0000000
--- a/lib/CPUs/JCpu/asm/itest.jsm
+++ /dev/null
@@ -1,858 +0,0 @@
-; -------------------------------------------------
-; PROJECT "itest"
-; -------------------------------------------------
-
-include "../../../jasm/cregs.inc.jsm"
-
-; -------------------------------------------------
- xmem
-msg: dc "Hallo", 0
-xram: db 256
-
- cmem 0
-cram: db 256
-
-reg_revision: equ 0x00
-reg_testid: equ 0x01
-
-; -------------------------------------------------
- code
- org 0x000
-reset: jmp start
-
-; -------------------------------------------------
- org 0x001
-int_vec: jmp isr
-
-; -------------------------------------------------
- org 0x010
-
-start: call init
- cin R0, (cpu_revision)
- xout (reg_revision), R0
-
- ; Test 0
- call test0
-
- ; Test 1
- mov R0, 1
- xout (reg_testid), R0
- call test1
-
- ; Test 2
- mov R0, 2
- xout (reg_testid), R0
- call test2
-
- ; Test 3
- mov R0, 3
- xout (reg_testid), R0
- call test3
-
- ; Test 4
- mov R0, 4
- xout (reg_testid), R0
- call test4
-
- ; Test 5
- mov R0, 5
- xout (reg_testid), R0
- call test5
-
- ; Test 6
- mov R0, 6
- xout (reg_testid), R0
- call test6
-
- ; Test 7
- mov R0, 7
- xout (reg_testid), R0
- call test7
-
- ; Test 8
- mov R0, 8
- xout (reg_testid), R0
- call test8
-
- ; Test 9
- mov R0, 9
- xout (reg_testid), R0
- call test9
-
- ; Test 10
- mov R0, 10
- xout (reg_testid), R0
- call test10
-
- ; Test 11
- mov R0, 11
- xout (reg_testid), R0
- call test11
-
- ; Test 12
- mov R0, 12
- xout (reg_testid), R0
- call test12
-
- ; End of test
- mov R0, 0xFF
- xout (reg_testid), R0
-
- jmp ok
-
-; -------------------------------------------------
-init: mov R0, 0
- mov R1, 0
- mov R2, 0
- mov R3, 0
- mov R4, 0
- mov R5, 0
- mov R6, 0
- mov R7, 0
- mov R8, 0
- mov R9, 0
- mov R10, 0
- mov R11, 0
- mov R12, 0
- mov R13, 0
- mov R14, 0
- mov R15, 0
- ret
-
-; -------------------------------------------------
-; MOV|R|K
-; MOV|R|R
-test0: mov R0, 0x10
- cmp R0, 0x10
- jne error
- add R0, 1
-
- mov R1, R0
- cmp R1, 0x11
- jne error
- add R1, 1
-
- mov R2, R1
- cmp R2, 0x12
- jne error
- add R2, 1
-
- mov R3, R2
- cmp R3, 0x13
- jne error
- add R3, 1
-
- mov R4, R3
- cmp R4, 0x14
- jne error
- add R4, 1
-
- mov R5, R4
- cmp R5, 0x15
- jne error
- add R5, 1
-
- mov R6, R5
- cmp R6, 0x16
- jne error
- add R6, 1
-
- mov R7, R6
- cmp R7, 0x17
- jne error
- add R7, 1
-
- mov R8, R7
- cmp R8, 0x18
- jne error
- add R8, 1
-
- mov R9, R8
- cmp R9, 0x19
- jne error
- add R9, 1
-
- mov R10, R9
- cmp R10, 0x1A
- jne error
- add R10, 1
-
- mov R11, R10
- cmp R11, 0x1B
- jne error
- add R11, 1
-
- mov R12, R11
- cmp R12, 0x1C
- jne error
- add R12, 1
-
- mov R13, R12
- cmp R13, 0x1D
- jne error
- add R13, 1
-
- mov R14, R13
- cmp R14, 0x1E
- jne error
- add R14, 1
-
- mov R15, R14
- cmp R15, 0x1F
- jne error
- add R15, 1
-
- ret
-
-; -------------------------------------------------
-; Instruction test
-; TST|R
-; CMP|R|K
-; JNZ|K
-; JC|K
-; JNE|K
-; JLT|K
-; JGT|K
-; JLE|K
-; JGE|K
-; JMP|K
-test1: mov R0, 0 ; R0 <= 0
- tst R0
- jnz error
- jc error
- cmp R0, 0
- jne error
- jlt error
- jgt error
- jle t1_ok10
- jmp error
-
-t1_ok10: jeq t1_ok20
- jmp error
-
-t1_ok20: jge t1_ok30
- jmp error
-
-t1_ok30: cmp R0, 0x55
- jeq error
- jlt t1_ok40
- jmp error
-
-t1_ok40: jle t1_ok50
- jmp error
-
-t1_ok50: jge error
- jgt error
-
- mov R0, 0x55 ; R0 <= 0xAA
- tst R0
- jz error
- jc error
-
- cmp R0, 0xAA
- jeq error
- jne t1_ok60
- jmp error
-
-t1_ok60: jlt t1_ok70
- jmp error
-
-t1_ok70: jle t1_ok80
- jmp error
-
-t1_ok80: jgt error
-
- cmp R0, 0x55
- jeq t1_ok90
- jmp error
-
-t1_ok90: jne error
- jlt error
-
- jle t1_ok100
- jmp error
-
-t1_ok100: jgt error
- jge t1_ok110
- jmp error
-
-t1_ok110: mov R0, 0xAA ; R0 <= 0x55
- tst R0
- jz error
- jc error
-
- cmp R0, 0x55
- jeq error
- jne t1_ok120
- jmp error
-
-t1_ok120: jgt t1_ok130
- jmp error
-
-t1_ok130: jge t1_ok140
- jmp error
-
-t1_ok140: jlt error
- jle error
-
- ret
-
-; -------------------------------------------------
-; ADD|R|K
-; ADDC|R|K
-; ToDo: ADD|R|R
-; ToDo: ADDC|R|R
-; CMP|R|R
-test2: mov R0, 0
- mov R1, 0
- mov R2, R0
- mov R3, R1
-
-t2_loop: add R0, 0x01
- addc R1, 0x00
- add R2, 1
- cmp R2, 0
- jne t2_L1
- add R3, 1
- cmp R3, 0x02
-t2_L1: jne t2_loop
- cmp R0, R2
- jne error
- cmp R1, R3
- jne error
- mov R0, 0
-
- ret
-
-; -------------------------------------------------
-; SUB|R|K
-; SUBC|R|K
-; ToDo: SUB|R|R
-; ToDo: SUBC|R|R
-; CMP|R|R
-test3: mov R0, 0x00
- mov R1, 0x03
- mov R2, R0
- mov R3, R1
-
-t3_loop: sub R0, 0x01
- subc R1, 0x00
- sub R2, 1
- cmp R2, 0xFF
- jne t3_L1
- sub R3, 1
- cmp R3, 0x00
-t3_L1: jne t3_loop
- cmp R0, R2
- jne error
- cmp R1, R3
- jne error
- mov R0, 0
-
- ret
-; -------------------------------------------------
-; SUB|K|R
-; SUB|R|R
-; SUBC|R|R
-; SUBC|K|R
-; CMP|R|R
-test4: mov R0, 0x03
- mov R1, 0x05
- sub 0x05, R0
- sub R1, 0x03
- cmp R0, R1
- jne error
- mov R0, 0x03
- mov R1, 0x05
- sub R0, R1
- subc 0, R0
- cmp R0, 0x01
- jne error
- add R0, 0
- subc R1, R0
- cmp R1, 0x04
- jne error
- mov R0, 0
-
- ret
-
-; -------------------------------------------------
-; MOVC|R|Ri
-; MOVC|R|Ki
-; MOVC|Ri|R
-; MOVC|Ri|K
-; MOVC|Ki|R
-test5: mov R0, 1
- movc (cram+0x5A), R0
- dec R0
- movc (cram+0), R0
- movc R1, (cram+0x5A)
- movc (R1), 0xA5
- movc R0, (R1)
- movc R1, (R1)
- add R1, 0xFF-0xA5
- movc R0, (R1)
-t5_loop1: movc (R0), R0
- movc R2, (R0)
- cmp R2, R0
- jne error
- movc (R2), R1
- movc R2, (R2)
- cmp R2, R1
- jne error
- dec R1
- inc R0
- jnz t5_loop1
-
- ret
-
-; -------------------------------------------------
-; MOVX|R|Ri
-; MOVX|R|Ki
-; MOVX|Ri|R
-; MOVX|Ri|K
-; MOVX|Ki|R
-test6: mov R0, 1
- movx (xram+0x5A), R0
- dec R0
- movx (xram+0), R0
- movx R1, (xram+0x5A)
- movx (R1), 0xA5
- movx R0, (R1)
- movx R1, (R1)
- add R1, 0xFF-0xA5
- movx R0, (R1)
-t6_loop1: movx (R0), R0
- movx R2, (R0)
- cmp R2, R0
- jne error
- movx (R2), R1
- movx R2, (R2)
- cmp R2, R1
- jne error
- dec R1
- inc R0
- jnz t6_loop1
-
- ret
-
-; -------------------------------------------------
-; PUSH|R
-; POP|R
-test7: mov R0, 0xAA
- mov R1, 0
-t7_loop1: push R0
- inc R0
- dec R1
- jnz t7_loop1
-t7_loop2: pop R0
- dec R1
- jnz t7_loop2
- cmp R0, 0xAA
- jne error
-
- ret
-
-; -------------------------------------------------
-; JMP|K
-; CALL|K
-; RET
-test8: mov R0, 0x55
- push R0
- mov R0, 0
- mov R1, 0xFF
- call t8_rec
- pop R0
- cmp R0, 0x55
- jne error
-
- ; Stack manipulations 1
- mov R0, return1'high
- mov R1, return1'low
- cout (cpu_stack_high), R0
- push R1
-
- mov R0, init'high
- mov R1, init'low
- cout (cpu_stack_high), R0
- push R1
- ret
-
- ; Stack manipulations 2
-return1: mov R0, return2'high
- mov R1, return2'low
- cout (cpu_stack_high), R0
- push R1
-
- mov R0, init'high
- mov R1, init'low
- cout (cpu_stack_high), R0
- push R1
-return2: ret
-
-t8_rec: cmp R0, R1
- jeq ex_t8_rec
- inc R0
- jmp t8_rstub
-ex_t8_rec: dec R0
- dec R1
- ret
-
-t8_rstub: call t8_rec
- jmp ex_t8_rec
-
-; -------------------------------------------------
-; SWAP|R
-; SHL|R
-; SHR|R
-; ROL|R
-; ROR|R
-; ROLC|R
-; RORC|R
-test9: mov R0, 0xA5 ; SWAP test
- mov R1, 0x5A
- swap R0
- cmp R0, 0x5A
- jne error
- swap R0
- cmp R0, 0xA5
- jne error
- mov R0, 0xD2
- swap R0
- cmp R0, 0x2D
- jne error
- swap R1
- cmp R0, 0x2D
- jne error
- cmp R1, 0xA5
- jne error
-
- mov R0, 0x2D
- shl R0 ; SHL test
- cmp R0, 0x5A
- jne error
- shl R0
- cmp R0, 0xB4
- jne error
- shl R0
- cmp R0, 0x68
- jne error
- shl R0
- cmp R0, 0xD0
- jne error
- shl R0
- cmp R0, 0xA0
- jne error
- shl R0
- cmp R0, 0x40
- jne error
- shl R0
- cmp R0, 0x80
- jne error
- shl R0
- cmp R0, 0x00
- jne error
-
- mov R1, 0x84
- shr R1 ; SHR test
- cmp R1, 0x42
- jne error
- shr R1
- cmp R1, 0x21
- jne error
- shr R1
- cmp R1, 0x10
- jne error
- shr R1
- cmp R1, 0x08
- jne error
- shr R1
- cmp R1, 0x04
- jne error
- shr R1
- cmp R1, 0x02
- jne error
- shr R1
- cmp R1, 0x01
- jne error
- shr R1
- cmp R1, 0x00
- jne error
-
- mov R0, 0xC5 ; ROL test
- rol R0
- cmp R0, 0x8B
- jne error
- rol R0
- cmp R0, 0x17
- jne error
- rol R0
- cmp R0, 0x2E
- jne error
- rol R0
- cmp R0, 0x5C
- jne error
- rol R0
- cmp R0, 0xB8
- jne error
- rol R0
- cmp R0, 0x71
- jne error
- rol R0
- cmp R0, 0xE2
- jne error
- rol R0
- cmp R0, 0xC5
- jne error
-
- mov R1, 0x63 ; ROR test
- ror R1
- cmp R1, 0xB1
- jne error
- ror R1
- cmp R1, 0xD8
- jne error
- ror R1
- cmp R1, 0x6C
- jne error
- ror R1
- cmp R1, 0x36
- jne error
- ror R1
- cmp R1, 0x1B
- jne error
- ror R1
- cmp R1, 0x8D
- jne error
- ror R1
- cmp R1, 0xC6
- jne error
- ror R1
- cmp R1, 0x63
- jne error
-
-
- xor R0, R0 ; ROLC generate
- mov R0, 0xC5
- rolc R0
- push R0
- rolc R0
- push R0
- rolc R0
- push R0
- rolc R0
- push R0
- rolc R0
- push R0
- rolc R0
- push R0
- rolc R0
- push R0
- rolc R0
- push R0
- rolc R0
-
- cmp R0, 0xC5 ; ROLC verify
- jne error
- pop R0
- cmp R0, 0x62
- jne error
- pop R0
- cmp R0, 0xB1
- jne error
- pop R0
- cmp R0, 0x58
- jne error
- pop R0
- cmp R0, 0xAC
- jne error
- pop R0
- cmp R0, 0x56
- jne error
- pop R0
- cmp R0, 0x2B
- jne error
- pop R0
- cmp R0, 0x15
- jne error
- pop R0
- cmp R0, 0x8A
- jne error
-
- xor R1, R1 ; RORC generate
- mov R1, 0x63
- rorc R1
- push R1
- rorc R1
- push R1
- rorc R1
- push R1
- rorc R1
- push R1
- rorc R1
- push R1
- rorc R1
- push R1
- rorc R1
- push R1
- rorc R1
- push R1
- rorc R1
-
- cmp R1, 0x63 ; RORC verify
- jne error
- pop R1
- cmp R1, 0xC6
- jne error
- pop R1
- cmp R1, 0x8C
- jne error
- pop R1
- cmp R1, 0x19
- jne error
- pop R1
- cmp R1, 0x33
- jne error
- pop R1
- cmp R1, 0x66
- jne error
- pop R1
- cmp R1, 0xCC
- jne error
- pop R1
- cmp R1, 0x98
- jne error
- pop R1
- cmp R1, 0x31
- jne error
-
- ret
-
-; -------------------------------------------------
-; AND|R|R
-; AND|R|K
-; OR|R|R
-; OR|R|K
-; XOR|R|R
-; XOR|R|K
-test10: mov R0, 0xA5 ; AND
- swap R0
- push R0
- and R0, 0x0F
- cmp R0, 0x0A
- jne error
- pop R0
- push R0
- and R0, 0x0F
- cmp R0, 0x0A
- pop R1
- jne error
- swap R1
- mov R2, 0x0F
- and R1, R2
- cmp R1, 0x05
- jne error
-
- mov R0, 0x05 ; OR
- mov R2, 0xA0
- swap R0
- or R2, R0
- cmp R2, 0xF0
- jne error
- swap R0
- or R0, 0x50
- cmp R0, 0x55
- jne error
-
- mov R1, 0x01
- mov R0, 0x01
- xor R0, 0x01
- jnz error
- xor R0, R1
- cmp R0, 0x01
- jne error
-
- ret
-
-; -------------------------------------------------
-test11:
- mov R0, 0x03
- cout (cpu_int_ctrl), R0
-
- xin R0, (2)
- or R0, 1
- xout (2), R0
- nop
- nop
- nop
- nop
- nop
- nop
- xin R0, (2)
- and R0, 0xFE
- xout (2), R0
- nop
- nop
- nop
- nop
-
- cin R0, (cpu_int_ctrl)
- or R0, 0x80
- cout (cpu_int_ctrl), R0
- nop
- cin R0, (cpu_int_ctrl)
- or R0, 0x80
- cout (cpu_int_ctrl), R0
- nop
- cin R0, (cpu_int_ctrl)
- or R0, 0x80
- cout (cpu_int_ctrl), R0
- nop
- cin R0, (cpu_int_ctrl)
- or R0, 0x80
- cout (cpu_int_ctrl), R0
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- ret
-
-; -------------------------------------------------
-; Tests clrc, setc
-test12: sub R0, 0
- jc error
- setc
- jnc error
- nop
- sub R0, 0
- jc error
-
- mov R0, 0
- clrc
- jc error
- setc
- jnc error
- nop
- clrc
- jc error
- ret
-
-; -------------------------------------------------
-isr: inc R14
- reti
-
-; -------------------------------------------------
- org 0x3FF
-error: jmp error
-
-; -------------------------------------------------
- org 0x2FF
-ok: jmp ok
-
-; -------------------------------------------------
-
\ No newline at end of file
diff --git a/lib/CPUs/JCpu/asm/itest.tcl b/lib/CPUs/JCpu/asm/itest.tcl
deleted file mode 100644
index 3724ca6..0000000
--- a/lib/CPUs/JCpu/asm/itest.tcl
+++ /dev/null
@@ -1,3407 +0,0 @@
-# ----------------------------------------------------------------------
-# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-# This file: The ROM file for upload to target over JTAG
-#
-# Copyright (C) 2007 J. Ahrensfeld
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# For questions and ideas, please contact the author at jens@jayfield.org
-#
-# ---------------------------------------------------------------------
-
-# ---------------------------------------------------------------------
-# For Chipscope 9.1
-# ---------------------------------------------------------------------
-# Source JTAG/TCL frame work
-cd $env(CHIPSCOPE)\\bin\\nt
-source csejtag.tcl
-
-namespace import ::chipscope::*
-
-# Platform USB Cable
-set PLATFORM_USB_CABLE_ARGS [list "port=USB2" "frequency=6000000"]
-# frequency="24000000 | 12000000 | 6000000 | 3000000 | 1500000 | 750000"
-
-# Create session
-set handle [::chipscope::csejtag_session create 0]
-
-# Open JTAG and lock
-set open_result [::chipscope::csejtag_target open $handle $CSEJTAG_TARGET_PLATFORMUSB 0 $PLATFORM_USB_CABLE_ARGS]
-set lock_result [::chipscope::csejtag_target lock $handle 1000]
-
-set devlist [::chipscope::csejtag_tap autodetect_chain $handle $CSEJTAG_SCAN_DEFAULT]
-
-# Get Device ID
-set devtype "Virtex-4SX"
-set devid 2
-set irlength [::chipscope::csejtag_tap get_irlength $handle $devid]
-set idcode [::chipscope::csejtag_tap get_device_idcode $handle $devid]
-
-set CSE_OP $CSEJTAG_SHIFT_READWRITE
-set CSE_ES $CSEJTAG_RUN_TEST_IDLE
-
-# Write Program
-# JASM_ROM_INSERT_HERE
-# Assembled from itest.jsm
-# ---------------------------------------------------------------
-# Shift the USER2 Instruction (b1111000010) into the Instruction Register of FPGA
-# User 1
-set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C2"]
-
-# 0x000: JMP 0x010
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00030010"
-
-# 0x001: JMP 0x288
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00130288"
-
-# 0x002:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00200000"
-
-# 0x003:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00300000"
-
-# 0x004:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00400000"
-
-# 0x005:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00500000"
-
-# 0x006:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00600000"
-
-# 0x007:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00700000"
-
-# 0x008:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00800000"
-
-# 0x009:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00900000"
-
-# 0x00A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00A00000"
-
-# 0x00B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00B00000"
-
-# 0x00C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00C00000"
-
-# 0x00D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00D00000"
-
-# 0x00E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00E00000"
-
-# 0x00F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00F00000"
-
-# 0x010: CALL 0x03B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0103B03B"
-
-# 0x011: CIN R00, (0x00)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01129000"
-
-# 0x012: XOUT (0x00), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01224000"
-
-# 0x013: CALL 0x04C
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0133B04C"
-
-# 0x014: MOV R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01403010"
-
-# 0x015: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01524010"
-
-# 0x016: CALL 0x08D
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0163B08D"
-
-# 0x017: MOV R00, 0x02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01703020"
-
-# 0x018: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01824010"
-
-# 0x019: CALL 0x0C9
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0193B0C9"
-
-# 0x01A: MOV R00, 0x03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01A03030"
-
-# 0x01B: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01B24010"
-
-# 0x01C: CALL 0x0DB
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01C3B0DB"
-
-# 0x01D: MOV R00, 0x04
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01D03040"
-
-# 0x01E: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01E24010"
-
-# 0x01F: CALL 0x0ED
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01F3B0ED"
-
-# 0x020: MOV R00, 0x05
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02003050"
-
-# 0x021: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02124010"
-
-# 0x022: CALL 0x0FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0223B0FF"
-
-# 0x023: MOV R00, 0x06
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02303060"
-
-# 0x024: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02424010"
-
-# 0x025: CALL 0x115
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0253B115"
-
-# 0x026: MOV R00, 0x07
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02603070"
-
-# 0x027: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02724010"
-
-# 0x028: CALL 0x12B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0283B12B"
-
-# 0x029: MOV R00, 0x08
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02903080"
-
-# 0x02A: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02A24010"
-
-# 0x02B: CALL 0x137
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02B3B137"
-
-# 0x02C: MOV R00, 0x09
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02C03090"
-
-# 0x02D: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02D24010"
-
-# 0x02E: CALL 0x15A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02E3B15A"
-
-# 0x02F: MOV R00, 0x0A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "02F030A0"
-
-# 0x030: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03024010"
-
-# 0x031: CALL 0x22A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0313B22A"
-
-# 0x032: MOV R00, 0x0B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "032030B0"
-
-# 0x033: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03324010"
-
-# 0x034: CALL 0x24D
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0343B24D"
-
-# 0x035: MOV R00, 0x0C
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "035030C0"
-
-# 0x036: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03624010"
-
-# 0x037: CALL 0x278
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0373B278"
-
-# 0x038: MOV R00, 0xFF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03803FF0"
-
-# 0x039: XOUT (0x01), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03924010"
-
-# 0x03A: JMP 0x2FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03A302FF"
-
-# 0x03B: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03B03000"
-
-# 0x03C: MOV R01, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03C03001"
-
-# 0x03D: MOV R02, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03D03002"
-
-# 0x03E: MOV R03, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03E03003"
-
-# 0x03F: MOV R04, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "03F03004"
-
-# 0x040: MOV R05, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04003005"
-
-# 0x041: MOV R06, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04103006"
-
-# 0x042: MOV R07, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04203007"
-
-# 0x043: MOV R08, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04303008"
-
-# 0x044: MOV R09, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04403009"
-
-# 0x045: MOV R10, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0450300A"
-
-# 0x046: MOV R11, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0460300B"
-
-# 0x047: MOV R12, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0470300C"
-
-# 0x048: MOV R13, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0480300D"
-
-# 0x049: MOV R14, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0490300E"
-
-# 0x04A: MOV R15, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04A0300F"
-
-# 0x04B: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04B3E000"
-
-# 0x04C: MOV R00, 0x10
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04C03100"
-
-# 0x04D: CMP R00, 0x10
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04D0F100"
-
-# 0x04E: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04E3A3FF"
-
-# 0x04F: ADD R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "04F11010"
-
-# 0x050: MOV R01, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05002001"
-
-# 0x051: CMP R01, 0x11
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0510F111"
-
-# 0x052: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0523A3FF"
-
-# 0x053: ADD R01, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05311011"
-
-# 0x054: MOV R02, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05402012"
-
-# 0x055: CMP R02, 0x12
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0550F122"
-
-# 0x056: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0563A3FF"
-
-# 0x057: ADD R02, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05711012"
-
-# 0x058: MOV R03, R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05802023"
-
-# 0x059: CMP R03, 0x13
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0590F133"
-
-# 0x05A: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05A3A3FF"
-
-# 0x05B: ADD R03, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05B11013"
-
-# 0x05C: MOV R04, R03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05C02034"
-
-# 0x05D: CMP R04, 0x14
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05D0F144"
-
-# 0x05E: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05E3A3FF"
-
-# 0x05F: ADD R04, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "05F11014"
-
-# 0x060: MOV R05, R04
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06002045"
-
-# 0x061: CMP R05, 0x15
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0610F155"
-
-# 0x062: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0623A3FF"
-
-# 0x063: ADD R05, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06311015"
-
-# 0x064: MOV R06, R05
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06402056"
-
-# 0x065: CMP R06, 0x16
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0650F166"
-
-# 0x066: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0663A3FF"
-
-# 0x067: ADD R06, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06711016"
-
-# 0x068: MOV R07, R06
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06802067"
-
-# 0x069: CMP R07, 0x17
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0690F177"
-
-# 0x06A: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06A3A3FF"
-
-# 0x06B: ADD R07, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06B11017"
-
-# 0x06C: MOV R08, R07
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06C02078"
-
-# 0x06D: CMP R08, 0x18
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06D0F188"
-
-# 0x06E: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06E3A3FF"
-
-# 0x06F: ADD R08, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "06F11018"
-
-# 0x070: MOV R09, R08
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07002089"
-
-# 0x071: CMP R09, 0x19
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0710F199"
-
-# 0x072: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0723A3FF"
-
-# 0x073: ADD R09, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07311019"
-
-# 0x074: MOV R10, R09
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0740209A"
-
-# 0x075: CMP R10, 0x1A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0750F1AA"
-
-# 0x076: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0763A3FF"
-
-# 0x077: ADD R10, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0771101A"
-
-# 0x078: MOV R11, R10
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "078020AB"
-
-# 0x079: CMP R11, 0x1B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0790F1BB"
-
-# 0x07A: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07A3A3FF"
-
-# 0x07B: ADD R11, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07B1101B"
-
-# 0x07C: MOV R12, R11
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07C020BC"
-
-# 0x07D: CMP R12, 0x1C
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07D0F1CC"
-
-# 0x07E: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07E3A3FF"
-
-# 0x07F: ADD R12, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "07F1101C"
-
-# 0x080: MOV R13, R12
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "080020CD"
-
-# 0x081: CMP R13, 0x1D
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0810F1DD"
-
-# 0x082: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0823A3FF"
-
-# 0x083: ADD R13, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0831101D"
-
-# 0x084: MOV R14, R13
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "084020DE"
-
-# 0x085: CMP R14, 0x1E
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0850F1EE"
-
-# 0x086: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0863A3FF"
-
-# 0x087: ADD R14, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0871101E"
-
-# 0x088: MOV R15, R14
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "088020EF"
-
-# 0x089: CMP R15, 0x1F
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0890F1FF"
-
-# 0x08A: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "08A3A3FF"
-
-# 0x08B: ADD R15, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "08B1101F"
-
-# 0x08C: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "08C3E000"
-
-# 0x08D: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "08D03000"
-
-# 0x08E: TST R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "08E0F000"
-
-# 0x08F: JNZ 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "08F323FF"
-
-# 0x090: JC 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "090333FF"
-
-# 0x091: CMP R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0910F000"
-
-# 0x092: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0923A3FF"
-
-# 0x093: JLT 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "093353FF"
-
-# 0x094: JGT 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "094363FF"
-
-# 0x095: JLE 0x097
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "09537097"
-
-# 0x096: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "096303FF"
-
-# 0x097: JEQ 0x099
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "09739099"
-
-# 0x098: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "098303FF"
-
-# 0x099: JGE 0x09B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0993809B"
-
-# 0x09A: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "09A303FF"
-
-# 0x09B: CMP R00, 0x55
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "09B0F550"
-
-# 0x09C: JEQ 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "09C393FF"
-
-# 0x09D: JLT 0x09F
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "09D3509F"
-
-# 0x09E: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "09E303FF"
-
-# 0x09F: JLE 0x0A1
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "09F370A1"
-
-# 0x0A0: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A0303FF"
-
-# 0x0A1: JGE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A1383FF"
-
-# 0x0A2: JGT 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A2363FF"
-
-# 0x0A3: MOV R00, 0x55
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A303550"
-
-# 0x0A4: TST R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A40F000"
-
-# 0x0A5: JZ 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A5313FF"
-
-# 0x0A6: JC 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A6333FF"
-
-# 0x0A7: CMP R00, 0xAA
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A70FAA0"
-
-# 0x0A8: JEQ 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A8393FF"
-
-# 0x0A9: JNE 0x0AB
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0A93A0AB"
-
-# 0x0AA: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0AA303FF"
-
-# 0x0AB: JLT 0x0AD
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0AB350AD"
-
-# 0x0AC: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0AC303FF"
-
-# 0x0AD: JLE 0x0AF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0AD370AF"
-
-# 0x0AE: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0AE303FF"
-
-# 0x0AF: JGT 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0AF363FF"
-
-# 0x0B0: CMP R00, 0x55
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B00F550"
-
-# 0x0B1: JEQ 0x0B3
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B1390B3"
-
-# 0x0B2: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B2303FF"
-
-# 0x0B3: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B33A3FF"
-
-# 0x0B4: JLT 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B4353FF"
-
-# 0x0B5: JLE 0x0B7
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B5370B7"
-
-# 0x0B6: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B6303FF"
-
-# 0x0B7: JGT 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B7363FF"
-
-# 0x0B8: JGE 0x0BA
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B8380BA"
-
-# 0x0B9: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0B9303FF"
-
-# 0x0BA: MOV R00, 0xAA
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0BA03AA0"
-
-# 0x0BB: TST R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0BB0F000"
-
-# 0x0BC: JZ 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0BC313FF"
-
-# 0x0BD: JC 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0BD333FF"
-
-# 0x0BE: CMP R00, 0x55
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0BE0F550"
-
-# 0x0BF: JEQ 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0BF393FF"
-
-# 0x0C0: JNE 0x0C2
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C03A0C2"
-
-# 0x0C1: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C1303FF"
-
-# 0x0C2: JGT 0x0C4
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C2360C4"
-
-# 0x0C3: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C3303FF"
-
-# 0x0C4: JGE 0x0C6
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C4380C6"
-
-# 0x0C5: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C5303FF"
-
-# 0x0C6: JLT 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C6353FF"
-
-# 0x0C7: JLE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C7373FF"
-
-# 0x0C8: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C83E000"
-
-# 0x0C9: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0C903000"
-
-# 0x0CA: MOV R01, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0CA03001"
-
-# 0x0CB: MOV R02, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0CB02002"
-
-# 0x0CC: MOV R03, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0CC02013"
-
-# 0x0CD: ADD R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0CD11010"
-
-# 0x0CE: ADDC R01, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0CE13001"
-
-# 0x0CF: ADD R02, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0CF11012"
-
-# 0x0D0: CMP R02, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D00F002"
-
-# 0x0D1: JNE 0x0D4
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D13A0D4"
-
-# 0x0D2: ADD R03, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D211013"
-
-# 0x0D3: CMP R03, 0x02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D30F023"
-
-# 0x0D4: JNE 0x0CD
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D43A0CD"
-
-# 0x0D5: CMP R00, R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D50E020"
-
-# 0x0D6: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D63A3FF"
-
-# 0x0D7: CMP R01, R03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D70E031"
-
-# 0x0D8: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D83A3FF"
-
-# 0x0D9: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0D903000"
-
-# 0x0DA: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0DA3E000"
-
-# 0x0DB: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0DB03000"
-
-# 0x0DC: MOV R01, 0x03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0DC03031"
-
-# 0x0DD: MOV R02, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0DD02002"
-
-# 0x0DE: MOV R03, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0DE02013"
-
-# 0x0DF: SUB R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0DF15010"
-
-# 0x0E0: SUBC R01, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E017001"
-
-# 0x0E1: SUB R02, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E115012"
-
-# 0x0E2: CMP R02, 0xFF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E20FFF2"
-
-# 0x0E3: JNE 0x0E6
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E33A0E6"
-
-# 0x0E4: SUB R03, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E415013"
-
-# 0x0E5: CMP R03, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E50F003"
-
-# 0x0E6: JNE 0x0DF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E63A0DF"
-
-# 0x0E7: CMP R00, R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E70E020"
-
-# 0x0E8: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E83A3FF"
-
-# 0x0E9: CMP R01, R03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0E90E031"
-
-# 0x0EA: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0EA3A3FF"
-
-# 0x0EB: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0EB03000"
-
-# 0x0EC: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0EC3E000"
-
-# 0x0ED: MOV R00, 0x03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0ED03030"
-
-# 0x0EE: MOV R01, 0x05
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0EE03051"
-
-# 0x0EF: SUB 0x05, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0EF2E050"
-
-# 0x0F0: SUB R01, 0x03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F015031"
-
-# 0x0F1: CMP R00, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F10E010"
-
-# 0x0F2: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F23A3FF"
-
-# 0x0F3: MOV R00, 0x03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F303030"
-
-# 0x0F4: MOV R01, 0x05
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F403051"
-
-# 0x0F5: SUB R00, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F514010"
-
-# 0x0F6: SUBC 0x00, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F62F000"
-
-# 0x0F7: CMP R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F70F010"
-
-# 0x0F8: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F83A3FF"
-
-# 0x0F9: ADD R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0F911000"
-
-# 0x0FA: SUBC R01, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0FA16001"
-
-# 0x0FB: CMP R01, 0x04
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0FB0F041"
-
-# 0x0FC: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0FC3A3FF"
-
-# 0x0FD: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0FD03000"
-
-# 0x0FE: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0FE3E000"
-
-# 0x0FF: MOV R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0FF03010"
-
-# 0x100: MOVC (0x5A), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1000D5A0"
-
-# 0x101: DEC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10115010"
-
-# 0x102: MOVC (0x00), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1020D000"
-
-# 0x103: MOVC R01, (0x5A)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1030A5A1"
-
-# 0x104: MOVC (R01), 0xA5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1040CA51"
-
-# 0x105: MOVC R00, (R01)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10509010"
-
-# 0x106: MOVC R01, (R01)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10609011"
-
-# 0x107: ADD R01, 0x5A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "107115A1"
-
-# 0x108: MOVC R00, (R01)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10809010"
-
-# 0x109: MOVC (R00), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1090B000"
-
-# 0x10A: MOVC R02, (R00)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10A09002"
-
-# 0x10B: CMP R02, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10B0E002"
-
-# 0x10C: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10C3A3FF"
-
-# 0x10D: MOVC (R01), R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10D0B021"
-
-# 0x10E: MOVC R02, (R02)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10E09022"
-
-# 0x10F: CMP R02, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "10F0E012"
-
-# 0x110: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1103A3FF"
-
-# 0x111: DEC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11115011"
-
-# 0x112: INC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11211010"
-
-# 0x113: JNZ 0x109
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11332109"
-
-# 0x114: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1143E000"
-
-# 0x115: MOV R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11503010"
-
-# 0x116: MOVX (0x60), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11608600"
-
-# 0x117: DEC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11715010"
-
-# 0x118: MOVX (0x06), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11808060"
-
-# 0x119: MOVX R01, (0x60)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11905601"
-
-# 0x11A: MOVX (R01), 0xA5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11A07A51"
-
-# 0x11B: MOVX R00, (R01)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11B04010"
-
-# 0x11C: MOVX R01, (R01)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11C04011"
-
-# 0x11D: ADD R01, 0x5A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11D115A1"
-
-# 0x11E: MOVX R00, (R01)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11E04010"
-
-# 0x11F: MOVX (R00), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "11F06000"
-
-# 0x120: MOVX R02, (R00)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12004002"
-
-# 0x121: CMP R02, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1210E002"
-
-# 0x122: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1223A3FF"
-
-# 0x123: MOVX (R01), R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12306021"
-
-# 0x124: MOVX R02, (R02)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12404022"
-
-# 0x125: CMP R02, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1250E012"
-
-# 0x126: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1263A3FF"
-
-# 0x127: DEC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12715011"
-
-# 0x128: INC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12811010"
-
-# 0x129: JNZ 0x11F
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1293211F"
-
-# 0x12A: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12A3E000"
-
-# 0x12B: MOV R00, 0xAA
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12B03AA0"
-
-# 0x12C: MOV R01, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12C03001"
-
-# 0x12D: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12D3C000"
-
-# 0x12E: INC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12E11010"
-
-# 0x12F: DEC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "12F15011"
-
-# 0x130: JNZ 0x12D
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1303212D"
-
-# 0x131: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1313D000"
-
-# 0x132: DEC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13215011"
-
-# 0x133: JNZ 0x131
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13332131"
-
-# 0x134: CMP R00, 0xAA
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1340FAA0"
-
-# 0x135: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1353A3FF"
-
-# 0x136: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1363E000"
-
-# 0x137: MOV R00, 0x55
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13703550"
-
-# 0x138: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1383C000"
-
-# 0x139: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13903000"
-
-# 0x13A: MOV R01, 0xFF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13A03FF1"
-
-# 0x13B: CALL 0x151
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13B3B151"
-
-# 0x13C: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13C3D000"
-
-# 0x13D: CMP R00, 0x55
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13D0F550"
-
-# 0x13E: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13E3A3FF"
-
-# 0x13F: MOV R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "13F03010"
-
-# 0x140: MOV R01, 0x48
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14003481"
-
-# 0x141: COUT (0x05), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14126050"
-
-# 0x142: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1423C001"
-
-# 0x143: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14303000"
-
-# 0x144: MOV R01, 0x3B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "144033B1"
-
-# 0x145: COUT (0x05), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14526050"
-
-# 0x146: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1463C001"
-
-# 0x147: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1473E000"
-
-# 0x148: MOV R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14803010"
-
-# 0x149: MOV R01, 0x50
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14903501"
-
-# 0x14A: COUT (0x05), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14A26050"
-
-# 0x14B: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14B3C001"
-
-# 0x14C: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14C03000"
-
-# 0x14D: MOV R01, 0x3B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14D033B1"
-
-# 0x14E: COUT (0x05), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14E26050"
-
-# 0x14F: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "14F3C001"
-
-# 0x150: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1503E000"
-
-# 0x151: CMP R00, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1510E010"
-
-# 0x152: JEQ 0x155
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15239155"
-
-# 0x153: INC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15311010"
-
-# 0x154: JMP 0x158
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15430158"
-
-# 0x155: DEC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15515010"
-
-# 0x156: DEC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15615011"
-
-# 0x157: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1573E000"
-
-# 0x158: CALL 0x151
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1583B151"
-
-# 0x159: JMP 0x155
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15930155"
-
-# 0x15A: MOV R00, 0xA5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15A03A50"
-
-# 0x15B: MOV R01, 0x5A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15B035A1"
-
-# 0x15C: SWAP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15C2A000"
-
-# 0x15D: CMP R00, 0x5A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15D0F5A0"
-
-# 0x15E: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15E3A3FF"
-
-# 0x15F: SWAP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "15F2A000"
-
-# 0x160: CMP R00, 0xA5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1600FA50"
-
-# 0x161: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1613A3FF"
-
-# 0x162: MOV R00, 0xD2
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "16203D20"
-
-# 0x163: SWAP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1632A000"
-
-# 0x164: CMP R00, 0x2D
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1640F2D0"
-
-# 0x165: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1653A3FF"
-
-# 0x166: SWAP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1662A001"
-
-# 0x167: CMP R00, 0x2D
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1670F2D0"
-
-# 0x168: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1683A3FF"
-
-# 0x169: CMP R01, 0xA5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1690FA51"
-
-# 0x16A: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "16A3A3FF"
-
-# 0x16B: MOV R00, 0x2D
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "16B032D0"
-
-# 0x16C: SHL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "16C1E000"
-
-# 0x16D: CMP R00, 0x5A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "16D0F5A0"
-
-# 0x16E: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "16E3A3FF"
-
-# 0x16F: SHL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "16F1E000"
-
-# 0x170: CMP R00, 0xB4
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1700FB40"
-
-# 0x171: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1713A3FF"
-
-# 0x172: SHL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1721E000"
-
-# 0x173: CMP R00, 0x68
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1730F680"
-
-# 0x174: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1743A3FF"
-
-# 0x175: SHL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1751E000"
-
-# 0x176: CMP R00, 0xD0
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1760FD00"
-
-# 0x177: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1773A3FF"
-
-# 0x178: SHL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1781E000"
-
-# 0x179: CMP R00, 0xA0
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1790FA00"
-
-# 0x17A: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "17A3A3FF"
-
-# 0x17B: SHL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "17B1E000"
-
-# 0x17C: CMP R00, 0x40
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "17C0F400"
-
-# 0x17D: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "17D3A3FF"
-
-# 0x17E: SHL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "17E1E000"
-
-# 0x17F: CMP R00, 0x80
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "17F0F800"
-
-# 0x180: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1803A3FF"
-
-# 0x181: SHL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1811E000"
-
-# 0x182: CMP R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1820F000"
-
-# 0x183: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1833A3FF"
-
-# 0x184: MOV R01, 0x84
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "18403841"
-
-# 0x185: SHR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1851F001"
-
-# 0x186: CMP R01, 0x42
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1860F421"
-
-# 0x187: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1873A3FF"
-
-# 0x188: SHR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1881F001"
-
-# 0x189: CMP R01, 0x21
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1890F211"
-
-# 0x18A: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "18A3A3FF"
-
-# 0x18B: SHR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "18B1F001"
-
-# 0x18C: CMP R01, 0x10
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "18C0F101"
-
-# 0x18D: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "18D3A3FF"
-
-# 0x18E: SHR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "18E1F001"
-
-# 0x18F: CMP R01, 0x08
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "18F0F081"
-
-# 0x190: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1903A3FF"
-
-# 0x191: SHR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1911F001"
-
-# 0x192: CMP R01, 0x04
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1920F041"
-
-# 0x193: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1933A3FF"
-
-# 0x194: SHR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1941F001"
-
-# 0x195: CMP R01, 0x02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1950F021"
-
-# 0x196: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1963A3FF"
-
-# 0x197: SHR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1971F001"
-
-# 0x198: CMP R01, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1980F011"
-
-# 0x199: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1993A3FF"
-
-# 0x19A: SHR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "19A1F001"
-
-# 0x19B: CMP R01, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "19B0F001"
-
-# 0x19C: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "19C3A3FF"
-
-# 0x19D: MOV R00, 0xC5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "19D03C50"
-
-# 0x19E: ROL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "19E20000"
-
-# 0x19F: CMP R00, 0x8B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "19F0F8B0"
-
-# 0x1A0: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A03A3FF"
-
-# 0x1A1: ROL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A120000"
-
-# 0x1A2: CMP R00, 0x17
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A20F170"
-
-# 0x1A3: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A33A3FF"
-
-# 0x1A4: ROL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A420000"
-
-# 0x1A5: CMP R00, 0x2E
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A50F2E0"
-
-# 0x1A6: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A63A3FF"
-
-# 0x1A7: ROL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A720000"
-
-# 0x1A8: CMP R00, 0x5C
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A80F5C0"
-
-# 0x1A9: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1A93A3FF"
-
-# 0x1AA: ROL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1AA20000"
-
-# 0x1AB: CMP R00, 0xB8
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1AB0FB80"
-
-# 0x1AC: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1AC3A3FF"
-
-# 0x1AD: ROL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1AD20000"
-
-# 0x1AE: CMP R00, 0x71
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1AE0F710"
-
-# 0x1AF: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1AF3A3FF"
-
-# 0x1B0: ROL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B020000"
-
-# 0x1B1: CMP R00, 0xE2
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B10FE20"
-
-# 0x1B2: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B23A3FF"
-
-# 0x1B3: ROL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B320000"
-
-# 0x1B4: CMP R00, 0xC5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B40FC50"
-
-# 0x1B5: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B53A3FF"
-
-# 0x1B6: MOV R01, 0x63
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B603631"
-
-# 0x1B7: ROR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B721001"
-
-# 0x1B8: CMP R01, 0xB1
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B80FB11"
-
-# 0x1B9: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1B93A3FF"
-
-# 0x1BA: ROR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1BA21001"
-
-# 0x1BB: CMP R01, 0xD8
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1BB0FD81"
-
-# 0x1BC: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1BC3A3FF"
-
-# 0x1BD: ROR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1BD21001"
-
-# 0x1BE: CMP R01, 0x6C
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1BE0F6C1"
-
-# 0x1BF: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1BF3A3FF"
-
-# 0x1C0: ROR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C021001"
-
-# 0x1C1: CMP R01, 0x36
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C10F361"
-
-# 0x1C2: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C23A3FF"
-
-# 0x1C3: ROR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C321001"
-
-# 0x1C4: CMP R01, 0x1B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C40F1B1"
-
-# 0x1C5: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C53A3FF"
-
-# 0x1C6: ROR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C621001"
-
-# 0x1C7: CMP R01, 0x8D
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C70F8D1"
-
-# 0x1C8: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C83A3FF"
-
-# 0x1C9: ROR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1C921001"
-
-# 0x1CA: CMP R01, 0xC6
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1CA0FC61"
-
-# 0x1CB: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1CB3A3FF"
-
-# 0x1CC: ROR R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1CC21001"
-
-# 0x1CD: CMP R01, 0x63
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1CD0F631"
-
-# 0x1CE: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1CE3A3FF"
-
-# 0x1CF: XOR R00, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1CF1C000"
-
-# 0x1D0: MOV R00, 0xC5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D003C50"
-
-# 0x1D1: ROLC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D122000"
-
-# 0x1D2: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D23C000"
-
-# 0x1D3: ROLC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D322000"
-
-# 0x1D4: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D43C000"
-
-# 0x1D5: ROLC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D522000"
-
-# 0x1D6: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D63C000"
-
-# 0x1D7: ROLC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D722000"
-
-# 0x1D8: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D83C000"
-
-# 0x1D9: ROLC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1D922000"
-
-# 0x1DA: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1DA3C000"
-
-# 0x1DB: ROLC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1DB22000"
-
-# 0x1DC: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1DC3C000"
-
-# 0x1DD: ROLC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1DD22000"
-
-# 0x1DE: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1DE3C000"
-
-# 0x1DF: ROLC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1DF22000"
-
-# 0x1E0: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E03C000"
-
-# 0x1E1: ROLC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E122000"
-
-# 0x1E2: CMP R00, 0xC5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E20FC50"
-
-# 0x1E3: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E33A3FF"
-
-# 0x1E4: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E43D000"
-
-# 0x1E5: CMP R00, 0x62
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E50F620"
-
-# 0x1E6: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E63A3FF"
-
-# 0x1E7: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E73D000"
-
-# 0x1E8: CMP R00, 0xB1
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E80FB10"
-
-# 0x1E9: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1E93A3FF"
-
-# 0x1EA: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1EA3D000"
-
-# 0x1EB: CMP R00, 0x58
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1EB0F580"
-
-# 0x1EC: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1EC3A3FF"
-
-# 0x1ED: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1ED3D000"
-
-# 0x1EE: CMP R00, 0xAC
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1EE0FAC0"
-
-# 0x1EF: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1EF3A3FF"
-
-# 0x1F0: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F03D000"
-
-# 0x1F1: CMP R00, 0x56
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F10F560"
-
-# 0x1F2: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F23A3FF"
-
-# 0x1F3: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F33D000"
-
-# 0x1F4: CMP R00, 0x2B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F40F2B0"
-
-# 0x1F5: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F53A3FF"
-
-# 0x1F6: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F63D000"
-
-# 0x1F7: CMP R00, 0x15
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F70F150"
-
-# 0x1F8: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F83A3FF"
-
-# 0x1F9: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1F93D000"
-
-# 0x1FA: CMP R00, 0x8A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1FA0F8A0"
-
-# 0x1FB: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1FB3A3FF"
-
-# 0x1FC: XOR R01, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1FC1C011"
-
-# 0x1FD: MOV R01, 0x63
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1FD03631"
-
-# 0x1FE: RORC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1FE23001"
-
-# 0x1FF: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "1FF3C001"
-
-# 0x200: RORC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20023001"
-
-# 0x201: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2013C001"
-
-# 0x202: RORC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20223001"
-
-# 0x203: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2033C001"
-
-# 0x204: RORC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20423001"
-
-# 0x205: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2053C001"
-
-# 0x206: RORC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20623001"
-
-# 0x207: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2073C001"
-
-# 0x208: RORC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20823001"
-
-# 0x209: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2093C001"
-
-# 0x20A: RORC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20A23001"
-
-# 0x20B: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20B3C001"
-
-# 0x20C: RORC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20C23001"
-
-# 0x20D: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20D3C001"
-
-# 0x20E: RORC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20E23001"
-
-# 0x20F: CMP R01, 0x63
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "20F0F631"
-
-# 0x210: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2103A3FF"
-
-# 0x211: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2113D001"
-
-# 0x212: CMP R01, 0xC6
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2120FC61"
-
-# 0x213: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2133A3FF"
-
-# 0x214: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2143D001"
-
-# 0x215: CMP R01, 0x8C
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2150F8C1"
-
-# 0x216: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2163A3FF"
-
-# 0x217: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2173D001"
-
-# 0x218: CMP R01, 0x19
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2180F191"
-
-# 0x219: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2193A3FF"
-
-# 0x21A: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "21A3D001"
-
-# 0x21B: CMP R01, 0x33
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "21B0F331"
-
-# 0x21C: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "21C3A3FF"
-
-# 0x21D: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "21D3D001"
-
-# 0x21E: CMP R01, 0x66
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "21E0F661"
-
-# 0x21F: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "21F3A3FF"
-
-# 0x220: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2203D001"
-
-# 0x221: CMP R01, 0xCC
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2210FCC1"
-
-# 0x222: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2223A3FF"
-
-# 0x223: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2233D001"
-
-# 0x224: CMP R01, 0x98
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2240F981"
-
-# 0x225: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2253A3FF"
-
-# 0x226: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2263D001"
-
-# 0x227: CMP R01, 0x31
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2270F311"
-
-# 0x228: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2283A3FF"
-
-# 0x229: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2293E000"
-
-# 0x22A: MOV R00, 0xA5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "22A03A50"
-
-# 0x22B: SWAP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "22B2A000"
-
-# 0x22C: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "22C3C000"
-
-# 0x22D: AND R00, 0x0F
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "22D190F0"
-
-# 0x22E: CMP R00, 0x0A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "22E0F0A0"
-
-# 0x22F: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "22F3A3FF"
-
-# 0x230: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2303D000"
-
-# 0x231: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2313C000"
-
-# 0x232: AND R00, 0x0F
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "232190F0"
-
-# 0x233: CMP R00, 0x0A
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2330F0A0"
-
-# 0x234: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2343D001"
-
-# 0x235: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2353A3FF"
-
-# 0x236: SWAP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2362A001"
-
-# 0x237: MOV R02, 0x0F
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "237030F2"
-
-# 0x238: AND R01, R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "23818021"
-
-# 0x239: CMP R01, 0x05
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2390F051"
-
-# 0x23A: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "23A3A3FF"
-
-# 0x23B: MOV R00, 0x05
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "23B03050"
-
-# 0x23C: MOV R02, 0xA0
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "23C03A02"
-
-# 0x23D: SWAP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "23D2A000"
-
-# 0x23E: OR R02, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "23E1A002"
-
-# 0x23F: CMP R02, 0xF0
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "23F0FF02"
-
-# 0x240: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2403A3FF"
-
-# 0x241: SWAP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2412A000"
-
-# 0x242: OR R00, 0x50
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2421B500"
-
-# 0x243: CMP R00, 0x55
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2430F550"
-
-# 0x244: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2443A3FF"
-
-# 0x245: MOV R01, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "24503011"
-
-# 0x246: MOV R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "24603010"
-
-# 0x247: XOR R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2471D010"
-
-# 0x248: JNZ 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "248323FF"
-
-# 0x249: XOR R00, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2491C010"
-
-# 0x24A: CMP R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "24A0F010"
-
-# 0x24B: JNE 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "24B3A3FF"
-
-# 0x24C: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "24C3E000"
-
-# 0x24D: MOV R00, 0x03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "24D03030"
-
-# 0x24E: COUT (0x03), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "24E26030"
-
-# 0x24F: XIN R00, (0x02)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "24F28020"
-
-# 0x250: OR R00, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2501B010"
-
-# 0x251: XOUT (0x02), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25124020"
-
-# 0x252: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25200000"
-
-# 0x253: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25300000"
-
-# 0x254: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25400000"
-
-# 0x255: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25500000"
-
-# 0x256: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25600000"
-
-# 0x257: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25700000"
-
-# 0x258: XIN R00, (0x02)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25828020"
-
-# 0x259: AND R00, 0xFE
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25919FE0"
-
-# 0x25A: XOUT (0x02), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25A24020"
-
-# 0x25B: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25B00000"
-
-# 0x25C: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25C00000"
-
-# 0x25D: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25D00000"
-
-# 0x25E: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25E00000"
-
-# 0x25F: CIN R00, (0x03)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "25F29030"
-
-# 0x260: OR R00, 0x80
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2601B800"
-
-# 0x261: COUT (0x03), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26126030"
-
-# 0x262: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26200000"
-
-# 0x263: CIN R00, (0x03)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26329030"
-
-# 0x264: OR R00, 0x80
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2641B800"
-
-# 0x265: COUT (0x03), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26526030"
-
-# 0x266: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26600000"
-
-# 0x267: CIN R00, (0x03)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26729030"
-
-# 0x268: OR R00, 0x80
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2681B800"
-
-# 0x269: COUT (0x03), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26926030"
-
-# 0x26A: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26A00000"
-
-# 0x26B: CIN R00, (0x03)
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26B29030"
-
-# 0x26C: OR R00, 0x80
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26C1B800"
-
-# 0x26D: COUT (0x03), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26D26030"
-
-# 0x26E: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26E00000"
-
-# 0x26F: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "26F00000"
-
-# 0x270: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27000000"
-
-# 0x271: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27100000"
-
-# 0x272: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27200000"
-
-# 0x273: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27300000"
-
-# 0x274: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27400000"
-
-# 0x275: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27500000"
-
-# 0x276: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27600000"
-
-# 0x277: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2773E000"
-
-# 0x278: SUB R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27815000"
-
-# 0x279: JC 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "279333FF"
-
-# 0x27A: SETC
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27A2B000"
-
-# 0x27B: JNC 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27B343FF"
-
-# 0x27C: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27C00000"
-
-# 0x27D: SUB R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27D15000"
-
-# 0x27E: JC 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27E333FF"
-
-# 0x27F: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "27F03000"
-
-# 0x280: CLRC
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "28015000"
-
-# 0x281: JC 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "281333FF"
-
-# 0x282: SETC
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2822B000"
-
-# 0x283: JNC 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "283343FF"
-
-# 0x284: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "28400000"
-
-# 0x285: CLRC
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "28515000"
-
-# 0x286: JC 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "286333FF"
-
-# 0x287: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2873E000"
-
-# 0x288: INC R14
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2881101E"
-
-# 0x289: RETI
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2893F000"
-
-# 0x28A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "28A00000"
-
-# 0x28B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "28B00000"
-
-# 0x28C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "28C00000"
-
-# 0x28D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "28D00000"
-
-# 0x28E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "28E00000"
-
-# 0x28F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "28F00000"
-
-# 0x290:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29000000"
-
-# 0x291:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29100000"
-
-# 0x292:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29200000"
-
-# 0x293:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29300000"
-
-# 0x294:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29400000"
-
-# 0x295:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29500000"
-
-# 0x296:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29600000"
-
-# 0x297:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29700000"
-
-# 0x298:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29800000"
-
-# 0x299:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29900000"
-
-# 0x29A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29A00000"
-
-# 0x29B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29B00000"
-
-# 0x29C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29C00000"
-
-# 0x29D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29D00000"
-
-# 0x29E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29E00000"
-
-# 0x29F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "29F00000"
-
-# 0x2A0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A000000"
-
-# 0x2A1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A100000"
-
-# 0x2A2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A200000"
-
-# 0x2A3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A300000"
-
-# 0x2A4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A400000"
-
-# 0x2A5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A500000"
-
-# 0x2A6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A600000"
-
-# 0x2A7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A700000"
-
-# 0x2A8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A800000"
-
-# 0x2A9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2A900000"
-
-# 0x2AA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2AA00000"
-
-# 0x2AB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2AB00000"
-
-# 0x2AC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2AC00000"
-
-# 0x2AD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2AD00000"
-
-# 0x2AE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2AE00000"
-
-# 0x2AF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2AF00000"
-
-# 0x2B0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B000000"
-
-# 0x2B1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B100000"
-
-# 0x2B2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B200000"
-
-# 0x2B3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B300000"
-
-# 0x2B4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B400000"
-
-# 0x2B5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B500000"
-
-# 0x2B6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B600000"
-
-# 0x2B7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B700000"
-
-# 0x2B8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B800000"
-
-# 0x2B9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2B900000"
-
-# 0x2BA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2BA00000"
-
-# 0x2BB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2BB00000"
-
-# 0x2BC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2BC00000"
-
-# 0x2BD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2BD00000"
-
-# 0x2BE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2BE00000"
-
-# 0x2BF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2BF00000"
-
-# 0x2C0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C000000"
-
-# 0x2C1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C100000"
-
-# 0x2C2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C200000"
-
-# 0x2C3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C300000"
-
-# 0x2C4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C400000"
-
-# 0x2C5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C500000"
-
-# 0x2C6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C600000"
-
-# 0x2C7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C700000"
-
-# 0x2C8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C800000"
-
-# 0x2C9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2C900000"
-
-# 0x2CA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2CA00000"
-
-# 0x2CB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2CB00000"
-
-# 0x2CC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2CC00000"
-
-# 0x2CD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2CD00000"
-
-# 0x2CE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2CE00000"
-
-# 0x2CF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2CF00000"
-
-# 0x2D0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D000000"
-
-# 0x2D1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D100000"
-
-# 0x2D2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D200000"
-
-# 0x2D3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D300000"
-
-# 0x2D4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D400000"
-
-# 0x2D5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D500000"
-
-# 0x2D6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D600000"
-
-# 0x2D7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D700000"
-
-# 0x2D8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D800000"
-
-# 0x2D9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2D900000"
-
-# 0x2DA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2DA00000"
-
-# 0x2DB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2DB00000"
-
-# 0x2DC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2DC00000"
-
-# 0x2DD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2DD00000"
-
-# 0x2DE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2DE00000"
-
-# 0x2DF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2DF00000"
-
-# 0x2E0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E000000"
-
-# 0x2E1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E100000"
-
-# 0x2E2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E200000"
-
-# 0x2E3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E300000"
-
-# 0x2E4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E400000"
-
-# 0x2E5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E500000"
-
-# 0x2E6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E600000"
-
-# 0x2E7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E700000"
-
-# 0x2E8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E800000"
-
-# 0x2E9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2E900000"
-
-# 0x2EA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2EA00000"
-
-# 0x2EB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2EB00000"
-
-# 0x2EC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2EC00000"
-
-# 0x2ED:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2ED00000"
-
-# 0x2EE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2EE00000"
-
-# 0x2EF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2EF00000"
-
-# 0x2F0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F000000"
-
-# 0x2F1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F100000"
-
-# 0x2F2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F200000"
-
-# 0x2F3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F300000"
-
-# 0x2F4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F400000"
-
-# 0x2F5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F500000"
-
-# 0x2F6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F600000"
-
-# 0x2F7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F700000"
-
-# 0x2F8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F800000"
-
-# 0x2F9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2F900000"
-
-# 0x2FA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2FA00000"
-
-# 0x2FB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2FB00000"
-
-# 0x2FC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2FC00000"
-
-# 0x2FD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2FD00000"
-
-# 0x2FE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2FE00000"
-
-# 0x2FF: JMP 0x2FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "2FF302FF"
-
-# 0x300:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30000000"
-
-# 0x301:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30100000"
-
-# 0x302:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30200000"
-
-# 0x303:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30300000"
-
-# 0x304:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30400000"
-
-# 0x305:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30500000"
-
-# 0x306:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30600000"
-
-# 0x307:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30700000"
-
-# 0x308:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30800000"
-
-# 0x309:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30900000"
-
-# 0x30A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30A00000"
-
-# 0x30B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30B00000"
-
-# 0x30C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30C00000"
-
-# 0x30D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30D00000"
-
-# 0x30E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30E00000"
-
-# 0x30F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "30F00000"
-
-# 0x310:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31000000"
-
-# 0x311:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31100000"
-
-# 0x312:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31200000"
-
-# 0x313:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31300000"
-
-# 0x314:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31400000"
-
-# 0x315:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31500000"
-
-# 0x316:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31600000"
-
-# 0x317:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31700000"
-
-# 0x318:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31800000"
-
-# 0x319:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31900000"
-
-# 0x31A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31A00000"
-
-# 0x31B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31B00000"
-
-# 0x31C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31C00000"
-
-# 0x31D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31D00000"
-
-# 0x31E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31E00000"
-
-# 0x31F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "31F00000"
-
-# 0x320:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32000000"
-
-# 0x321:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32100000"
-
-# 0x322:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32200000"
-
-# 0x323:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32300000"
-
-# 0x324:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32400000"
-
-# 0x325:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32500000"
-
-# 0x326:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32600000"
-
-# 0x327:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32700000"
-
-# 0x328:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32800000"
-
-# 0x329:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32900000"
-
-# 0x32A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32A00000"
-
-# 0x32B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32B00000"
-
-# 0x32C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32C00000"
-
-# 0x32D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32D00000"
-
-# 0x32E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32E00000"
-
-# 0x32F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "32F00000"
-
-# 0x330:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33000000"
-
-# 0x331:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33100000"
-
-# 0x332:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33200000"
-
-# 0x333:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33300000"
-
-# 0x334:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33400000"
-
-# 0x335:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33500000"
-
-# 0x336:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33600000"
-
-# 0x337:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33700000"
-
-# 0x338:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33800000"
-
-# 0x339:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33900000"
-
-# 0x33A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33A00000"
-
-# 0x33B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33B00000"
-
-# 0x33C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33C00000"
-
-# 0x33D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33D00000"
-
-# 0x33E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33E00000"
-
-# 0x33F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "33F00000"
-
-# 0x340:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34000000"
-
-# 0x341:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34100000"
-
-# 0x342:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34200000"
-
-# 0x343:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34300000"
-
-# 0x344:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34400000"
-
-# 0x345:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34500000"
-
-# 0x346:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34600000"
-
-# 0x347:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34700000"
-
-# 0x348:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34800000"
-
-# 0x349:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34900000"
-
-# 0x34A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34A00000"
-
-# 0x34B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34B00000"
-
-# 0x34C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34C00000"
-
-# 0x34D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34D00000"
-
-# 0x34E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34E00000"
-
-# 0x34F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "34F00000"
-
-# 0x350:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35000000"
-
-# 0x351:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35100000"
-
-# 0x352:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35200000"
-
-# 0x353:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35300000"
-
-# 0x354:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35400000"
-
-# 0x355:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35500000"
-
-# 0x356:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35600000"
-
-# 0x357:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35700000"
-
-# 0x358:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35800000"
-
-# 0x359:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35900000"
-
-# 0x35A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35A00000"
-
-# 0x35B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35B00000"
-
-# 0x35C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35C00000"
-
-# 0x35D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35D00000"
-
-# 0x35E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35E00000"
-
-# 0x35F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "35F00000"
-
-# 0x360:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36000000"
-
-# 0x361:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36100000"
-
-# 0x362:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36200000"
-
-# 0x363:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36300000"
-
-# 0x364:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36400000"
-
-# 0x365:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36500000"
-
-# 0x366:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36600000"
-
-# 0x367:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36700000"
-
-# 0x368:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36800000"
-
-# 0x369:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36900000"
-
-# 0x36A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36A00000"
-
-# 0x36B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36B00000"
-
-# 0x36C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36C00000"
-
-# 0x36D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36D00000"
-
-# 0x36E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36E00000"
-
-# 0x36F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "36F00000"
-
-# 0x370:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37000000"
-
-# 0x371:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37100000"
-
-# 0x372:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37200000"
-
-# 0x373:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37300000"
-
-# 0x374:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37400000"
-
-# 0x375:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37500000"
-
-# 0x376:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37600000"
-
-# 0x377:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37700000"
-
-# 0x378:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37800000"
-
-# 0x379:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37900000"
-
-# 0x37A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37A00000"
-
-# 0x37B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37B00000"
-
-# 0x37C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37C00000"
-
-# 0x37D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37D00000"
-
-# 0x37E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37E00000"
-
-# 0x37F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "37F00000"
-
-# 0x380:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38000000"
-
-# 0x381:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38100000"
-
-# 0x382:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38200000"
-
-# 0x383:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38300000"
-
-# 0x384:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38400000"
-
-# 0x385:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38500000"
-
-# 0x386:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38600000"
-
-# 0x387:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38700000"
-
-# 0x388:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38800000"
-
-# 0x389:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38900000"
-
-# 0x38A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38A00000"
-
-# 0x38B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38B00000"
-
-# 0x38C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38C00000"
-
-# 0x38D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38D00000"
-
-# 0x38E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38E00000"
-
-# 0x38F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "38F00000"
-
-# 0x390:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39000000"
-
-# 0x391:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39100000"
-
-# 0x392:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39200000"
-
-# 0x393:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39300000"
-
-# 0x394:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39400000"
-
-# 0x395:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39500000"
-
-# 0x396:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39600000"
-
-# 0x397:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39700000"
-
-# 0x398:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39800000"
-
-# 0x399:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39900000"
-
-# 0x39A:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39A00000"
-
-# 0x39B:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39B00000"
-
-# 0x39C:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39C00000"
-
-# 0x39D:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39D00000"
-
-# 0x39E:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39E00000"
-
-# 0x39F:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "39F00000"
-
-# 0x3A0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A000000"
-
-# 0x3A1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A100000"
-
-# 0x3A2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A200000"
-
-# 0x3A3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A300000"
-
-# 0x3A4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A400000"
-
-# 0x3A5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A500000"
-
-# 0x3A6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A600000"
-
-# 0x3A7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A700000"
-
-# 0x3A8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A800000"
-
-# 0x3A9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3A900000"
-
-# 0x3AA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3AA00000"
-
-# 0x3AB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3AB00000"
-
-# 0x3AC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3AC00000"
-
-# 0x3AD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3AD00000"
-
-# 0x3AE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3AE00000"
-
-# 0x3AF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3AF00000"
-
-# 0x3B0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B000000"
-
-# 0x3B1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B100000"
-
-# 0x3B2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B200000"
-
-# 0x3B3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B300000"
-
-# 0x3B4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B400000"
-
-# 0x3B5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B500000"
-
-# 0x3B6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B600000"
-
-# 0x3B7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B700000"
-
-# 0x3B8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B800000"
-
-# 0x3B9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3B900000"
-
-# 0x3BA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3BA00000"
-
-# 0x3BB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3BB00000"
-
-# 0x3BC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3BC00000"
-
-# 0x3BD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3BD00000"
-
-# 0x3BE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3BE00000"
-
-# 0x3BF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3BF00000"
-
-# 0x3C0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C000000"
-
-# 0x3C1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C100000"
-
-# 0x3C2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C200000"
-
-# 0x3C3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C300000"
-
-# 0x3C4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C400000"
-
-# 0x3C5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C500000"
-
-# 0x3C6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C600000"
-
-# 0x3C7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C700000"
-
-# 0x3C8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C800000"
-
-# 0x3C9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3C900000"
-
-# 0x3CA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3CA00000"
-
-# 0x3CB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3CB00000"
-
-# 0x3CC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3CC00000"
-
-# 0x3CD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3CD00000"
-
-# 0x3CE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3CE00000"
-
-# 0x3CF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3CF00000"
-
-# 0x3D0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D000000"
-
-# 0x3D1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D100000"
-
-# 0x3D2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D200000"
-
-# 0x3D3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D300000"
-
-# 0x3D4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D400000"
-
-# 0x3D5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D500000"
-
-# 0x3D6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D600000"
-
-# 0x3D7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D700000"
-
-# 0x3D8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D800000"
-
-# 0x3D9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3D900000"
-
-# 0x3DA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3DA00000"
-
-# 0x3DB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3DB00000"
-
-# 0x3DC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3DC00000"
-
-# 0x3DD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3DD00000"
-
-# 0x3DE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3DE00000"
-
-# 0x3DF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3DF00000"
-
-# 0x3E0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E000000"
-
-# 0x3E1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E100000"
-
-# 0x3E2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E200000"
-
-# 0x3E3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E300000"
-
-# 0x3E4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E400000"
-
-# 0x3E5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E500000"
-
-# 0x3E6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E600000"
-
-# 0x3E7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E700000"
-
-# 0x3E8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E800000"
-
-# 0x3E9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3E900000"
-
-# 0x3EA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3EA00000"
-
-# 0x3EB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3EB00000"
-
-# 0x3EC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3EC00000"
-
-# 0x3ED:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3ED00000"
-
-# 0x3EE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3EE00000"
-
-# 0x3EF:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3EF00000"
-
-# 0x3F0:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F000000"
-
-# 0x3F1:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F100000"
-
-# 0x3F2:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F200000"
-
-# 0x3F3:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F300000"
-
-# 0x3F4:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F400000"
-
-# 0x3F5:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F500000"
-
-# 0x3F6:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F600000"
-
-# 0x3F7:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F700000"
-
-# 0x3F8:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F800000"
-
-# 0x3F9:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3F900000"
-
-# 0x3FA:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3FA00000"
-
-# 0x3FB:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3FB00000"
-
-# 0x3FC:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3FC00000"
-
-# 0x3FD:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3FD00000"
-
-# 0x3FE:
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3FE00000"
-
-# 0x3FF: JMP 0x3FF
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "3FF303FF"
-
-# Assembled from itest.jsm
-# ---------------------------------------------------------------
-# Shift the USER2 Instruction (b1111000011) into the Instruction Register of FPGA
-# User 2
-set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C3"]
-
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0048"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0161"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "026C"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "036C"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "046F"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "0F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "1F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "2F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "3F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "4F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "5F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "6F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "7F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "8F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9A00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9B00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9C00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9D00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9E00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "9F00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "A900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "AA00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "AB00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "AC00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "AD00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "AE00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "AF00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "B900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "BA00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "BB00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "BC00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "BD00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "BE00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "BF00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "C900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "CA00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "CB00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "CC00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "CD00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "CE00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "CF00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "D900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "DA00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "DB00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "DC00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "DD00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "DE00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "DF00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "E900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "EA00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "EB00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "EC00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "ED00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "EE00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "EF00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F500"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F600"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F700"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F800"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "F900"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "FA00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "FB00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "FC00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "FD00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "FE00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "FF00"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "10000"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "10100"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "10200"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "10300"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "10400"
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 16 "10500"
-
-::chipscope::csejtag_target unlock $handle
-::chipscope::csejtag_target close $handle
-::chipscope::csejtag_session destroy $handle
-exit
diff --git a/lib/CPUs/JCpu/asm/make b/lib/CPUs/JCpu/asm/make
deleted file mode 100644
index e7f598f..0000000
--- a/lib/CPUs/JCpu/asm/make
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-# ----------------------------------------------------------------------
-# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-# This file: rom-file generation for cpu_core
-#
-# Copyright (C) 2007 J. Ahrensfeld
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# For questions and ideas, please contact the author at jens@jayfield.org
-#
-# ---------------------------------------------------------------------
-
-TARGET=$2
-DSTDIR=$1
-
-JASM_HOME=/cygdrive/w/vhdl/lib/CPUs/JCpu/tools
-
-$JASM_HOME/jasm.rb $TARGET.jsm
-
-irom_tcl_snippet="$TARGET.irom.tcl.snip"
-irom_vhdl_snippet="$TARGET.irom.vhdl.snip"
-irom_ld_vhdl_snippet="$TARGET.irom_ld.vhdl.snip"
-xrom_tcl_snippet="$TARGET.xrom.tcl.snip"
-xrom_vhdl_snippet="$TARGET.xrom.vhdl.snip"
-xrom_ld_vhdl_snippet="$TARGET.xrom_ld.vhdl.snip"
-
-$JASM_HOME/insrom.rb $irom_vhdl_snippet $JASM_HOME/irom.vhd.tpl >$DSTDIR/$TARGET\_irom.vhdl
-$JASM_HOME/insrom.rb $irom_ld_vhdl_snippet $JASM_HOME/irom_ld.vhd.tpl >$DSTDIR/$TARGET\_irom_ld.vhdl
-
-$JASM_HOME/insrom.rb $xrom_vhdl_snippet $JASM_HOME/xrom.vhd.tpl >$DSTDIR/$TARGET\_xrom.vhdl
-$JASM_HOME/insrom.rb $xrom_ld_vhdl_snippet $JASM_HOME/xrom_ld.vhd.tpl >$DSTDIR/$TARGET\_xrom_ld.vhdl
-
-cat $irom_tcl_snippet > $TARGET.tcl.snip.snip
-cat $xrom_tcl_snippet >> $TARGET.tcl.snip.snip
-$JASM_HOME/insrom.rb $TARGET.tcl.snip.snip $JASM_HOME/rom.tcl.tpl >$TARGET.tcl
-
-rm -f *.snip
diff --git a/lib/CPUs/JCpu/asm/mul8x8.jsm b/lib/CPUs/JCpu/asm/mul8x8.jsm
deleted file mode 100644
index c9b6c3b..0000000
--- a/lib/CPUs/JCpu/asm/mul8x8.jsm
+++ /dev/null
@@ -1,29 +0,0 @@
-; -------------------------------------------------
-; Constants
-; -------------------------------------------------
-
-; Chip register
-include "../../../jasm/cregs.inc.jsm"
-
-; -------------------------------------------------
-; Program
-; -------------------------------------------------
- code
- org 0x000
-reset: jmp init
-
-; -------------------------------------------------
-; Main
-; -------------------------------------------------
-init: mov R0, 0x45
- mov R1, 0xF5
-
- call mul8x8
-stop: jmp stop
-
-
-; -------------------------------------------------
-include "../../../jasm/mul8x8.inc.jsm"
-
-
-
\ No newline at end of file
diff --git a/lib/CPUs/JCpu/asm/mul8x8.tcl b/lib/CPUs/JCpu/asm/mul8x8.tcl
deleted file mode 100644
index 6bec87e..0000000
--- a/lib/CPUs/JCpu/asm/mul8x8.tcl
+++ /dev/null
@@ -1,154 +0,0 @@
-# ----------------------------------------------------------------------
-# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-# This file: The ROM file for upload to target over JTAG
-#
-# Copyright (C) 2007 J. Ahrensfeld
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# For questions and ideas, please contact the author at jens@jayfield.org
-#
-# ---------------------------------------------------------------------
-
-# ---------------------------------------------------------------------
-# For Chipscope 9.1
-# ---------------------------------------------------------------------
-# Source JTAG/TCL frame work
-cd $env(CHIPSCOPE)\\bin\\nt
-source csejtag.tcl
-
-namespace import ::chipscope::*
-
-# Platform USB Cable
-set PLATFORM_USB_CABLE_ARGS [list "port=USB2" "frequency=6000000"]
-# frequency="24000000 | 12000000 | 6000000 | 3000000 | 1500000 | 750000"
-
-# Create session
-set handle [::chipscope::csejtag_session create 0]
-
-# Open JTAG and lock
-set open_result [::chipscope::csejtag_target open $handle $CSEJTAG_TARGET_PLATFORMUSB 0 $PLATFORM_USB_CABLE_ARGS]
-set lock_result [::chipscope::csejtag_target lock $handle 1000]
-
-set devlist [::chipscope::csejtag_tap autodetect_chain $handle $CSEJTAG_SCAN_DEFAULT]
-
-# Get Device ID
-set devtype "Virtex-4SX"
-set devid 2
-set irlength [::chipscope::csejtag_tap get_irlength $handle $devid]
-set idcode [::chipscope::csejtag_tap get_device_idcode $handle $devid]
-
-set CSE_OP $CSEJTAG_SHIFT_READWRITE
-set CSE_ES $CSEJTAG_RUN_TEST_IDLE
-
-# Write Program
-# JASM_ROM_INSERT_HERE
-# Assembled from mul8x8.jsm
-# ---------------------------------------------------------------
-# Shift the USER2 Instruction (b1111000010) into the Instruction Register of FPGA
-# User 1
-set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C2"]
-
-# 0x000: JMP 0x001
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00030001"
-
-# 0x001: MOV R00, 0x45
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00103450"
-
-# 0x002: MOV R01, 0xF5
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00203F51"
-
-# 0x003: CALL 0x005
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0033B005"
-
-# 0x004: JMP 0x004
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00430004"
-
-# 0x005: PUSH R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0053C002"
-
-# 0x006: PUSH R03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0063C003"
-
-# 0x007: PUSH R04
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0073C004"
-
-# 0x008: MOV R04, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00802014"
-
-# 0x009: MOV R01, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00903001"
-
-# 0x00A: MOV R02, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00A03002"
-
-# 0x00B: MOV R03, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00B03003"
-
-# 0x00C: CMP R04, 0x01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00C0F014"
-
-# 0x00D: JEQ 0x015
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00D39015"
-
-# 0x00E: SHR R04
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00E1F004"
-
-# 0x00F: JNC 0x012
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00F34012"
-
-# 0x010: ADD R02, R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01010002"
-
-# 0x011: ADDC R03, R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01112013"
-
-# 0x012: SHL R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0121E000"
-
-# 0x013: ROLC R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01322001"
-
-# 0x014: JMP 0x00C
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0143000C"
-
-# 0x015: ADD R00, R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01510020"
-
-# 0x016: ADDC R01, R03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01612031"
-
-# 0x017: POP R04
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0173D004"
-
-# 0x018: POP R03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0183D003"
-
-# 0x019: POP R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0193D002"
-
-# 0x01A: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01A3E000"
-
-# Assembled from mul8x8.jsm
-# ---------------------------------------------------------------
-# Shift the USER2 Instruction (b1111000011) into the Instruction Register of FPGA
-# User 2
-set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C3"]
-
-
-::chipscope::csejtag_target unlock $handle
-::chipscope::csejtag_target close $handle
-::chipscope::csejtag_session destroy $handle
-exit
diff --git a/lib/CPUs/JCpu/asm/reti_issue.jsm b/lib/CPUs/JCpu/asm/reti_issue.jsm
deleted file mode 100644
index 78edc49..0000000
--- a/lib/CPUs/JCpu/asm/reti_issue.jsm
+++ /dev/null
@@ -1,50 +0,0 @@
-; -------------------------------------------------
-; Constants
-; -------------------------------------------------
-
-; Chip register
-cpu_revision: equ 0x00 ; RO
-cpu_control: equ 0x01 ; R/W
-cpu_status: equ 0x02 ; RO
-cpu_int_ctrl: equ 0x03 ; R/W
-
-; -------------------------------------------------
-; Program
-; -------------------------------------------------
- code
-reset: jmp init
-
- org 0x001
-; nop
- reti
-
-; -------------------------------------------------
-; Main
-; -------------------------------------------------
-init: mov R0, 0x05
- cout (cpu_int_ctrl), R0
- mov R0, 0x00
-loop: nop
- inc R0
- nop
- call subr
- nop
- push R3
- nop
- push R2
- nop
- push R1
- nop
- push R0
- nop
- pop R0
- nop
- pop R1
- nop
- pop R2
- nop
- pop R3
- nop
- jmp loop
-
-subr: ret
diff --git a/lib/CPUs/JCpu/asm/reti_issue.tcl b/lib/CPUs/JCpu/asm/reti_issue.tcl
deleted file mode 100644
index 5da9c56..0000000
--- a/lib/CPUs/JCpu/asm/reti_issue.tcl
+++ /dev/null
@@ -1,157 +0,0 @@
-# ----------------------------------------------------------------------
-# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-# This file: The ROM file for upload to target over JTAG
-#
-# Copyright (C) 2007 J. Ahrensfeld
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# For questions and ideas, please contact the author at jens@jayfield.org
-#
-# ---------------------------------------------------------------------
-
-# ---------------------------------------------------------------------
-# For Chipscope 9.1
-# ---------------------------------------------------------------------
-# Source JTAG/TCL frame work
-cd $env(CHIPSCOPE)\\bin\\nt
-source csejtag.tcl
-
-namespace import ::chipscope::*
-
-# Platform USB Cable
-set PLATFORM_USB_CABLE_ARGS [list "port=USB2" "frequency=6000000"]
-# frequency="24000000 | 12000000 | 6000000 | 3000000 | 1500000 | 750000"
-
-# Create session
-set handle [::chipscope::csejtag_session create 0]
-
-# Open JTAG and lock
-set open_result [::chipscope::csejtag_target open $handle $CSEJTAG_TARGET_PLATFORMUSB 0 $PLATFORM_USB_CABLE_ARGS]
-set lock_result [::chipscope::csejtag_target lock $handle 1000]
-
-set devlist [::chipscope::csejtag_tap autodetect_chain $handle $CSEJTAG_SCAN_DEFAULT]
-
-# Get Device ID
-set devtype "Virtex-4SX"
-set devid 2
-set irlength [::chipscope::csejtag_tap get_irlength $handle $devid]
-set idcode [::chipscope::csejtag_tap get_device_idcode $handle $devid]
-
-set CSE_OP $CSEJTAG_SHIFT_READWRITE
-set CSE_ES $CSEJTAG_RUN_TEST_IDLE
-
-# Write Program
-# JASM_ROM_INSERT_HERE
-# Assembled from reti_issue.jsm
-# ---------------------------------------------------------------
-# Shift the USER2 Instruction (b1111000010) into the Instruction Register of FPGA
-# User 1
-set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C2"]
-
-# 0x000: JMP 0x002
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00030002"
-
-# 0x001: RETI
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0013F000"
-
-# 0x002: MOV R00, 0x05
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00203050"
-
-# 0x003: COUT (0x03), R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00326030"
-
-# 0x004: MOV R00, 0x00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00403000"
-
-# 0x005: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00500000"
-
-# 0x006: INC R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00611010"
-
-# 0x007: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00700000"
-
-# 0x008: CALL 0x01B
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0083B01B"
-
-# 0x009: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00900000"
-
-# 0x00A: PUSH R03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00A3C003"
-
-# 0x00B: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00B00000"
-
-# 0x00C: PUSH R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00C3C002"
-
-# 0x00D: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00D00000"
-
-# 0x00E: PUSH R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00E3C001"
-
-# 0x00F: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "00F00000"
-
-# 0x010: PUSH R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0103C000"
-
-# 0x011: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01100000"
-
-# 0x012: POP R00
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0123D000"
-
-# 0x013: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01300000"
-
-# 0x014: POP R01
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0143D001"
-
-# 0x015: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01500000"
-
-# 0x016: POP R02
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0163D002"
-
-# 0x017: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01700000"
-
-# 0x018: POP R03
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "0183D003"
-
-# 0x019: NOP
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01900000"
-
-# 0x01A: JMP 0x005
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01A30005"
-
-# 0x01B: RET
-::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 32 "01B3E000"
-
-# Assembled from reti_issue.jsm
-# ---------------------------------------------------------------
-# Shift the USER2 Instruction (b1111000011) into the Instruction Register of FPGA
-# User 2
-set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength "3C3"]
-
-
-::chipscope::csejtag_target unlock $handle
-::chipscope::csejtag_target close $handle
-::chipscope::csejtag_session destroy $handle
-exit
diff --git a/lib/CPUs/JCpu/doc/block_diagram.png b/lib/CPUs/JCpu/doc/block_diagram.png
deleted file mode 100644
index 14bbb54..0000000
Binary files a/lib/CPUs/JCpu/doc/block_diagram.png and /dev/null differ
diff --git a/lib/CPUs/JCpu/doc/memory_map.png b/lib/CPUs/JCpu/doc/memory_map.png
deleted file mode 100644
index 30a22a0..0000000
Binary files a/lib/CPUs/JCpu/doc/memory_map.png and /dev/null differ
diff --git a/lib/CPUs/JCpu/gpl-3.0.txt b/lib/CPUs/JCpu/gpl-3.0.txt
deleted file mode 100644
index 94a9ed0..0000000
--- a/lib/CPUs/JCpu/gpl-3.0.txt
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/lib/CPUs/JCpu/sim/ModelSim SE .lnk b/lib/CPUs/JCpu/sim/ModelSim SE .lnk
deleted file mode 100644
index 1fe4002..0000000
Binary files a/lib/CPUs/JCpu/sim/ModelSim SE .lnk and /dev/null differ
diff --git a/lib/CPUs/JCpu/sim/tb_cpu.fdo b/lib/CPUs/JCpu/sim/tb_cpu.fdo
deleted file mode 100644
index 86feedf..0000000
--- a/lib/CPUs/JCpu/sim/tb_cpu.fdo
+++ /dev/null
@@ -1,22 +0,0 @@
-## NOTE: Do not edit this file.
-##
-vlib work
-vcom -explicit -93 "../../../PCK_FIO-1.16/PCK_FIO.vhd"
-vcom -explicit -93 "../src/core/cpu_pkg.vhd"
-vcom -explicit -93 "../src/core/stack_ctrl.vhd"
-vcom -explicit -93 "../src/core/reg_dual.vhd"
-vcom -explicit -93 "../src/core/chipram.vhd"
-vcom -explicit -93 "../src/core/chipreg.vhd"
-vcom -explicit -93 "../src/core/pc.vhd"
-vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
-vcom -explicit -93 "../src/core/int_ctrl.vhd"
-vcom -explicit -93 "../src/core/alu.vhd"
-vcom -explicit -93 "../src/core/cpu.vhd"
-vcom -explicit -93 "../src/itest_irom.vhdl"
-vcom -explicit -93 "../src/tb_cpu_itest.vhd"
-vsim -t 1ps -lib work tb_cpu
-do {tb_cpu.wdo}
-view wave
-view structure
-view signals
-run 50us
diff --git a/lib/CPUs/JCpu/sim/tb_cpu.wdo b/lib/CPUs/JCpu/sim/tb_cpu.wdo
deleted file mode 100644
index 2ef036e..0000000
--- a/lib/CPUs/JCpu/sim/tb_cpu.wdo
+++ /dev/null
@@ -1,107 +0,0 @@
-onerror {resume}
-quietly WaveActivateNextPane {} 0
-add wave -noupdate -format Logic /tb_cpu/rst
-add wave -noupdate -format Logic /tb_cpu/clk
-add wave -noupdate -format Logic /tb_cpu/ce
-add wave -noupdate -format Logic /tb_cpu/uut/cpu_active
-add wave -noupdate -format Logic /tb_cpu/int_in
-add wave -noupdate -format Logic /tb_cpu/int_ack
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/irom_data
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/irom_addr
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_din
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_dout
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_addr
-add wave -noupdate -format Logic /tb_cpu/xmem_we
-add wave -noupdate -format Logic /tb_cpu/xmem_re
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/sram
-add wave -noupdate -format Logic /tb_cpu/uut/io_sel
-add wave -noupdate -format Literal /tb_cpu/uut/iphase
-add wave -noupdate -divider CPU
-add wave -noupdate -format Literal /tb_cpu/reg
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Literal /tb_cpu/uut/cpu_status
-add wave -noupdate -format Literal /tb_cpu/uut/status_reg
-add wave -noupdate -format Literal /tb_cpu/uut/ctrl
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_out
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_in
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_reg
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/pc_in
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/pc_next
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/idata
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/int_pc_addr
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/iphase
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/const_data
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_a_dout
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_b_dout
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_din
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_op1
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_op2
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_result
-add wave -noupdate -format Literal /tb_cpu/uut/alu_status
-add wave -noupdate -format Logic /tb_cpu/uut/pc_inc
-add wave -noupdate -format Logic /tb_cpu/uut/pc_load
-add wave -noupdate -format Logic /tb_cpu/uut/stk_we
-add wave -noupdate -format Logic /tb_cpu/uut/cmem_we
-add wave -noupdate -format Literal /tb_cpu/uut/ctrl_iphase
-add wave -noupdate -format Logic /tb_cpu/uut/was_pcld
-add wave -noupdate -format Logic /tb_cpu/uut/was_pop2pc
-add wave -noupdate -format Logic /tb_cpu/uut/int_pc_load
-add wave -noupdate -format Logic /tb_cpu/uut/int_stk_push
-add wave -noupdate -format Logic /tb_cpu/uut/stk_push
-add wave -noupdate -format Logic /tb_cpu/uut/stk_pop
-add wave -noupdate -format Logic /tb_cpu/uut/status_save
-add wave -noupdate -format Logic /tb_cpu/uut/status_restore
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_ptr
-add wave -noupdate -divider Stack
-add wave -noupdate -format Logic /tb_cpu/clk
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/push
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/pop
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/din
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/dout
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/mem_we
-add wave -noupdate -divider Chipram
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_a
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_a
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_a
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_a
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_b
-add wave -noupdate -divider Sequencer
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/inst_in
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/iphase_in
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/status_in
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_out
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/idout
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/ddout
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/opcode
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_lines
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Literal -radix hexadecimal -expand /tb_cpu/uut/inst_reg_ab/mem
-add wave -noupdate -divider {Chip register}
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/creg_addr
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/creg_din
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/creg_dout
-add wave -noupdate -format Literal /tb_cpu/uut/creg_ctrl_out
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Logic /tb_cpu/clk
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_exit
-add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/int_state
-TreeUpdate [SetDefaultTree]
-WaveRestoreCursors {{Cursor 1} {136355 ps} 0}
-configure wave -namecolwidth 166
-configure wave -valuecolwidth 101
-configure wave -justifyvalue left
-configure wave -signalnamewidth 1
-configure wave -snapdistance 10
-configure wave -datasetprefix 0
-configure wave -rowmargin 4
-configure wave -childrowmargin 2
-configure wave -gridoffset 0
-configure wave -gridperiod 1
-configure wave -griddelta 40
-configure wave -timeline 0
-update
-WaveRestoreZoom {93532 ps} {206468 ps}
diff --git a/lib/CPUs/JCpu/sim/tb_cpu_embedded.fdo b/lib/CPUs/JCpu/sim/tb_cpu_embedded.fdo
deleted file mode 100644
index bf718fb..0000000
--- a/lib/CPUs/JCpu/sim/tb_cpu_embedded.fdo
+++ /dev/null
@@ -1,22 +0,0 @@
-## NOTE: Do not edit this file.
-##
-vlib work
-vcom -explicit -93 "../src/core/cpu_pkg.vhd"
-vcom -explicit -93 "../src/core/stack_ctrl.vhd"
-vcom -explicit -93 "../src/core/reg_dual.vhd"
-vcom -explicit -93 "../src/core/chipram.vhd"
-vcom -explicit -93 "../src/core/chipreg.vhd"
-vcom -explicit -93 "../src/core/pc.vhd"
-vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
-vcom -explicit -93 "../src/core/int_ctrl.vhd"
-vcom -explicit -93 "../src/core/alu.vhd"
-vcom -explicit -93 "../src/core/cpu.vhd"
-vcom -explicit -93 "../src/cpu_embedded.vhd"
-vcom -explicit -93 "../src/tb_cpu_embedded.vhd"
-vcom -explicit -93 "../src/itest_irom.vhdl"
-vsim -t 1ps -lib work tb_cpu_embedded
-do {tb_cpu_embedded.wdo}
-view wave
-view structure
-view signals
-run 10us
diff --git a/lib/CPUs/JCpu/sim/tb_cpu_embedded.wdo b/lib/CPUs/JCpu/sim/tb_cpu_embedded.wdo
deleted file mode 100644
index caec2d7..0000000
--- a/lib/CPUs/JCpu/sim/tb_cpu_embedded.wdo
+++ /dev/null
@@ -1,26 +0,0 @@
-onerror {resume}
-quietly WaveActivateNextPane {} 0
-add wave -noupdate -format Logic /tb_cpu_embedded/rst
-add wave -noupdate -format Logic /tb_cpu_embedded/clk
-add wave -noupdate -format Logic /tb_cpu_embedded/ce
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/sram
-add wave -noupdate -format Logic /tb_cpu_embedded/int_in
-add wave -noupdate -format Logic /tb_cpu_embedded/int_ack
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/rom_addr
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/rom_data
-TreeUpdate [SetDefaultTree]
-WaveRestoreCursors {{Cursor 1} {2168142 ps} 0}
-configure wave -namecolwidth 143
-configure wave -valuecolwidth 101
-configure wave -justifyvalue left
-configure wave -signalnamewidth 1
-configure wave -snapdistance 10
-configure wave -datasetprefix 0
-configure wave -rowmargin 4
-configure wave -childrowmargin 2
-configure wave -gridoffset 0
-configure wave -gridperiod 1
-configure wave -griddelta 40
-configure wave -timeline 0
-update
-WaveRestoreZoom {0 ps} {10500 ns}
diff --git a/lib/CPUs/JCpu/sim/tb_cpu_itest.fdo b/lib/CPUs/JCpu/sim/tb_cpu_itest.fdo
deleted file mode 100644
index 77ca67d..0000000
--- a/lib/CPUs/JCpu/sim/tb_cpu_itest.fdo
+++ /dev/null
@@ -1,22 +0,0 @@
-## NOTE: Do not edit this file.
-##
-vlib work
-vcom -explicit -93 "../../../PCK_FIO-1.16/PCK_FIO.vhd"
-vcom -explicit -93 "../src/core/cpu_pkg.vhd"
-vcom -explicit -93 "../src/core/stack_ctrl.vhd"
-vcom -explicit -93 "../src/core/reg_dual.vhd"
-vcom -explicit -93 "../src/core/chipram.vhd"
-vcom -explicit -93 "../src/core/chipreg.vhd"
-vcom -explicit -93 "../src/core/pc.vhd"
-vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
-vcom -explicit -93 "../src/core/int_ctrl.vhd"
-vcom -explicit -93 "../src/core/alu.vhd"
-vcom -explicit -93 "../src/core/cpu.vhd"
-vcom -explicit -93 "../src/itest_irom.vhdl"
-vcom -explicit -93 "../src/tb_cpu_itest.vhd"
-vsim -t 1ps -lib work tb_cpu
-do {tb_cpu_itest.wdo}
-view wave
-view structure
-view signals
-run 400us
diff --git a/lib/CPUs/JCpu/sim/tb_cpu_itest.wdo b/lib/CPUs/JCpu/sim/tb_cpu_itest.wdo
deleted file mode 100644
index c3e2205..0000000
--- a/lib/CPUs/JCpu/sim/tb_cpu_itest.wdo
+++ /dev/null
@@ -1,122 +0,0 @@
-onerror {resume}
-quietly WaveActivateNextPane {} 0
-add wave -noupdate -format Logic /tb_cpu/rst
-add wave -noupdate -format Logic /tb_cpu/clk
-add wave -noupdate -format Logic /tb_cpu/ce
-add wave -noupdate -format Logic /tb_cpu/int_in
-add wave -noupdate -format Logic /tb_cpu/int_ack
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/irom_data
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/irom_addr
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_din
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_dout
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/xmem_addr
-add wave -noupdate -format Logic /tb_cpu/xmem_we
-add wave -noupdate -format Logic /tb_cpu/xmem_re
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/sram
-add wave -noupdate -format Literal -radix hexadecimal -expand /tb_cpu/reg
-add wave -noupdate -format Logic /tb_cpu/uut/io_sel
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/mem_data
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/mem_addr
-add wave -noupdate -divider CPU
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Literal /tb_cpu/uut/cpu_status
-add wave -noupdate -format Literal /tb_cpu/uut/status_reg
-add wave -noupdate -format Literal /tb_cpu/uut/ctrl
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_out
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_in
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_reg
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/pc_in
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/pc_next
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/idata
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/int_pc_addr
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/iphase
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/const_data
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_a_dout
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_b_dout
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/reg_din
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_op1
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_op2
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/alu_result
-add wave -noupdate -format Literal /tb_cpu/uut/alu_status
-add wave -noupdate -format Logic /tb_cpu/uut/pc_inc
-add wave -noupdate -format Logic /tb_cpu/uut/pc_load
-add wave -noupdate -format Logic /tb_cpu/uut/cpu_active
-add wave -noupdate -format Logic /tb_cpu/uut/stk_we
-add wave -noupdate -format Logic /tb_cpu/uut/cmem_we
-add wave -noupdate -format Literal /tb_cpu/uut/ctrl_iphase
-add wave -noupdate -format Logic /tb_cpu/uut/was_pcld
-add wave -noupdate -format Logic /tb_cpu/uut/was_pop2pc
-add wave -noupdate -format Logic /tb_cpu/uut/int_pc_load
-add wave -noupdate -format Logic /tb_cpu/uut/int_stk_push
-add wave -noupdate -format Logic /tb_cpu/uut/stk_push
-add wave -noupdate -format Logic /tb_cpu/uut/stk_pop
-add wave -noupdate -format Logic /tb_cpu/uut/status_save
-add wave -noupdate -format Logic /tb_cpu/uut/status_restore
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/stk_ptr
-add wave -noupdate -divider Stack
-add wave -noupdate -format Logic /tb_cpu/clk
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/push
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/pop
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/din
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/dout
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/mem_we
-add wave -noupdate -divider Chipram
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_a
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_a
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_a
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_a
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/ram
-add wave -noupdate -divider Sequencer
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/reg
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/inst_in
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/iphase_in
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/status_in
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_out
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/idout
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_dpath_ctrl/ddout
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/opcode
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_lines
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Literal -radix hexadecimal -expand /tb_cpu/uut/inst_reg_ab/mem
-add wave -noupdate -divider {Chip register}
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/creg_dout
-add wave -noupdate -format Literal /tb_cpu/uut/creg_ctrl_out
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Logic /tb_cpu/clk
-add wave -noupdate -divider {Interrup Ctrl.}
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_in
-add wave -noupdate -format Literal -expand /tb_cpu/uut/inst_int_ctrl/ctrl_in
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_request
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_ack
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_exit
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_ack_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stat_save_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stat_rest_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/pc_load_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_pop_out
-add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/int_state
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/pc_load
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_pop
-TreeUpdate [SetDefaultTree]
-WaveRestoreCursors {{Cursor 1} {107309645 ps} 0}
-configure wave -namecolwidth 166
-configure wave -valuecolwidth 101
-configure wave -justifyvalue left
-configure wave -signalnamewidth 1
-configure wave -snapdistance 10
-configure wave -datasetprefix 0
-configure wave -rowmargin 4
-configure wave -childrowmargin 2
-configure wave -gridoffset 0
-configure wave -gridperiod 1
-configure wave -griddelta 40
-configure wave -timeline 0
-update
-WaveRestoreZoom {0 ps} {420 us}
diff --git a/lib/CPUs/JCpu/sim/tb_cpu_reti_issue.fdo b/lib/CPUs/JCpu/sim/tb_cpu_reti_issue.fdo
deleted file mode 100644
index aba9eda..0000000
--- a/lib/CPUs/JCpu/sim/tb_cpu_reti_issue.fdo
+++ /dev/null
@@ -1,22 +0,0 @@
-## NOTE: Do not edit this file.
-##
-vlib work
-vcom -explicit -93 "../../../PCK_FIO-1.16/PCK_FIO.vhd"
-vcom -explicit -93 "../src/core/cpu_pkg.vhd"
-vcom -explicit -93 "../src/core/stack_ctrl.vhd"
-vcom -explicit -93 "../src/core/reg_dual.vhd"
-vcom -explicit -93 "../src/core/chipram.vhd"
-vcom -explicit -93 "../src/core/chipreg.vhd"
-vcom -explicit -93 "../src/core/pc.vhd"
-vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
-vcom -explicit -93 "../src/core/int_ctrl.vhd"
-vcom -explicit -93 "../src/core/alu.vhd"
-vcom -explicit -93 "../src/core/cpu.vhd"
-vcom -explicit -93 "../src/reti_issue_irom.vhdl"
-vcom -explicit -93 "../src/tb_cpu_irq.vhd"
-vsim -t 1ps -lib work tb_cpu
-do {tb_cpu_reti_issue.wdo}
-view wave
-view structure
-view signals
-run 50us
diff --git a/lib/CPUs/JCpu/sim/tb_cpu_reti_issue.wdo b/lib/CPUs/JCpu/sim/tb_cpu_reti_issue.wdo
deleted file mode 100644
index d6d7e7e..0000000
--- a/lib/CPUs/JCpu/sim/tb_cpu_reti_issue.wdo
+++ /dev/null
@@ -1,90 +0,0 @@
-onerror {resume}
-quietly WaveActivateNextPane {} 0
-add wave -noupdate -format Literal /tb_cpu/uut/iphase
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/ctrl_lines
-add wave -noupdate -format Literal /tb_cpu/reg
-add wave -noupdate -format Logic /tb_cpu/int_in
-add wave -noupdate -format Logic /tb_cpu/int_ack
-add wave -noupdate -format Literal /tb_cpu/xmem_din
-add wave -noupdate -format Literal /tb_cpu/xmem_dout
-add wave -noupdate -format Literal /tb_cpu/xmem_addr
-add wave -noupdate -format Logic /tb_cpu/xmem_we
-add wave -noupdate -format Logic /tb_cpu/xmem_re
-add wave -noupdate -format Logic /tb_cpu/io_sel
-add wave -noupdate -format Literal /tb_cpu/sram
-add wave -noupdate -divider {Chip RAM}
-add wave -noupdate -format Literal /tb_cpu/uut/iphase
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/clka
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/clkb
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/en_a
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/en_b
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_a
-add wave -noupdate -format Logic /tb_cpu/uut/inst_chipram/we_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_a
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/addr_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_a
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/din_b
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_a
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_chipram/dout_b
-add wave -noupdate -divider {Interrupt controller}
-add wave -noupdate -format Literal /tb_cpu/uut/iphase
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/rst
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/clk
-add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/ctrl_in
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_in
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_request
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_exit
-add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/iphase_in
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_int_ctrl/pc_addr_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/int_ack
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stat_save_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stat_rest_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/pc_load_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push_out
-add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/int_state
-add wave -noupdate -format Literal /tb_cpu/uut/inst_int_ctrl/int_state_next
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/pc_load
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_pop
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_pop_out
-add wave -noupdate -format Logic /tb_cpu/uut/inst_int_ctrl/stk_push_out
-add wave -noupdate -divider PC
-add wave -noupdate -format Literal /tb_cpu/uut/iphase
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Logic /tb_cpu/uut/inst_pc/rst
-add wave -noupdate -format Logic /tb_cpu/uut/inst_pc/clk
-add wave -noupdate -format Logic /tb_cpu/uut/inst_pc/inc
-add wave -noupdate -format Logic /tb_cpu/uut/inst_pc/load
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_pc/pc_in
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_pc/pc_out
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_pc/pc_next
-add wave -noupdate -divider {Stack controller}
-add wave -noupdate -format Literal /tb_cpu/uut/iphase
-add wave -noupdate -format Literal /tb_cpu/uut/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/rst
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/clk
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/push
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/pop
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/ptr_out
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/din
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/dout
-add wave -noupdate -format Logic /tb_cpu/uut/inst_stack_ctrl/mem_we
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu/uut/inst_stack_ctrl/ptr
-TreeUpdate [SetDefaultTree]
-WaveRestoreCursors {{Cursor 1} {0 ps} 0}
-configure wave -namecolwidth 150
-configure wave -valuecolwidth 100
-configure wave -justifyvalue left
-configure wave -signalnamewidth 1
-configure wave -snapdistance 10
-configure wave -datasetprefix 0
-configure wave -rowmargin 4
-configure wave -childrowmargin 2
-configure wave -gridoffset 0
-configure wave -gridperiod 1
-configure wave -griddelta 40
-configure wave -timeline 0
-update
-WaveRestoreZoom {0 ps} {47421482 ps}
diff --git a/lib/CPUs/JCpu/sim/tb_mul8x8.fdo b/lib/CPUs/JCpu/sim/tb_mul8x8.fdo
deleted file mode 100644
index 5a852a4..0000000
--- a/lib/CPUs/JCpu/sim/tb_mul8x8.fdo
+++ /dev/null
@@ -1,22 +0,0 @@
-## NOTE: Do not edit this file.
-##
-vlib work
-vcom -explicit -93 "../src/core/cpu_pkg.vhd"
-vcom -explicit -93 "../src/core/stack_ctrl.vhd"
-vcom -explicit -93 "../src/core/reg_dual.vhd"
-vcom -explicit -93 "../src/core/chipram.vhd"
-vcom -explicit -93 "../src/core/chipreg.vhd"
-vcom -explicit -93 "../src/core/pc.vhd"
-vcom -explicit -93 "../src/core/dpath_ctrl.vhd"
-vcom -explicit -93 "../src/core/int_ctrl.vhd"
-vcom -explicit -93 "../src/core/alu.vhd"
-vcom -explicit -93 "../src/core/cpu.vhd"
-vcom -explicit -93 "../src/cpu_embedded.vhd"
-vcom -explicit -93 "../src/tb_cpu_embedded.vhd"
-vcom -explicit -93 "../src/mul8x8_irom.vhdl"
-vsim -t 1ps -lib work tb_cpu_embedded
-do {tb_mul8x8.wdo}
-view wave
-view structure
-view signals
-run 10us
diff --git a/lib/CPUs/JCpu/sim/tb_mul8x8.wdo b/lib/CPUs/JCpu/sim/tb_mul8x8.wdo
deleted file mode 100644
index 355e0a4..0000000
--- a/lib/CPUs/JCpu/sim/tb_mul8x8.wdo
+++ /dev/null
@@ -1,31 +0,0 @@
-onerror {resume}
-quietly WaveActivateNextPane {} 0
-add wave -noupdate -format Logic /tb_cpu_embedded/uut/inst_cpu/rst
-add wave -noupdate -format Logic /tb_cpu_embedded/uut/inst_cpu/clk
-add wave -noupdate -format Logic /tb_cpu_embedded/uut/inst_cpu/ce
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/instr_din
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/instr_addr
-add wave -noupdate -format Literal /tb_cpu_embedded/uut/inst_cpu/cpu_status
-add wave -noupdate -format Literal /tb_cpu_embedded/uut/inst_cpu/status_reg
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/alu_op1
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/alu_op2
-add wave -noupdate -format Literal -radix hexadecimal /tb_cpu_embedded/uut/inst_cpu/alu_result
-add wave -noupdate -format Literal /tb_cpu_embedded/uut/inst_cpu/alu_status
-add wave -noupdate -format Literal /tb_cpu_embedded/uut/inst_cpu/inst_dpath_ctrl/dbg_iname
-add wave -noupdate -format Literal -radix hexadecimal -expand /tb_cpu_embedded/uut/inst_cpu/inst_reg_ab/mem
-TreeUpdate [SetDefaultTree]
-WaveRestoreCursors {{Cursor 1} {529679 ps} 0}
-configure wave -namecolwidth 143
-configure wave -valuecolwidth 101
-configure wave -justifyvalue left
-configure wave -signalnamewidth 1
-configure wave -snapdistance 10
-configure wave -datasetprefix 0
-configure wave -rowmargin 4
-configure wave -childrowmargin 2
-configure wave -gridoffset 0
-configure wave -gridperiod 1
-configure wave -griddelta 40
-configure wave -timeline 0
-update
-WaveRestoreZoom {9002500 ps} {10052500 ps}
diff --git a/lib/CPUs/JCpu/src/core/alu.vhd b/lib/CPUs/JCpu/src/core/alu.vhd
deleted file mode 100644
index 19b3478..0000000
--- a/lib/CPUs/JCpu/src/core/alu.vhd
+++ /dev/null
@@ -1,236 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The arithmetic logic unit
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity alu is
- Generic (
- data_width : integer := 8
- );
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- op_en : in STD_LOGIC;
- cy_in : in STD_LOGIC;
- op1_in : in unsigned (data_width-1 downto 0);
- op2_in : in unsigned (data_width-1 downto 0);
- opsel : in alu_op_t;
- res_out : out unsigned (data_width-1 downto 0);
- stat_load : in STD_LOGIC;
- stat_in : in alu_status_t;
- stat_out : out alu_status_t
- );
-end alu;
-
-architecture Behavioral of alu is
-
- signal sum_cy, sh_cy, sum_cy_in, sh_cy_in, left_shift, add_subn : STD_LOGIC;
- signal result, sum_res, lf_res, sh_res, res_reg : unsigned (data_width-1 downto 0);
- signal status, stat_reg : alu_status_t;
-
- --------------------------------------------------------------------------
- function test_zero(arg : unsigned) return STD_LOGIC is
- variable result : STD_LOGIC;
- begin
- result := '0';
- for i in arg'range loop
- result := result or To_X01(arg(i));
- end loop;
-
- return not result;
- end test_zero;
-
---------------------------------------------------------------------------
-begin
-
---------------------------------------------------------------------------
-proc_logic_func:
- process (op1_in, op2_in, opsel)
- begin
-
- case opsel is
- when op1_and_op2 =>
- lf_res <= op1_in and op2_in;
- when op1_or_op2 =>
- lf_res <= op1_in or op2_in;
- when op1_xor_op2 =>
- lf_res <= op1_in xor op2_in;
- when others =>
- lf_res <= (others => '-');
- end case;
-
- end process;
-
---------------------------------------------------------------------------
-proc_shift_func:
- process (op1_in, left_shift, sh_cy_in)
- begin
- if left_shift = '1' then
- sh_res <= op1_in(op1_in'left-1 downto op1_in'right) & sh_cy_in;
- sh_cy <= op1_in(op1_in'left);
- else
- sh_res <= sh_cy_in & op1_in(op1_in'left downto op1_in'right+1);
- sh_cy <= op1_in(op1_in'right);
- end if;
-
- end process;
-
---------------------------------------------------------------------------
-proc_alu_out:
- process(opsel, op1_in, op2_in, res_reg, stat_reg, lf_res, sum_res, sh_res, sum_cy, sh_cy, cy_in)
-
- begin
-
- case opsel is
-
- when op1_add_op2 | op1_sub_op2 | op1_addc_op2 | op1_subc_op2 =>
- status.zero <= test_zero(res_reg);
- status.carry <= sum_cy;
- result <= sum_res;
- when op1_and_op2 | op1_or_op2 | op1_xor_op2 =>
- status.zero <= test_zero(res_reg);
- status.carry <= stat_reg.carry;
- result <= lf_res;
- when shl_op | shr_op | rol_op | ror_op | rolc_op | rorc_op =>
- status.zero <= test_zero(res_reg);
- status.carry <= sh_cy;
- result <= sh_res;
- when swap_op =>
- result <= op1_in(op1_in'left-op1_in'length/2 downto op1_in'right) & op1_in(op1_in'left downto op1_in'right+op1_in'length/2);
- status <= stat_reg;
- when others =>
- result <= op2_in;
- status.zero <= stat_reg.zero;
- status.carry <= stat_reg.carry or cy_in;
- end case;
-
- end process;
-
---------------------------------------------------------------------------
-proc_alu_in:
- process(opsel, op1_in, stat_reg)
-
- begin
-
- add_subn <= '-';
- sum_cy_in <= '-';
- sh_cy_in <= '-';
- left_shift <= '-';
-
- case opsel is
-
- when op1_add_op2 =>
- sum_cy_in <= '0';
- add_subn <= '1';
-
- when op1_sub_op2 =>
- sum_cy_in <= '0';
- add_subn <= '0';
-
- when op1_addc_op2 =>
- sum_cy_in <= stat_reg.carry;
- add_subn <= '1';
-
- when op1_subc_op2 =>
- sum_cy_in <= stat_reg.carry;
- add_subn <= '0';
-
- when shl_op =>
- sh_cy_in <= '0';
- left_shift <= '1';
-
- when shr_op =>
- sh_cy_in <= '0';
- left_shift <= '0';
-
- when rol_op =>
- sh_cy_in <= op1_in(op1_in'left);
- left_shift <= '1';
-
- when ror_op =>
- sh_cy_in <= op1_in(op1_in'right);
- left_shift <= '0';
-
- when rolc_op =>
- sh_cy_in <= stat_reg.carry;
- left_shift <= '1';
-
- when rorc_op =>
- sh_cy_in <= stat_reg.carry;
- left_shift <= '0';
-
- when others => null;
-
- end case;
-
- end process;
-
---------------------------------------------------------------------------
-proc_res_reg:
- process(clk, rst, op_en, stat_load, res_reg, stat_reg)
- begin
- if rst = '1' then
- res_reg <= (others => '0');
- stat_reg <= (others => '0');
- elsif rising_edge(clk) then
- if op_en = '1' then
- res_reg <= result;
- stat_reg <= status;
- elsif stat_load = '1' then
- stat_reg <= stat_in;
- end if;
- end if;
- res_out <= res_reg;
- stat_out <= stat_reg;
-
- end process;
-
---------------------------------------------------------------------------
-alu_addsub:
- process(op1_in, op2_in, sum_cy_in, add_subn)
- variable sum : unsigned(data_width+1 downto 0);
- variable op1, op2 : unsigned(data_width+1 downto 0);
- begin
- if add_subn = '1' then
- op1 := '0' & op1_in & '1';
- op2 := '0' & op2_in & sum_cy_in;
- sum := op1 + op2;
- else
- op1 := '0' & op1_in & not sum_cy_in;
- op2 := '0' & op2_in & '1';
- sum := op1 - op2;
- end if;
-
- -- Form sum + carry
- sum_res <= sum(data_width downto 1);
- sum_cy <= sum(sum'left);
-
- end process;
-
---------------------------------------------------------------------------
-end Behavioral;
-
diff --git a/lib/CPUs/JCpu/src/core/chipram.vhd b/lib/CPUs/JCpu/src/core/chipram.vhd
deleted file mode 100644
index a954a77..0000000
--- a/lib/CPUs/JCpu/src/core/chipram.vhd
+++ /dev/null
@@ -1,85 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: On-chip RAM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity chipram is
- Generic (
- addr_width : integer := 3;
- data_width : integer := 8
- );
- Port (
- clka : in STD_LOGIC;
- clkb : in STD_LOGIC;
- en_a : in STD_LOGIC;
- en_b : in STD_LOGIC;
- we_a : in STD_LOGIC;
- we_b : in STD_LOGIC;
- addr_a : in unsigned (addr_width-1 downto 0);
- addr_b : in unsigned (addr_width-1 downto 0);
- din_a : in unsigned (data_width-1 downto 0);
- din_b : in unsigned (data_width-1 downto 0);
- dout_a : out unsigned (data_width-1 downto 0);
- dout_b : out unsigned (data_width-1 downto 0)
- );
-end chipram;
-
-architecture Behavioral of chipram is
-
- constant depth : integer := 2**addr_width;
- type RAMtype is array (0 to depth-1) of unsigned (data_width-1 downto 0);
- shared variable RAM : RAMtype;
-
-begin
-
-process (clka)
-begin
-if clka'event and clka = '1' then
- if en_a = '1' then
- if we_a = '1' then
- RAM(to_integer(addr_a)) := din_a;
- end if;
- dout_a <= RAM(to_integer(addr_a));
- end if;
-end if;
-end process;
-
-process (clkb)
-begin
-if clkb'event and clkb = '1' then
- if en_b = '1' then
- if we_b = '1' then
- RAM(to_integer(addr_b)) := din_b;
- end if;
- dout_b <= RAM(to_integer(addr_b));
- end if;
-end if;
-end process;
-
-
-end Behavioral;
-
diff --git a/lib/CPUs/JCpu/src/core/chipreg.vhd b/lib/CPUs/JCpu/src/core/chipreg.vhd
deleted file mode 100644
index 6c5b9f1..0000000
--- a/lib/CPUs/JCpu/src/core/chipreg.vhd
+++ /dev/null
@@ -1,117 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: On-Chip registers
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity chipreg is
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- we : in STD_LOGIC;
- addr : in dmem_addr_t;
- din : in dmem_data_t;
- dout : out dmem_data_t;
- ctrl_in : in creg_ctrl_in_t;
- ctrl_out : out creg_ctrl_out_t
- );
-end chipreg;
-
-architecture Behavioral of chipreg is
-
- signal reg_bank_sel : bank_sel_t;
- signal reg_int_ctrl : int_ctrl_in_t;
- signal reg_stk_high : unsigned(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
- signal reg_cmem_high : unsigned(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
-
-begin
-
-proc_assign_ctrl_lines:
- process (clk)
- begin
- if rising_edge(clk) then
- ctrl_out.bank_sel <= reg_bank_sel;
- ctrl_out.int_ctrl <= reg_int_ctrl;
- ctrl_out.stk_high <= reg_stk_high;
- ctrl_out.cmem_high <= reg_cmem_high;
- end if;
- end process;
-
-proc_reg_write:
- process (rst, clk)
- begin
- if rst = '1' then
- reg_stk_high <= (others => '0');
- reg_cmem_high <= (others => '0');
- reg_bank_sel <= (others => '0');
- reg_int_ctrl.enable <= '0';
- elsif rising_edge(clk) then
- if we = '1' then
- case addr is
- when X"01" =>
- reg_bank_sel(bank_sel_t'range) <= din(bank_sel_t'range);
- when X"03" =>
- reg_int_ctrl.enable <= din(0);
- when X"04" =>
- reg_cmem_high <= din(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
- when X"05" =>
- reg_stk_high <= din(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
- when others => null;
- end case;
- end if;
- end if;
- end process;
-
-proc_reg_read:
- process (clk)
- begin
- if rising_edge(clk) then
- case addr is
- when X"00" => -- Revison
- dout <= to_unsigned(REVISION, dmem_data_t'length);
- when X"01" => -- Control 0
- dout <= (7 downto bank_sel_t'length => '0') & reg_bank_sel;
- when X"02" => -- CPU status
- dout <= "000000" & ctrl_in.alu.carry & ctrl_in.alu.zero;
- when X"03" => -- Interrupt control
- dout <= "0000000" & reg_int_ctrl.enable;
- when X"04" => -- Upper stack bits out
- dout <= "0000" & reg_cmem_high;
- when X"05" => -- Upper cmem bits out
- dout <= "0000" & reg_stk_high;
- when others =>
- if addr(0) = '0' then
- dout <= X"DE";
- else
- dout <= X"AD";
- end if;
- end case;
-
- end if;
- end process;
-
-end Behavioral;
-
diff --git a/lib/CPUs/JCpu/src/core/cpu.vhd b/lib/CPUs/JCpu/src/core/cpu.vhd
deleted file mode 100644
index 38e8686..0000000
--- a/lib/CPUs/JCpu/src/core/cpu.vhd
+++ /dev/null
@@ -1,563 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: JCPU top file
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity cpu is
- Generic (
- use_instr_register : boolean := false;
- use_ctrl_rom : boolean := true
-
- );
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- int_in : in STD_LOGIC;
- int_ack : out STD_LOGIC;
- xmem_we : out STD_LOGIC;
- xmem_re : out STD_LOGIC;
- instr_din : in unsigned (IMEM_DATA_WIDTH-1 downto 0);
- instr_addr : out unsigned (IMEM_ADDR_WIDTH-1 downto 0);
- xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_addr : out unsigned (DMEM_ADDR_WIDTH-1 downto 0);
- io_sel : out std_logic
- );
-end cpu;
-
-architecture rtl of cpu is
-
- COMPONENT stack_ctrl
- GENERIC (
- addr_width : integer
- );
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- push : in STD_LOGIC;
- pop : in STD_LOGIC;
- din : in inst_addr_t;
- dout : out inst_addr_t;
- mem_we : out STD_LOGIC;
- ptr_out : out unsigned (addr_width-1 downto 0)
- );
- END COMPONENT;
-
- COMPONENT pc
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- inc : in STD_LOGIC;
- load : in STD_LOGIC;
- pc_in : in inst_addr_t;
- pc_out : out inst_addr_t;
- pc_next : out inst_addr_t
- );
- END COMPONENT;
-
- COMPONENT dpath_ctrl
- GENERIC (
- use_rom : boolean
- );
- Port (
- inst_in : in inst_t;
- iphase_in : in iphase_t;
- status_in : in cpu_status_t;
- ctrl_out : out dpath_ctrl_out_t;
- idout : out inst_addr_t;
- ddout : out dmem_data_t
- );
- END COMPONENT;
-
- COMPONENT int_ctrl
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- ctrl_in : in int_ctrl_in_t;
- int_in : in STD_LOGIC;
- int_exit : in STD_LOGIC;
- iphase_in : in iphase_t;
- int_ack_out : out STD_LOGIC;
- stat_save_out : out STD_LOGIC;
- stat_rest_out : out STD_LOGIC;
- pc_addr_out : out inst_addr_t;
- pc_load_out : out STD_LOGIC;
- stk_push_out : out STD_LOGIC;
- stk_pop_out : out STD_LOGIC
- );
- END COMPONENT;
-
- COMPONENT reg_dual
- GENERIC (
- addr_width : integer;
- data_width : integer
- );
- Port (
- clk : in STD_LOGIC;
- we_a : in STD_LOGIC;
- ptr_a : in reg_ptr_t;
- ptr_b : in reg_ptr_t;
- din_a : in unsigned (data_width-1 downto 0);
- dout_a : out unsigned (data_width-1 downto 0);
- dout_b : out unsigned (data_width-1 downto 0)
- );
- END COMPONENT;
-
- COMPONENT chipram
- GENERIC (
- addr_width : integer;
- data_width : integer
- );
- Port (
- clka : in STD_LOGIC;
- clkb : in STD_LOGIC;
- en_a : in STD_LOGIC;
- en_b : in STD_LOGIC;
- we_a : in STD_LOGIC;
- we_b : in STD_LOGIC;
- addr_a : in unsigned (addr_width-1 downto 0);
- addr_b : in unsigned (addr_width-1 downto 0);
- din_a : in unsigned (data_width-1 downto 0);
- din_b : in unsigned (data_width-1 downto 0);
- dout_a : out unsigned (data_width-1 downto 0);
- dout_b : out unsigned (data_width-1 downto 0)
- );
- END COMPONENT;
-
- COMPONENT chipreg
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- we : in STD_LOGIC;
- addr : in dmem_addr_t;
- din : in dmem_data_t;
- dout : out dmem_data_t;
- ctrl_in : in creg_ctrl_in_t;
- ctrl_out : out creg_ctrl_out_t
- );
- END COMPONENT;
-
- COMPONENT alu
- GENERIC (
- data_width : integer := 8
- );
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- op_en : in STD_LOGIC;
- cy_in : in STD_LOGIC;
- op1_in : in unsigned (data_width-1 downto 0);
- op2_in : in unsigned (data_width-1 downto 0);
- opsel : in alu_op_t;
- res_out : out unsigned (data_width-1 downto 0);
- stat_load : in STD_LOGIC;
- stat_in : in alu_status_t;
- stat_out : out alu_status_t
- );
- END COMPONENT;
-
- signal cpu_status, status_reg : cpu_status_t; -- := cpu_status_t(others => '0');
- signal ctrl : dpath_ctrl_out_t;
- signal stk_out : inst_addr_t;
- signal stk_in : inst_addr_t;
- signal stk_reg : inst_addr_t;
- signal pc_in, pc_out, pc_next, idata, int_pc_addr : inst_addr_t;
- signal iphase : iphase_t;
- signal const_data, reg_a_dout, reg_b_dout : dmem_data_t;
- signal reg_din : dmem_data_t;
- signal alu_op1, alu_op2, alu_result : dmem_data_t;
- signal alu_status : alu_status_t;
- signal pc_inc, pc_load, cpu_active, stk_we, cmem_we, creg_we : STD_LOGIC;
- signal ctrl_inst : inst_t;
- signal ctrl_iphase : iphase_t;
- signal was_pcld, was_pop2pc, int_pc_load, int_stk_push, int_stk_pop, stk_push, stk_pop : STD_LOGIC;
- signal status_save, status_restore : STD_LOGIC;
- signal creg_dout : dmem_data_t;
- signal cmem_din, cmem_dout : inst_addr_t;
- signal stk_addr, cmem_addr : unsigned(CHIPRAM_SIZE_BITS-1 downto 0);
- signal stk_ptr : unsigned(STACK_SIZE_BITS-1 downto 0);
- signal creg_ctrl_out : creg_ctrl_out_t;
- signal creg_ctrl_in : creg_ctrl_in_t;
- signal xio_sel, cio_sel : std_logic;
- signal mem_data : dmem_data_t;
- signal mem_addr : dmem_data_t;
-
-begin
- io_sel <= xio_sel;
- instr_addr <= pc_out;
- pc_inc <= cpu_active and ctrl.lines.pc_inc;
- stk_addr <= '0' & stk_ptr;
- cpu_status.alu <= alu_status;
- creg_ctrl_in.alu <= alu_status;
-
- xmem_dout <= mem_data;
- xmem_addr <= mem_addr;
- cmem_din <= creg_ctrl_out.cmem_high & mem_data;
- cmem_addr <= '1' & creg_ctrl_out.bank_sel & mem_addr(MIN(cmem_addr'length-creg_ctrl_out.bank_sel'length-1, mem_addr'length)-1 downto 0);
-
---------------------------------------------------------------------
-mem_ctrl_lines:
- process(ctrl.lines)
- begin
- xio_sel <= '0';
- xmem_re <= '0';
- xmem_we <= '0';
- cio_sel <= '0';
- cmem_we <= '0';
- creg_we <= '0';
-
- case ctrl.lines.mem_access is
- when xmem_access =>
- xmem_re <= ctrl.lines.mem_read;
- xmem_we <= ctrl.lines.mem_write;
- when xio_access =>
- xio_sel <= '1';
- xmem_re <= ctrl.lines.mem_read;
- xmem_we <= ctrl.lines.mem_write;
- when cmem_access =>
- cmem_we <= ctrl.lines.mem_write;
- when cio_access =>
- cio_sel <= '1';
- creg_we <= ctrl.lines.mem_write;
- when others => null;
- end case;
- end process;
-
-iphase_counter:
- process(rst, clk, ce)
- variable pos : integer;
- begin
- if rst = '1' then
- iphase <= iphase_t'low;
- cpu_active <= '0';
- elsif rising_edge(clk) then
- cpu_active <= '0';
- if ce = '1' then
- cpu_active <= '1';
- if iphase = iphase_t'high then
- iphase <= iphase_t'low;
- else
- iphase <= iphase + 1;
- end if;
- end if;
- end if;
- end process;
-
-gen_instr_reg:
-if use_instr_register = true generate
-
-instr_reg:
- process (rst, clk, ce)
- begin
- if rst = '1' then
- ctrl_inst <= (others => '0');
- ctrl_iphase <= 0;
- elsif rising_edge(clk) and ce = '1' then
- ctrl_inst <= instr_din;
- ctrl_iphase <= iphase;
- end if;
- end process;
-
-end generate;
-
-gen_instr_direct:
-if use_instr_register = false generate
-
- ctrl_inst <= instr_din;
- ctrl_iphase <= iphase;
-
-end generate;
-
-status_register:
- process(clk, status_save)
- begin
- if rising_edge(clk) and status_save = '1' then
- status_reg.alu <= alu_status;
- end if;
- end process;
-
-pc_pushpop:
- process(ctrl.lines, int_pc_load, int_stk_push, int_stk_pop, was_pop2pc)
- begin
- pc_load <= ctrl.lines.pc_load or int_pc_load;
- stk_push <= ctrl.lines.stk_push or (int_stk_push and not was_pop2pc);
- stk_pop <= (ctrl.lines.stk_pop and not ctrl.lines.pc_load) or int_stk_pop or ((ctrl.lines.stk_pop and ctrl.lines.pc_load) and not int_pc_load);
- end process;
-
-lines_delay:
- process(clk)
- begin
- if rising_edge(clk) then
- was_pcld <= ctrl.lines.pc_load;
- was_pop2pc <= ctrl.lines.stk_pop and ctrl.lines.pc_load;
- end if;
- end process;
-
-stk_mux:
- process(ctrl.lines, was_pcld, int_stk_push, pc_next, idata, reg_a_dout, creg_ctrl_out)
- begin
- if was_pcld = '1' and int_stk_push = '1' then
- stk_in <= idata;
- elsif ctrl.lines.stk_push = '1' and ctrl.lines.pc_load = '0' then
- stk_in <= creg_ctrl_out.stk_high & reg_a_dout;
- else
- stk_in <= pc_next;
- end if;
-
- end process;
-
-pc_mux:
- process(ctrl.lines, int_pc_load, int_stk_pop, idata, int_pc_addr, stk_out)
- begin
-
- pc_in <= stk_out;
- if int_pc_load = '1' then
- if int_stk_pop = '0' then
- pc_in <= int_pc_addr;
- end if;
- elsif ctrl.lines.pc_load = '1' then
- if ctrl.lines.stk_pop = '0' then
- pc_in <= idata;
- end if;
- end if;
-
- end process;
-
-mem_data_mux:
- process(ctrl.lines.ddata_src_sel, reg_a_dout, reg_b_dout, const_data, creg_ctrl_out)
- begin
- case ctrl.lines.ddata_src_sel is
- when reg_a =>
- mem_data <= reg_a_dout;
- when reg_b =>
- mem_data <= reg_b_dout;
- when const =>
- mem_data <= const_data;
- when others =>
- mem_data <= const_data;
- end case;
-
- end process;
-
-mem_addr_mux:
- process(ctrl.lines.daddr_src_sel, reg_a_dout, reg_b_dout, const_data, creg_ctrl_out.bank_sel)
- begin
- case ctrl.lines.daddr_src_sel is
- when reg_a =>
- mem_addr <= reg_a_dout;
- when reg_b =>
- mem_addr <= reg_b_dout;
- when const =>
- mem_addr <= const_data;
- when others =>
- mem_addr <= const_data;
- end case;
-
- end process;
-
-reg_in_mux:
- process(ctrl.lines.reg_src_sel, cio_sel, xmem_din, alu_result, stk_out, cmem_dout, creg_dout)
- variable data : dmem_data_t;
- begin
- case ctrl.lines.reg_src_sel is
- when xmem_src =>
- data := xmem_din;
- when cmem_src =>
- if cio_sel = '0' then
- data := cmem_dout(dmem_data_t'range);
- else
- data := creg_dout(dmem_data_t'range);
- end if;
- when stk_src =>
- data := stk_out(dmem_data_t'range);
- when others =>
- data := alu_result;
- end case;
-
- reg_din <= data;
-
- end process;
-
-alu_op1_mux:
- process(ctrl.lines.alu_op1_src_sel, reg_a_dout, reg_b_dout, const_data)
- variable data : dmem_data_t;
- begin
- case ctrl.lines.alu_op1_src_sel is
- when reg_a =>
- data := reg_a_dout;
- when reg_b =>
- data := reg_b_dout;
- when others =>
- data := const_data;
- end case;
-
- alu_op1 <= data;
-
- end process;
-
-alu_op2_mux:
- process(ctrl.lines.alu_op2_src_sel, reg_a_dout, reg_b_dout, const_data)
- variable data : dmem_data_t;
- begin
- case ctrl.lines.alu_op2_src_sel is
- when reg_a =>
- data := reg_a_dout;
- when reg_b =>
- data := reg_b_dout;
- when others =>
- data := const_data;
- end case;
-
- alu_op2 <= data;
-
- end process;
-
---------------------------------------------------------------------
- inst_stack_ctrl: stack_ctrl
- GENERIC MAP (
- addr_width => STACK_SIZE_BITS
- )
- PORT MAP(
- rst => rst,
- clk => clk,
- push => stk_push,
- pop => stk_pop,
- dout => stk_reg,
- din => stk_in,
- ptr_out => stk_ptr,
- mem_we => stk_we
- );
-
- inst_pc: pc
- PORT MAP(
- rst => rst,
- clk => clk,
- inc => pc_inc,
- load => pc_load,
- pc_in => pc_in,
- pc_out => pc_out,
- pc_next => pc_next
- );
-
- inst_dpath_ctrl: dpath_ctrl
- GENERIC MAP (
- use_rom => use_ctrl_rom
- )
- PORT MAP(
- inst_in => ctrl_inst,
- iphase_in => ctrl_iphase,
- status_in => cpu_status,
- ctrl_out => ctrl,
- ddout => const_data,
- idout => idata
- );
-
- inst_int_ctrl: int_ctrl
- PORT MAP(
- rst => rst,
- clk => clk,
- ctrl_in => creg_ctrl_out.int_ctrl,
- int_in => int_in,
- int_ack_out => int_ack,
- int_exit => ctrl.lines.int_exit,
- iphase_in => ctrl_iphase,
- stat_save_out => status_save,
- stat_rest_out => status_restore,
- pc_addr_out => int_pc_addr,
- pc_load_out => int_pc_load,
- stk_push_out => int_stk_push,
- stk_pop_out => int_stk_pop
-
- );
-
- inst_reg_ab: reg_dual
- GENERIC MAP (
- addr_width => REG_SIZE_BITS,
- data_width => DMEM_DATA_WIDTH
- )
- PORT MAP(
- clk => clk,
- we_a => ctrl.lines.reg_we,
- ptr_a => ctrl.reg_a_ptr,
- ptr_b => ctrl.reg_b_ptr,
- din_a => reg_din,
- dout_a => reg_a_dout,
- dout_b => reg_b_dout
- );
-
- inst_chipram: chipram
- GENERIC MAP (
- addr_width => CHIPRAM_SIZE_BITS,
- data_width => IMEM_ADDR_WIDTH
- )
- PORT MAP(
- clka => clk,
- clkb => clk,
- en_a => cpu_active,
- en_b => cpu_active,
- we_a => stk_we,
- we_b => cmem_we,
- addr_a => stk_addr,
- addr_b => cmem_addr,
- din_a => stk_reg,
- din_b => cmem_din,
- dout_a => stk_out,
- dout_b => cmem_dout
- );
-
- inst_chipreg: chipreg
- PORT MAP(
- rst => rst,
- clk => clk,
- we => creg_we,
- addr => mem_addr,
- din => mem_data,
- dout => creg_dout,
- ctrl_in => creg_ctrl_in,
- ctrl_out => creg_ctrl_out
- );
-
- inst_alu: alu
- GENERIC MAP (
- data_width => DMEM_DATA_WIDTH
- )
- PORT MAP(
- rst => rst,
- clk => clk,
- op_en => ctrl.lines.alu_load,
- cy_in => ctrl.lines.alu_cy_in,
- op1_in => alu_op1,
- op2_in => alu_op2,
- opsel => ctrl.lines.alu_opsel,
- res_out => alu_result,
- stat_load => status_restore,
- stat_in => status_reg.alu,
- stat_out => alu_status
- );
-
-end rtl;
diff --git a/lib/CPUs/JCpu/src/core/cpu_pkg.vhd b/lib/CPUs/JCpu/src/core/cpu_pkg.vhd
deleted file mode 100644
index 91bdae2..0000000
--- a/lib/CPUs/JCpu/src/core/cpu_pkg.vhd
+++ /dev/null
@@ -1,852 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: Types, constants and functions for JCPU
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-
-package cpu_pkg is
-
- -- Revision of the CPU
- constant REVISION : integer := 4;
-
- -- Chipram depth (valid values 9..floor(log2(BlockRamBytes)))
- constant CHIPRAM_SIZE_BITS : integer := 10;
-
- -- Number of registers (16 registers fixed)
- constant REG_SIZE_BITS : integer := 4;
-
- -- Instruction memory
- constant IMEM_ADDR_WIDTH : integer := 12;
-
- -- Data memory
- constant DMEM_DATA_WIDTH : integer := 8;
- constant DMEM_ADDR_WIDTH : integer := 8;
-
- -- Instruction format
- constant INST_OPCODE_WIDTH : integer := 6;
- constant IMEM_DATA_WIDTH : integer := INST_OPCODE_WIDTH + DMEM_DATA_WIDTH + REG_SIZE_BITS;
-
- -- Microcode ROM
- constant MUCODE_ADDR_WIDTH : integer := 9;
-
- -- Stack depth (uses lower half of CHIPRAM)
- constant STACK_SIZE_BITS : integer := CHIPRAM_SIZE_BITS-1;
-
- --Types
- subtype iphase_t is integer range 0 to 1;
- type mem_access_t is (cmem_access, xmem_access, cio_access, xio_access);
- type reg_src_t is (alu_src, stk_src, cmem_src, xmem_src);
- type alu_src_t is (reg_a, reg_b, const);
- type ddata_src_t is (reg_a, reg_b, const);
- type daddr_src_t is (reg_a, reg_b, const);
- subtype instr_name_t is string(1 to 12);
- type instr_name_array_t is array (0 to 63) of instr_name_t;
- subtype opcode_t is unsigned (INST_OPCODE_WIDTH-1 downto 0);
- subtype inst_data_t is unsigned (IMEM_ADDR_WIDTH-1 downto 0);
- subtype inst_addr_t is unsigned (IMEM_ADDR_WIDTH-1 downto 0);
- subtype inst_t is unsigned (IMEM_DATA_WIDTH-1 downto 0);
- subtype dmem_data_t is unsigned (DMEM_DATA_WIDTH-1 downto 0);
- subtype dmem_addr_t is unsigned (DMEM_DATA_WIDTH-1 downto 0);
- subtype reg_ptr_t is unsigned (3 downto 0);
- type dmem_array_t is array (natural range <>) of dmem_data_t;
- type instr_addr_array is array (integer range <>) of inst_addr_t;
- subtype bank_sel_t is unsigned (CHIPRAM_SIZE_BITS-DMEM_DATA_WIDTH-2 downto 0);
-
- type alu_op_t is
- (
- pass_op2,
- op1_add_op2,
- op1_sub_op2,
- op1_addc_op2,
- op1_subc_op2,
- op1_and_op2,
- op1_or_op2,
- op1_xor_op2,
- swap_op,
- shl_op,
- shr_op,
- rol_op,
- ror_op,
- rolc_op,
- rorc_op
- );
-
- type alu_status_t is record
- zero : STD_LOGIC;
- carry : STD_LOGIC;
- end record;
-
- type cpu_status_t is record
- alu : alu_status_t;
- end record;
-
- type ctrl_lines_t is record
- reg_we : STD_LOGIC;
- reg_src_sel : reg_src_t;
- alu_op1_src_sel : alu_src_t;
- alu_op2_src_sel : alu_src_t;
- alu_opsel : alu_op_t;
- alu_load : STD_LOGIC;
- alu_cy_in : STD_LOGIC;
- ddata_src_sel : ddata_src_t;
- daddr_src_sel : daddr_src_t;
- pc_load : STD_LOGIC;
- pc_inc : STD_LOGIC;
- stk_push : STD_LOGIC;
- stk_pop : STD_LOGIC;
- mem_access : mem_access_t;
- mem_read : STD_LOGIC;
- mem_write : STD_LOGIC;
- int_exit : STD_LOGIC;
- end record;
-
- type dpath_ctrl_out_t is record
- lines : ctrl_lines_t;
- reg_a_ptr : reg_ptr_t;
- reg_b_ptr : reg_ptr_t;
- end record;
-
- type int_ctrl_in_t is record
- enable : std_logic;
- end record;
-
- type creg_ctrl_out_t is record
- bank_sel : bank_sel_t;
- int_ctrl : int_ctrl_in_t;
- stk_high : unsigned(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
- cmem_high : unsigned(IMEM_ADDR_WIDTH-DMEM_ADDR_WIDTH-1 downto 0);
- end record;
-
- type creg_ctrl_in_t is record
- alu : alu_status_t;
- end record;
-
-
- type murom_t is array (0 to integer(2**MUCODE_ADDR_WIDTH)-1) of ctrl_lines_t;
-
- constant instr_name_array : instr_name_array_t :=
- (
- "NOP ", -- 00
- "HALT ", -- 01
- "MOV|R|R ", -- 02
- "MOV|R|K ", -- 03
- "MOVX|R|Ri ", -- 04
- "MOVX|R|Ki ", -- 05
- "MOVX|Ri|R ", -- 06
- "MOVX|Ri|K ", -- 07
- "MOVX|Ki|R ", -- 08
- "MOVC|R|Ri ", -- 09
- "MOVC|R|Ki ", -- 0A
- "MOVC|Ri|R ", -- 0B
- "MOVC|Ri|K ", -- 0C
- "MOVC|Ki|R ", -- 0D
- "CMP|R|R ", -- 0E
- "CMP|R|K ", -- 0F
- "ADD|R|R ", -- 10
- "ADD|R|K ", -- 11
- "ADDC|R|R ", -- 12
- "ADDC|R|K ", -- 13
- "SUB|R|R ", -- 14
- "SUB|R|K ", -- 15
- "SUBC|R|R ", -- 16
- "SUBC|R|K ", -- 17
- "AND|R|R ", -- 18
- "AND|R|K ", -- 19
- "OR|R|R ", -- 1A
- "OR|R|K ", -- 1B
- "XOR|R|R ", -- 1C
- "XOR|R|K ", -- 1D
- "SHL|R ", -- 1E
- "SHR|R ", -- 1F
- "ROL|R ", -- 20
- "ROR|R ", -- 21
- "ROLC|R ", -- 22
- "RORC|R ", -- 23
- "XOUT|Ki|R ", -- 24
- "XOUT|Ri|K ", -- 25
- "COUT|Ki|R ", -- 26
- "COUT|Ri|K ", -- 27
- "XIN|R|Ki ", -- 28
- "CIN|R|Ki ", -- 29
- "SWAP|R ", -- 2A
- "SETC ", -- 2B
- "UNDEF ", -- 2C
- "UNDEF ", -- 2D
- "SUB|K|R ", -- 2E
- "SUBC|K|R ", -- 2F
- "JMP|K ", -- 30
- "JZ|K ", -- 31
- "JNZ|K ", -- 32
- "JC|K ", -- 33
- "JNC|K ", -- 34
- "JLT|K ", -- 35
- "JGT|K ", -- 36
- "JLE|K ", -- 37
- "JGE|K ", -- 38
- "JEQ|K ", -- 39
- "JNE|K ", -- 3A
- "CALL|K ", -- 3B
- "PUSH|R ", -- 3C
- "POP|R ", -- 3D
- "RET ", -- 3E
- "RETI " -- 3F
- );
- -- Functions
- function Instr(opcode : opcode_t) return inst_t;
- function Instr(opcode : opcode_t; data : inst_data_t) return inst_t;
- function Instr(opcode : opcode_t; data : inst_data_t; reg : integer) return inst_t;
- function Instr(opcode : opcode_t; reg_a : integer) return inst_t;
- function Instr(opcode : opcode_t; reg_a, reg_b : integer) return inst_t;
- function Instr(opcode : opcode_t; reg_a, reg_b, reg_c : integer) return inst_t;
- function ctrl_lines_default return ctrl_lines_t;
- function idecoder(instr_name : instr_name_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t;
- function idecoder(opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t;
- function gen_murom return murom_t;
- function get_muromaddr (opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return unsigned;
- function MIN (X, Y: INTEGER) return INTEGER;
- function MAX (X, Y: INTEGER) return INTEGER;
-
-end cpu_pkg;
-
-package body cpu_pkg is
-
- function Instr(opcode : opcode_t) return inst_t is
- variable inst : inst_t := (others => '0');
- begin
- inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
- return inst;
-
- end Instr;
-
- function Instr(opcode : opcode_t; data : inst_data_t) return inst_t is
- variable inst : inst_t := (others => '0');
- begin
- inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
- inst(inst_t'length-opcode_t'length-1 downto inst_t'length-opcode_t'length-inst_addr_t'length) := data;
- return inst;
-
- end Instr;
-
- function Instr(opcode : opcode_t; data : inst_data_t; reg : integer) return inst_t is
- variable inst : inst_t := (others => '0');
- begin
- inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
- inst(inst_t'length-opcode_t'length-1 downto inst_t'length-opcode_t'length-inst_data_t'length) := data;
- inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg, reg_ptr_t'length));
-
- return inst;
-
- end Instr;
-
- function Instr(opcode : opcode_t; reg_a : integer) return inst_t is
- variable inst : inst_t := (others => '0');
- begin
- inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
- inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_a, reg_ptr_t'length));
-
- return inst;
-
- end Instr;
-
- function Instr(opcode : opcode_t; reg_a, reg_b : integer) return inst_t is
- variable inst : inst_t := (others => '0');
- begin
- inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
- inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_b, reg_ptr_t'length));
- inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_a, reg_ptr_t'length));
-
- return inst;
-
- end Instr;
-
- function Instr(opcode : opcode_t; reg_a, reg_b, reg_c : integer) return inst_t is
- variable inst : inst_t := (others => '0');
- begin
- inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode;
- inst(3*(reg_ptr_t'length)-1 downto 2*reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_c, reg_ptr_t'length));
- inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_b, reg_ptr_t'length));
- inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_a, reg_ptr_t'length));
-
- return inst;
-
- end Instr;
-
- function ctrl_lines_default return ctrl_lines_t is
- variable result : ctrl_lines_t;
- begin
- result.pc_load := '0';
- result.pc_inc := '0';
- result.stk_push := '0';
- result.stk_pop := '0';
- result.reg_we := '0';
- result.reg_src_sel := alu_src;
- result.ddata_src_sel := reg_a;
- result.daddr_src_sel := reg_b;
- result.alu_opsel := pass_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := reg_b;
- result.alu_load := '0';
- result.alu_cy_in := '0';
- result.mem_access := cmem_access;
- result.mem_read := '0';
- result.mem_write := '0';
- result.int_exit := '0';
- return result;
-
- end ctrl_lines_default;
-
- function idecoder(opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t is
- variable instr_name : instr_name_t;
- begin
- instr_name := instr_name_array(to_integer(opcode));
- return idecoder(instr_name, iphase, status);
- end idecoder;
-
- function idecoder(instr_name : instr_name_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t is
- variable result : ctrl_lines_t;
- variable ze, cy : STD_LOGIC;
-
- begin
- ze := status.alu.zero;
- cy := status.alu.carry;
-
- result := ctrl_lines_default;
- if iphase = 0 then
- result.pc_inc := '1';
- end if;
-
- case instr_name is
-
- when "HALT " =>
- result.pc_inc := '0';
- when "SETC " => -- carry <= 1
- result.reg_src_sel := alu_src;
- result.alu_opsel := pass_op2;
- result.alu_op2_src_sel := reg_b;
- result.alu_load := '1';
- result.alu_cy_in := '1';
- when "MOV|R|R " => -- R(a) <= R(b)
- result.reg_src_sel := alu_src;
- result.alu_opsel := pass_op2;
- result.alu_op2_src_sel := reg_b;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "MOV|R|K " => -- R(a) <= #kk
- result.reg_src_sel := alu_src;
- result.alu_opsel := pass_op2;
- result.alu_op2_src_sel := const;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "MOVC|Ri|R " => -- [R(b)] <= R(a)
- result.mem_access := cmem_access;
- result.daddr_src_sel := reg_b;
- result.ddata_src_sel := reg_a;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "MOVC|Ri|K " => -- [R(a)] <= kk
- result.mem_access := cmem_access;
- result.daddr_src_sel := reg_a;
- result.ddata_src_sel := const;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "COUT|Ri|K " => -- [R(a)] <= kk
- result.mem_access := cio_access;
- result.daddr_src_sel := reg_a;
- result.ddata_src_sel := const;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "MOVC|R|Ri " => -- R(a) <= [R(b)]
- result.mem_access := cmem_access;
- result.reg_src_sel := cmem_src;
- result.daddr_src_sel := reg_b;
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "MOVC|R|Ki " => -- R(a) <= [#addr]
- result.mem_access := cmem_access;
- result.reg_src_sel := cmem_src;
- result.daddr_src_sel := const;
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "CIN|R|Ki " => -- R(a) <= [#addr]
- result.mem_access := cio_access;
- result.reg_src_sel := cmem_src;
- result.daddr_src_sel := const;
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "MOVC|Ki|R " => -- [#addr] <= R(a)
- result.mem_access := cmem_access;
- result.daddr_src_sel := const;
- result.ddata_src_sel := reg_a;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "COUT|Ki|R " => -- [#addr] <= R(a)
- result.mem_access := cio_access;
- result.daddr_src_sel := const;
- result.ddata_src_sel := reg_a;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "MOVX|Ri|R " => -- [R(b)] <= R(a)
- result.mem_access := xmem_access;
- result.daddr_src_sel := reg_b;
- result.ddata_src_sel := reg_a;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "MOVX|Ri|K " => -- [R(a)] <= kk
- result.mem_access := xmem_access;
- result.daddr_src_sel := reg_a;
- result.ddata_src_sel := const;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "XOUT|Ri|K " => -- [R(a)] <= kk
- result.mem_access := xio_access;
- result.daddr_src_sel := reg_a;
- result.ddata_src_sel := const;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "MOVX|R|Ri " => -- R(a) <= [R(b)]
- result.mem_access := xmem_access;
- result.reg_src_sel := xmem_src;
- result.daddr_src_sel := reg_b;
- if iphase = 0 then
- result.mem_read := '1';
- elsif iphase = 1 then
- result.reg_we := '1';
- end if;
- when "MOVX|R|Ki " => -- R(a) <= [#addr]
- result.mem_access := xmem_access;
- result.reg_src_sel := xmem_src;
- result.daddr_src_sel := const;
- if iphase = 0 then
- result.mem_read := '1';
- elsif iphase = 1 then
- result.reg_we := '1';
- end if;
- when "XIN|R|Ki " => -- R(a) <= [#addr]
- result.mem_access := xio_access;
- result.reg_src_sel := xmem_src;
- result.daddr_src_sel := const;
- if iphase = 0 then
- result.mem_read := '1';
- elsif iphase = 1 then
- result.reg_we := '1';
- end if;
- when "MOVX|Ki|R " => -- [#addr] <= R(a)
- result.mem_access := xmem_access;
- result.daddr_src_sel := const;
- result.ddata_src_sel := reg_a;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "XOUT|Ki|R " => -- [#addr] <= R(a)
- result.mem_access := xio_access;
- result.daddr_src_sel := const;
- result.ddata_src_sel := reg_a;
- if iphase = 0 then
- result.mem_write := '1';
- end if;
- when "ADD|R|R " => -- R(a) <= R(a) + R(b)
- result.alu_opsel := op1_add_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := reg_b;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "ADD|R|K " => -- R(a) <= R(a) + k
- result.alu_opsel := op1_add_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := const;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "ADDC|R|R " => -- R(a) <= R(a) + R(b)
- result.alu_opsel := op1_addc_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := reg_b;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "ADDC|R|K " => -- R(a) <= R(a) + k
- result.alu_opsel := op1_addc_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := const;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "SUB|R|R " => -- R(a) <= R(a) + R(b)
- result.alu_opsel := op1_sub_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := reg_b;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "SUB|R|K " => -- R(a) <= R(a) + k
- result.alu_opsel := op1_sub_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := const;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "SUB|K|R " => -- R(a) <= k - R(a)
- result.alu_opsel := op1_sub_op2;
- result.alu_op1_src_sel := const;
- result.alu_op2_src_sel := reg_a;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "SUBC|R|R " => -- R(a) <= R(a) + R(b)
- result.alu_opsel := op1_subc_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := reg_b;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "SUBC|R|K " => -- R(a) <= R(a) + k
- result.alu_opsel := op1_subc_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := const;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "SUBC|K|R " => -- R(a) <= K - R(a)
- result.alu_opsel := op1_subc_op2;
- result.alu_op1_src_sel := const;
- result.alu_op2_src_sel := reg_a;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "AND|R|R " => -- R(a) <= R(a) and R(b)
- result.alu_opsel := op1_and_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := reg_b;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "AND|R|K " => -- R(a) <= R(a) and k
- result.alu_opsel := op1_and_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := const;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "OR|R|R " => -- R(a) <= R(a) or R(b)
- result.alu_opsel := op1_or_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := reg_b;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "OR|R|K " => -- R(a) <= R(a) or R(b)
- result.alu_opsel := op1_or_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := const;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "XOR|R|R " => -- R(a) <= R(a) xor R(b)
- result.alu_opsel := op1_xor_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := reg_b;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "XOR|R|K " => -- R(a) <= R(a) xor R(b)
- result.alu_opsel := op1_xor_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := const;
- result.reg_src_sel := alu_src;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "SWAP|R " => -- R(a) <= R(b)
- result.reg_src_sel := alu_src;
- result.alu_opsel := swap_op;
- result.alu_op1_src_sel := reg_a;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "SHL|R " => -- R(a) <= R(a) xor R(b)
- result.reg_src_sel := alu_src;
- result.alu_opsel := shl_op;
- result.alu_op1_src_sel := reg_a;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "SHR|R " => -- R(a) <= R(a) xor R(b)
- result.reg_src_sel := alu_src;
- result.alu_opsel := shr_op;
- result.alu_op1_src_sel := reg_a;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "ROL|R " => -- R(a) <= R(a) xor R(b)
- result.reg_src_sel := alu_src;
- result.alu_opsel := rol_op;
- result.alu_op1_src_sel := reg_a;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "ROR|R " => -- R(a) <= R(a) xor R(b)
- result.reg_src_sel := alu_src;
- result.alu_opsel := ror_op;
- result.alu_op1_src_sel := reg_a;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "ROLC|R " => -- R(a) <= R(a) xor R(b)
- result.reg_src_sel := alu_src;
- result.alu_opsel := rolc_op;
- result.alu_op1_src_sel := reg_a;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "RORC|R " => -- R(a) <= R(a) xor R(b)
- result.reg_src_sel := alu_src;
- result.alu_opsel := rorc_op;
- result.alu_op1_src_sel := reg_a;
- result.alu_load := '1';
- if iphase = 1 then
- result.reg_we := '1';
- end if;
- when "CMP|R|R " => --
- result.alu_opsel := op1_sub_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := reg_b;
- result.alu_load := '1';
- when "CMP|R|K " => --
- result.alu_opsel := op1_sub_op2;
- result.alu_op1_src_sel := reg_a;
- result.alu_op2_src_sel := const;
- result.alu_load := '1';
- when "JMP|K " => -- PC <= #addr
- if iphase = 0 then
- result.pc_load := '1';
- end if;
- when "JZ|K " => -- PC <= #addr, zero
- if iphase = 0 then
- if ze = '1' then
- result.pc_load := '1';
- end if;
- end if;
- when "JNZ|K " => -- PC <= #addr, !zero
- if iphase = 0 then
- if ze = '0' then
- result.pc_load := '1';
- end if;
- end if;
- when "JC|K " => -- PC <= #addr, carry
- if iphase = 0 then
- if cy = '1' then
- result.pc_load := '1';
- end if;
- end if;
- when "JNC|K " => -- PC <= #addr, !carry
- if iphase = 0 then
- if cy = '0' then
- result.pc_load := '1';
- end if;
- end if;
- when "JLT|K " => -- PC <= #addr, !carry
- if iphase = 0 then
- if cy = '1' then
- result.pc_load := '1';
- end if;
- end if;
- when "JGT|K " => --
- if iphase = 0 then
- if (cy or ze) = '0' then
- result.pc_load := '1';
- end if;
- end if;
- when "JLE|K " => --
- if iphase = 0 then
- if (cy xor ze) = '1' then
- result.pc_load := '1';
- end if;
- end if;
- when "JGE|K " => --
- if iphase = 0 then
- if (not cy or ze) = '1' then
- result.pc_load := '1';
- end if;
- end if;
- when "JEQ|K " => --
- if iphase = 0 then
- if ze = '1' then
- result.pc_load := '1';
- end if;
- end if;
- when "JNE|K " => --
- if iphase = 0 then
- if ze = '0' then
- result.pc_load := '1';
- end if;
- end if;
- when "PUSH|R " => -- push
- if iphase = 0 then
- result.stk_push := '1';
- end if;
- when "POP|R " => -- pop
- result.reg_src_sel := stk_src;
- if iphase = 0 then
- result.stk_pop := '1';
- elsif iphase = 1 then
- result.reg_we := '1';
- end if;
- when "CALL|K " => -- call
- if iphase = 0 then
- result.pc_load := '1';
- result.stk_push := '1';
- end if;
- when "RET " => -- return
- if iphase = 0 then
- result.pc_load := '1';
- result.stk_pop := '1';
- end if;
- when "RETI " => -- return
- result.pc_inc := '0';
- result.int_exit := '1';
-
- when others => null; -- nop
- end case;
-
- return result;
-
- end idecoder;
-
- function gen_murom return murom_t is
- variable result : murom_t;
- variable opcode : opcode_t;
- variable iphase : iphase_t;
- variable addr : unsigned(MUCODE_ADDR_WIDTH-1 downto 0);
- variable status : cpu_status_t;
- variable pos : integer := 0;
-
- begin
- for i in 0 to 2**addr'length-1 loop
- addr := to_unsigned(i, addr'length);
- opcode := addr(opcode'length-1 downto 0);
- pos := opcode'length;
- iphase := 0;
- if addr(pos) = '1' then
- iphase := 1;
- end if;
- pos := pos + 1;
- status.alu.zero := addr(pos);
- pos := pos + 1;
- status.alu.carry := addr(pos);
-
- result(i) := idecoder(opcode, iphase, status);
- end loop;
-
- return result;
- end gen_murom;
-
- function get_muromaddr (opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return unsigned is
- variable addr : unsigned(MUCODE_ADDR_WIDTH-1 downto 0);
- begin
- addr := status.alu.carry & status.alu.zero & to_unsigned(iphase, 1) & opcode;
- return addr;
-
- end get_muromaddr;
-
- -------------------------------------------------------------
- function MIN (X, Y: INTEGER) return INTEGER is
- variable res : integer := X;
- begin
- if Y < X then
- res := Y;
- end if;
-
- return res;
-
- end MIN;
-
- -------------------------------------------------------------
- function MAX (X, Y: INTEGER) return INTEGER is
- variable res : integer := X;
- begin
- if Y > X then
- res := Y;
- end if;
-
- return res;
-
- end MAX;
-
-
-end cpu_pkg;
-
diff --git a/lib/CPUs/JCpu/src/core/dpath_ctrl.vhd b/lib/CPUs/JCpu/src/core/dpath_ctrl.vhd
deleted file mode 100644
index 1610d00..0000000
--- a/lib/CPUs/JCpu/src/core/dpath_ctrl.vhd
+++ /dev/null
@@ -1,87 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The datapath controller
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity dpath_ctrl is
- Generic (
- use_rom : boolean := true
- );
- Port (
- inst_in : in inst_t;
- iphase_in : in iphase_t;
- status_in : in cpu_status_t;
- ctrl_out : out dpath_ctrl_out_t;
- idout : out inst_addr_t;
- ddout : out dmem_data_t
- );
-end dpath_ctrl;
-
-architecture Behavioral of dpath_ctrl is
-
- signal opcode : opcode_t;
- signal ctrl_lines : ctrl_lines_t;
- signal dbg_iname : instr_name_t;
-
-begin
-
- idout <= inst_in(IMEM_ADDR_WIDTH-1 downto 0);
- ddout <= inst_in(REG_SIZE_BITS+DMEM_DATA_WIDTH-1 downto REG_SIZE_BITS);
- opcode <= inst_in(IMEM_DATA_WIDTH-1 downto IMEM_DATA_WIDTH-INST_OPCODE_WIDTH);
-
- ctrl_out.reg_a_ptr <= inst_in(reg_ptr_t'length-1 downto 0);
- ctrl_out.reg_b_ptr <= inst_in(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length);
- ctrl_out.lines <= ctrl_lines;
-
- -- pragma translate_off
- dbg_iname <= instr_name_array(to_integer(opcode));
- -- pragma translate_on
-
-gen_ctrl_rom:
-if use_rom = true generate
-
- i_dec:
- process(opcode, iphase_in, status_in)
- constant rom_data : murom_t := gen_murom;
- variable addr : unsigned(MUCODE_ADDR_WIDTH-1 downto 0);
- begin
- addr := get_muromaddr(opcode, iphase_in, status_in);
- ctrl_lines <= rom_data(to_integer(addr));
- end process;
-end generate;
-
-gen_ctrl:
-if use_rom = false generate
- i_dec:
- process (opcode, iphase_in, status_in)
- begin
- ctrl_lines <= idecoder(opcode, iphase_in, status_in);
- end process;
-end generate;
-
-end Behavioral;
-
diff --git a/lib/CPUs/JCpu/src/core/int_ctrl.vhd b/lib/CPUs/JCpu/src/core/int_ctrl.vhd
deleted file mode 100644
index ebff3db..0000000
--- a/lib/CPUs/JCpu/src/core/int_ctrl.vhd
+++ /dev/null
@@ -1,138 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: Interrupt controller
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity int_ctrl is
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- ctrl_in : in int_ctrl_in_t;
- int_in : in STD_LOGIC;
- int_exit : in STD_LOGIC;
- iphase_in : in iphase_t;
- pc_addr_out : out inst_addr_t;
- int_ack_out : out STD_LOGIC;
- stat_save_out : out STD_LOGIC;
- stat_rest_out : out STD_LOGIC;
- pc_load_out : out STD_LOGIC;
- stk_push_out : out STD_LOGIC;
- stk_pop_out : out STD_LOGIC
- );
-end int_ctrl;
-
-architecture Behavioral of int_ctrl is
-
- type int_state_t is (int_idle, int_inject, int_active, int_release);
-
- signal int_state, int_state_next : int_state_t;
- signal pc_load, int_ack, stk_push, stk_pop : STD_LOGIC;
- signal int_request : std_logic;
-
-
-begin
-
- int_ack_out <= int_ack;
- pc_load_out <= pc_load;
- stk_push_out <= stk_push;
- stk_pop_out <= stk_pop;
-
------------------------------------------------------------------------
-irg_ctrl_fsm:
- process (int_state, iphase_in, int_request, int_exit)
- begin
-
- pc_addr_out <= to_unsigned(1, inst_addr_t'length);
- int_state_next <= int_state;
- int_ack <= '0';
- pc_load <= '0';
- stk_push <= '0';
- stk_pop <= '0';
- case int_state is
-
- when int_idle =>
- if int_request = '1' and iphase_in = 1 then
- int_state_next <= int_inject;
- end if;
- when int_inject =>
- if iphase_in = 0 then
- int_ack <= '1';
- pc_load <= '1';
- elsif iphase_in = 1 then
- stk_push <= '1';
- int_state_next <= int_active;
- end if;
- when int_active =>
- if int_exit = '1' and iphase_in = 1 then
- int_state_next <= int_release;
- end if;
- when int_release =>
- if iphase_in = 0 then
- stk_pop <= '1';
- pc_load <= '1';
- elsif iphase_in = 1 then
- int_state_next <= int_idle;
- end if;
- when others =>
- int_state_next <= int_idle;
- end case;
-
- end process;
-
-irq_ctrl_states:
- process (rst, clk, int_state_next)
- begin
- if rst = '1' then
- int_state <= int_idle;
- elsif rising_edge(clk) then
- int_state <= int_state_next;
- end if;
- end process;
-
------------------------------------------------------------------------
-pin_sample:
- process (clk)
- begin
- if rising_edge(clk) then
- int_request <= '0';
- if ctrl_in.enable = '1' then
- int_request <= int_in;
- end if;
- end if;
- end process;
-
------------------------------------------------------------------------
-stat_save_restore:
- process (clk, stk_push, stk_pop)
- begin
- if rising_edge(clk) then
- stat_save_out <= stk_push;
- stat_rest_out <= stk_pop;
- end if;
- end process;
-
-end Behavioral;
diff --git a/lib/CPUs/JCpu/src/core/pc.vhd b/lib/CPUs/JCpu/src/core/pc.vhd
deleted file mode 100644
index 6b1d575..0000000
--- a/lib/CPUs/JCpu/src/core/pc.vhd
+++ /dev/null
@@ -1,70 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: Programm counter
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity pc is
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- inc : in STD_LOGIC;
- load : in STD_LOGIC;
- pc_in : in inst_addr_t;
- pc_out : out inst_addr_t;
- pc_next : out inst_addr_t
- );
-end pc;
-
-architecture Behavioral of pc is
-
-begin
-
-proc_pc:
- process(rst, clk, inc, load, pc_in)
- variable vpc, vpc_reg: inst_addr_t;
- begin
- if rst = '1' then
- vpc_reg := (others => '0');
- elsif rising_edge(clk) then
- if inc = '1' or load = '1' then
- vpc_reg := vpc;
- elsif inc = '0' then
- pc_next <= vpc;
- end if;
- end if;
-
- if load = '1' then
- vpc := pc_in;
- else
- vpc := vpc_reg + 1;
- end if;
- pc_out <= vpc_reg;
-
- end process;
-
-end Behavioral;
-
diff --git a/lib/CPUs/JCpu/src/core/reg_dual.vhd b/lib/CPUs/JCpu/src/core/reg_dual.vhd
deleted file mode 100644
index 6b7e4d8..0000000
--- a/lib/CPUs/JCpu/src/core/reg_dual.vhd
+++ /dev/null
@@ -1,81 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: On-Chip work registers
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity reg_dual is
- Generic (
- addr_width : integer := 3;
- data_width : integer := 8
- );
- Port (
- clk : in STD_LOGIC;
- we_a : in STD_LOGIC;
- ptr_a : in reg_ptr_t;
- ptr_b : in reg_ptr_t;
- din_a : in unsigned (data_width-1 downto 0);
- dout_a : out unsigned (data_width-1 downto 0);
- dout_b : out unsigned (data_width-1 downto 0)
- );
-end reg_dual;
-
-architecture Behavioral of reg_dual is
-
- constant depth : integer := 2**addr_width;
- type mem_t is array (0 to depth-1) of unsigned (data_width-1 downto 0);
- signal addr_a, addr_b : unsigned (addr_width-1 downto 0) := (others => '0');
-
- signal mem : mem_t;
-begin
-
- addr_a <= TO_01(ptr_a(addr_width-1 downto 0));
- addr_b <= TO_01(ptr_b(addr_width-1 downto 0));
-
-reg_in_ab:
- process(clk)
- begin
- if rising_edge(clk) then
- if we_a = '1' then
- mem(to_integer(addr_a)) <= din_a;
- end if;
- end if;
- end process;
-
-reg_out_a:
- process(mem, addr_a)
- begin
- dout_a <= TO_01(mem(to_integer(addr_a)));
- end process;
-
-reg_out_b:
- process(mem, addr_b)
- begin
- dout_b <= TO_01(mem(to_integer(addr_b)));
- end process;
-
-end Behavioral;
-
diff --git a/lib/CPUs/JCpu/src/core/stack_ctrl.vhd b/lib/CPUs/JCpu/src/core/stack_ctrl.vhd
deleted file mode 100644
index 7eccae3..0000000
--- a/lib/CPUs/JCpu/src/core/stack_ctrl.vhd
+++ /dev/null
@@ -1,73 +0,0 @@
---------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The call/return/data stack
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity stack_ctrl is
-Generic (
- addr_width : integer := 3
-);
-Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- push : in STD_LOGIC;
- pop : in STD_LOGIC;
- ptr_out : out unsigned (addr_width-1 downto 0);
- din : in inst_addr_t;
- dout : out inst_addr_t;
- mem_we : out STD_LOGIC
- );
-end stack_ctrl;
-
-architecture Behavioral of stack_ctrl is
-
- signal ptr : unsigned (addr_width-1 downto 0);
-
-begin
-
- ptr_out <= ptr;
-
-stk_ptr:
- process(rst, clk, ptr, push, pop)
- begin
- if rst = '1' then
- ptr <= (others => '0');
- dout <= (others => '0');
- mem_we <= '0';
- elsif rising_edge(clk) then
- mem_we <= push;
- if push = '1' then
- ptr <= ptr + 1;
- dout <= din;
- elsif pop = '1' then
- ptr <= ptr - 1;
- end if;
- end if;
- end process;
-
-end Behavioral;
-
diff --git a/lib/CPUs/JCpu/src/cpu_embedded.vhd b/lib/CPUs/JCpu/src/cpu_embedded.vhd
deleted file mode 100644
index 56c6dec..0000000
--- a/lib/CPUs/JCpu/src/cpu_embedded.vhd
+++ /dev/null
@@ -1,106 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: cpu_embedded using cpu_core and rom
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-library IEEE;
-use IEEE.STD_LOGIC_1164.ALL;
-use IEEE.numeric_std.ALL;
-
-use work.cpu_pkg.all;
-
-entity cpu_embedded is
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- int_in : in STD_LOGIC;
- int_ack : out STD_LOGIC;
- xmem_we : out STD_LOGIC;
- xmem_re : out STD_LOGIC;
- xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_addr : out unsigned (DMEM_ADDR_WIDTH-1 downto 0);
- io_sel : out STD_LOGIC
- );
-end cpu_embedded;
-
-architecture rtl of cpu_embedded is
-
- signal irom_data : unsigned (IMEM_DATA_WIDTH-1 downto 0);
- signal irom_addr : unsigned (IMEM_ADDR_WIDTH-1 downto 0);
-
- COMPONENT cpu
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- int_in : in STD_LOGIC;
- int_ack : out STD_LOGIC;
- xmem_we : out STD_LOGIC;
- xmem_re : out STD_LOGIC;
- instr_din : in unsigned (IMEM_DATA_WIDTH-1 downto 0);
- instr_addr : out unsigned (IMEM_ADDR_WIDTH-1 downto 0);
- xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_addr : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
- io_sel : out STD_LOGIC
- );
- END COMPONENT;
-
-
- COMPONENT irom
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
- END COMPONENT;
-
-begin
-
-inst_cpu: cpu
- PORT MAP(
- rst => rst,
- clk => clk,
- ce => ce,
- int_in => int_in,
- int_ack => int_ack,
- xmem_we => xmem_we,
- xmem_re => xmem_re,
- instr_din => irom_data,
- instr_addr => irom_addr,
- xmem_din => xmem_din,
- xmem_dout => xmem_dout,
- xmem_addr => xmem_addr,
- io_sel => io_sel
- );
-
-inst_irom: irom
- PORT MAP(
- clk => clk,
- ce => ce,
- addr => irom_addr,
- dout => irom_data
- );
-
-end rtl;
diff --git a/lib/CPUs/JCpu/src/dctest_irom.vhdl b/lib/CPUs/JCpu/src/dctest_irom.vhdl
deleted file mode 100644
index 7987a15..0000000
--- a/lib/CPUs/JCpu/src/dctest_irom.vhdl
+++ /dev/null
@@ -1,79 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-ENTITY irom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
-END irom;
-
-ARCHITECTURE dctest OF irom IS
-
- type imem_rom_t is array (0 to 17) of inst_t;
-
- -- Assembled from dctest.jsm
- constant imem_rom : imem_rom_t :=
- (
- "110000" & X"010", -- 0x000: JMP 0x010
- "110000" & X"011", -- 0x001: JMP 0x011
- "000000" & X"000", -- 0x002:
- "000000" & X"000", -- 0x003:
- "000000" & X"000", -- 0x004:
- "000000" & X"000", -- 0x005:
- "000000" & X"000", -- 0x006:
- "000000" & X"000", -- 0x007:
- "000000" & X"000", -- 0x008:
- "000000" & X"000", -- 0x009:
- "000000" & X"000", -- 0x00A:
- "000000" & X"000", -- 0x00B:
- "000000" & X"000", -- 0x00C:
- "000000" & X"000", -- 0x00D:
- "000000" & X"000", -- 0x00E:
- "000000" & X"000", -- 0x00F:
- "110000" & X"010", -- 0x010: JMP 0x010
- "111111" & X"000" -- 0x011: RETI
- );
-
-begin
-
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= imem_rom(to_integer(addr));
- end if;
- end process;
-
-end dctest;
-
diff --git a/lib/CPUs/JCpu/src/dctest_irom_ld.vhdl b/lib/CPUs/JCpu/src/dctest_irom_ld.vhdl
deleted file mode 100644
index 223dd46..0000000
--- a/lib/CPUs/JCpu/src/dctest_irom_ld.vhdl
+++ /dev/null
@@ -1,1181 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY irom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
-
-END irom;
-
-ARCHITECTURE loadable OF irom IS
-
- -- JASM_ROM_INSERT_HERE
-
- -- Assembled from dctest.jsm
- type imem_rom_t is array (0 to 1023) of inst_t;
- signal imem_rom : imem_rom_t :=
- (
- "110000" & X"010", -- 0x000: JMP 0x010
- "110000" & X"011", -- 0x001: JMP 0x011
- "000000" & X"000", -- 0x002:
- "000000" & X"000", -- 0x003:
- "000000" & X"000", -- 0x004:
- "000000" & X"000", -- 0x005:
- "000000" & X"000", -- 0x006:
- "000000" & X"000", -- 0x007:
- "000000" & X"000", -- 0x008:
- "000000" & X"000", -- 0x009:
- "000000" & X"000", -- 0x00A:
- "000000" & X"000", -- 0x00B:
- "000000" & X"000", -- 0x00C:
- "000000" & X"000", -- 0x00D:
- "000000" & X"000", -- 0x00E:
- "000000" & X"000", -- 0x00F:
- "110000" & X"010", -- 0x010: JMP 0x010
- "111111" & X"000", -- 0x011: RETI
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000"
- );
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : inst_addr_t;
- signal jtag_ld_dout : inst_t;
- signal jtag_ld_din : inst_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (31 downto 0);
- constant id : unsigned (31 downto 0) := X"BABE" & X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst1 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 1 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-inst_addr_t'length+1);
- jtag_ld_din <= user_regi(inst_t'length-1 downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto inst_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= imem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- imem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= imem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/JCpu/src/dctest_xrom.vhdl b/lib/CPUs/JCpu/src/dctest_xrom.vhdl
deleted file mode 100644
index 24fe36c..0000000
--- a/lib/CPUs/JCpu/src/dctest_xrom.vhdl
+++ /dev/null
@@ -1,317 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-ENTITY xrom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in dmem_addr_t;
- dout : out dmem_data_t
- );
-END xrom;
-
-ARCHITECTURE dctest OF xrom IS
-
- type xmem_rom_t is array (0 to 255) of dmem_data_t;
-
- -- Assembled from dctest.jsm
- constant xmem_rom : xmem_rom_t :=
- (
- X"00", -- 0x00
- X"00", -- 0x01
- X"00", -- 0x02
- X"00", -- 0x03
- X"01", -- 0x04
- X"12", -- 0x05
- X"41", -- 0x06
- X"00", -- 0x07
- X"00", -- 0x08
- X"00", -- 0x09
- X"00", -- 0x0A
- X"00", -- 0x0B
- X"00", -- 0x0C
- X"00", -- 0x0D
- X"00", -- 0x0E
- X"00", -- 0x0F
- X"00", -- 0x10
- X"00", -- 0x11
- X"00", -- 0x12
- X"00", -- 0x13
- X"00", -- 0x14
- X"00", -- 0x15
- X"00", -- 0x16
- X"48", -- 0x17
- X"61", -- 0x18
- X"6C", -- 0x19
- X"6C", -- 0x1A
- X"6F", -- 0x1B
- X"0D", -- 0x1C
- X"0A", -- 0x1D
- X"00", -- 0x1E
- X"4A", -- 0x1F
- X"65", -- 0x20
- X"6E", -- 0x21
- X"73", -- 0x22
- X"00", -- 0x23
- X"57", -- 0x24
- X"65", -- 0x25
- X"6C", -- 0x26
- X"63", -- 0x27
- X"6F", -- 0x28
- X"6D", -- 0x29
- X"65", -- 0x2A
- X"20", -- 0x2B
- X"74", -- 0x2C
- X"6F", -- 0x2D
- X"20", -- 0x2E
- X"4A", -- 0x2F
- X"41", -- 0x30
- X"53", -- 0x31
- X"4D", -- 0x32
- X"20", -- 0x33
- X"43", -- 0x34
- X"50", -- 0x35
- X"55", -- 0x36
- X"00", -- 0x37
- X"52", -- 0x38
- X"65", -- 0x39
- X"61", -- 0x3A
- X"64", -- 0x3B
- X"79", -- 0x3C
- X"00", -- 0x3D
- X"54", -- 0x3E
- X"65", -- 0x3F
- X"73", -- 0x40
- X"74", -- 0x41
- X"69", -- 0x42
- X"6E", -- 0x43
- X"67", -- 0x44
- X"00", -- 0x45
- X"50", -- 0x46
- X"61", -- 0x47
- X"73", -- 0x48
- X"73", -- 0x49
- X"65", -- 0x4A
- X"64", -- 0x4B
- X"00", -- 0x4C
- X"45", -- 0x4D
- X"72", -- 0x4E
- X"72", -- 0x4F
- X"6F", -- 0x50
- X"72", -- 0x51
- X"00", -- 0x52
- X"0D", -- 0x53
- X"0A", -- 0x54
- X"00", -- 0x55
- X"00", -- 0x56
- X"00", -- 0x57
- X"00", -- 0x58
- X"00", -- 0x59
- X"00", -- 0x5A
- X"00", -- 0x5B
- X"00", -- 0x5C
- X"00", -- 0x5D
- X"00", -- 0x5E
- X"00", -- 0x5F
- X"00", -- 0x60
- X"00", -- 0x61
- X"00", -- 0x62
- X"00", -- 0x63
- X"00", -- 0x64
- X"00", -- 0x65
- X"00", -- 0x66
- X"00", -- 0x67
- X"00", -- 0x68
- X"00", -- 0x69
- X"00", -- 0x6A
- X"00", -- 0x6B
- X"00", -- 0x6C
- X"00", -- 0x6D
- X"00", -- 0x6E
- X"00", -- 0x6F
- X"00", -- 0x70
- X"00", -- 0x71
- X"00", -- 0x72
- X"00", -- 0x73
- X"00", -- 0x74
- X"00", -- 0x75
- X"00", -- 0x76
- X"00", -- 0x77
- X"00", -- 0x78
- X"00", -- 0x79
- X"00", -- 0x7A
- X"00", -- 0x7B
- X"00", -- 0x7C
- X"00", -- 0x7D
- X"00", -- 0x7E
- X"00", -- 0x7F
- X"00", -- 0x80
- X"00", -- 0x81
- X"00", -- 0x82
- X"00", -- 0x83
- X"00", -- 0x84
- X"00", -- 0x85
- X"00", -- 0x86
- X"00", -- 0x87
- X"00", -- 0x88
- X"00", -- 0x89
- X"00", -- 0x8A
- X"00", -- 0x8B
- X"00", -- 0x8C
- X"00", -- 0x8D
- X"00", -- 0x8E
- X"00", -- 0x8F
- X"00", -- 0x90
- X"00", -- 0x91
- X"00", -- 0x92
- X"00", -- 0x93
- X"00", -- 0x94
- X"00", -- 0x95
- X"00", -- 0x96
- X"00", -- 0x97
- X"00", -- 0x98
- X"00", -- 0x99
- X"00", -- 0x9A
- X"00", -- 0x9B
- X"00", -- 0x9C
- X"00", -- 0x9D
- X"00", -- 0x9E
- X"00", -- 0x9F
- X"00", -- 0xA0
- X"00", -- 0xA1
- X"00", -- 0xA2
- X"00", -- 0xA3
- X"00", -- 0xA4
- X"00", -- 0xA5
- X"00", -- 0xA6
- X"00", -- 0xA7
- X"00", -- 0xA8
- X"00", -- 0xA9
- X"00", -- 0xAA
- X"00", -- 0xAB
- X"00", -- 0xAC
- X"00", -- 0xAD
- X"00", -- 0xAE
- X"00", -- 0xAF
- X"00", -- 0xB0
- X"00", -- 0xB1
- X"00", -- 0xB2
- X"00", -- 0xB3
- X"00", -- 0xB4
- X"00", -- 0xB5
- X"00", -- 0xB6
- X"00", -- 0xB7
- X"00", -- 0xB8
- X"00", -- 0xB9
- X"00", -- 0xBA
- X"00", -- 0xBB
- X"00", -- 0xBC
- X"00", -- 0xBD
- X"00", -- 0xBE
- X"00", -- 0xBF
- X"00", -- 0xC0
- X"00", -- 0xC1
- X"00", -- 0xC2
- X"00", -- 0xC3
- X"00", -- 0xC4
- X"00", -- 0xC5
- X"00", -- 0xC6
- X"00", -- 0xC7
- X"00", -- 0xC8
- X"00", -- 0xC9
- X"00", -- 0xCA
- X"00", -- 0xCB
- X"00", -- 0xCC
- X"00", -- 0xCD
- X"00", -- 0xCE
- X"00", -- 0xCF
- X"00", -- 0xD0
- X"00", -- 0xD1
- X"00", -- 0xD2
- X"00", -- 0xD3
- X"00", -- 0xD4
- X"00", -- 0xD5
- X"00", -- 0xD6
- X"00", -- 0xD7
- X"00", -- 0xD8
- X"00", -- 0xD9
- X"00", -- 0xDA
- X"00", -- 0xDB
- X"00", -- 0xDC
- X"00", -- 0xDD
- X"00", -- 0xDE
- X"00", -- 0xDF
- X"00", -- 0xE0
- X"00", -- 0xE1
- X"00", -- 0xE2
- X"00", -- 0xE3
- X"00", -- 0xE4
- X"00", -- 0xE5
- X"00", -- 0xE6
- X"00", -- 0xE7
- X"00", -- 0xE8
- X"00", -- 0xE9
- X"00", -- 0xEA
- X"00", -- 0xEB
- X"00", -- 0xEC
- X"00", -- 0xED
- X"00", -- 0xEE
- X"00", -- 0xEF
- X"00", -- 0xF0
- X"00", -- 0xF1
- X"00", -- 0xF2
- X"00", -- 0xF3
- X"00", -- 0xF4
- X"00", -- 0xF5
- X"00", -- 0xF6
- X"00", -- 0xF7
- X"00", -- 0xF8
- X"00", -- 0xF9
- X"00", -- 0xFA
- X"00", -- 0xFB
- X"00", -- 0xFC
- X"00", -- 0xFD
- X"00", -- 0xFE
- X"00" -- 0xFF
- );
-
-begin
-
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= xmem_rom(to_integer(addr));
- end if;
- end process;
-
-end dctest;
-
diff --git a/lib/CPUs/JCpu/src/dctest_xrom_ld.vhdl b/lib/CPUs/JCpu/src/dctest_xrom_ld.vhdl
deleted file mode 100644
index 802ba50..0000000
--- a/lib/CPUs/JCpu/src/dctest_xrom_ld.vhdl
+++ /dev/null
@@ -1,413 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY xrom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in dmem_addr_t;
- dout : out dmem_data_t
- );
-
-END xrom;
-
-ARCHITECTURE loadable OF xrom IS
-
- -- JASM_ROM_INSERT_HERE
-
- -- Assembled from dctest.jsm
- type xmem_rom_t is array (0 to 255) of dmem_data_t;
- signal xmem_rom : xmem_rom_t :=
- (
- X"00", -- 0x00
- X"00", -- 0x01
- X"00", -- 0x02
- X"00", -- 0x03
- X"01", -- 0x04
- X"12", -- 0x05
- X"41", -- 0x06
- X"00", -- 0x07
- X"00", -- 0x08
- X"00", -- 0x09
- X"00", -- 0x0A
- X"00", -- 0x0B
- X"00", -- 0x0C
- X"00", -- 0x0D
- X"00", -- 0x0E
- X"00", -- 0x0F
- X"00", -- 0x10
- X"00", -- 0x11
- X"00", -- 0x12
- X"00", -- 0x13
- X"00", -- 0x14
- X"00", -- 0x15
- X"00", -- 0x16
- X"48", -- 0x17
- X"61", -- 0x18
- X"6C", -- 0x19
- X"6C", -- 0x1A
- X"6F", -- 0x1B
- X"0D", -- 0x1C
- X"0A", -- 0x1D
- X"00", -- 0x1E
- X"4A", -- 0x1F
- X"65", -- 0x20
- X"6E", -- 0x21
- X"73", -- 0x22
- X"00", -- 0x23
- X"57", -- 0x24
- X"65", -- 0x25
- X"6C", -- 0x26
- X"63", -- 0x27
- X"6F", -- 0x28
- X"6D", -- 0x29
- X"65", -- 0x2A
- X"20", -- 0x2B
- X"74", -- 0x2C
- X"6F", -- 0x2D
- X"20", -- 0x2E
- X"4A", -- 0x2F
- X"41", -- 0x30
- X"53", -- 0x31
- X"4D", -- 0x32
- X"20", -- 0x33
- X"43", -- 0x34
- X"50", -- 0x35
- X"55", -- 0x36
- X"00", -- 0x37
- X"52", -- 0x38
- X"65", -- 0x39
- X"61", -- 0x3A
- X"64", -- 0x3B
- X"79", -- 0x3C
- X"00", -- 0x3D
- X"54", -- 0x3E
- X"65", -- 0x3F
- X"73", -- 0x40
- X"74", -- 0x41
- X"69", -- 0x42
- X"6E", -- 0x43
- X"67", -- 0x44
- X"00", -- 0x45
- X"50", -- 0x46
- X"61", -- 0x47
- X"73", -- 0x48
- X"73", -- 0x49
- X"65", -- 0x4A
- X"64", -- 0x4B
- X"00", -- 0x4C
- X"45", -- 0x4D
- X"72", -- 0x4E
- X"72", -- 0x4F
- X"6F", -- 0x50
- X"72", -- 0x51
- X"00", -- 0x52
- X"0D", -- 0x53
- X"0A", -- 0x54
- X"00", -- 0x55
- X"00", -- 0x56
- X"00", -- 0x57
- X"00", -- 0x58
- X"00", -- 0x59
- X"00", -- 0x5A
- X"00", -- 0x5B
- X"00", -- 0x5C
- X"00", -- 0x5D
- X"00", -- 0x5E
- X"00", -- 0x5F
- X"00", -- 0x60
- X"00", -- 0x61
- X"00", -- 0x62
- X"00", -- 0x63
- X"00", -- 0x64
- X"00", -- 0x65
- X"00", -- 0x66
- X"00", -- 0x67
- X"00", -- 0x68
- X"00", -- 0x69
- X"00", -- 0x6A
- X"00", -- 0x6B
- X"00", -- 0x6C
- X"00", -- 0x6D
- X"00", -- 0x6E
- X"00", -- 0x6F
- X"00", -- 0x70
- X"00", -- 0x71
- X"00", -- 0x72
- X"00", -- 0x73
- X"00", -- 0x74
- X"00", -- 0x75
- X"00", -- 0x76
- X"00", -- 0x77
- X"00", -- 0x78
- X"00", -- 0x79
- X"00", -- 0x7A
- X"00", -- 0x7B
- X"00", -- 0x7C
- X"00", -- 0x7D
- X"00", -- 0x7E
- X"00", -- 0x7F
- X"00", -- 0x80
- X"00", -- 0x81
- X"00", -- 0x82
- X"00", -- 0x83
- X"00", -- 0x84
- X"00", -- 0x85
- X"00", -- 0x86
- X"00", -- 0x87
- X"00", -- 0x88
- X"00", -- 0x89
- X"00", -- 0x8A
- X"00", -- 0x8B
- X"00", -- 0x8C
- X"00", -- 0x8D
- X"00", -- 0x8E
- X"00", -- 0x8F
- X"00", -- 0x90
- X"00", -- 0x91
- X"00", -- 0x92
- X"00", -- 0x93
- X"00", -- 0x94
- X"00", -- 0x95
- X"00", -- 0x96
- X"00", -- 0x97
- X"00", -- 0x98
- X"00", -- 0x99
- X"00", -- 0x9A
- X"00", -- 0x9B
- X"00", -- 0x9C
- X"00", -- 0x9D
- X"00", -- 0x9E
- X"00", -- 0x9F
- X"00", -- 0xA0
- X"00", -- 0xA1
- X"00", -- 0xA2
- X"00", -- 0xA3
- X"00", -- 0xA4
- X"00", -- 0xA5
- X"00", -- 0xA6
- X"00", -- 0xA7
- X"00", -- 0xA8
- X"00", -- 0xA9
- X"00", -- 0xAA
- X"00", -- 0xAB
- X"00", -- 0xAC
- X"00", -- 0xAD
- X"00", -- 0xAE
- X"00", -- 0xAF
- X"00", -- 0xB0
- X"00", -- 0xB1
- X"00", -- 0xB2
- X"00", -- 0xB3
- X"00", -- 0xB4
- X"00", -- 0xB5
- X"00", -- 0xB6
- X"00", -- 0xB7
- X"00", -- 0xB8
- X"00", -- 0xB9
- X"00", -- 0xBA
- X"00", -- 0xBB
- X"00", -- 0xBC
- X"00", -- 0xBD
- X"00", -- 0xBE
- X"00", -- 0xBF
- X"00", -- 0xC0
- X"00", -- 0xC1
- X"00", -- 0xC2
- X"00", -- 0xC3
- X"00", -- 0xC4
- X"00", -- 0xC5
- X"00", -- 0xC6
- X"00", -- 0xC7
- X"00", -- 0xC8
- X"00", -- 0xC9
- X"00", -- 0xCA
- X"00", -- 0xCB
- X"00", -- 0xCC
- X"00", -- 0xCD
- X"00", -- 0xCE
- X"00", -- 0xCF
- X"00", -- 0xD0
- X"00", -- 0xD1
- X"00", -- 0xD2
- X"00", -- 0xD3
- X"00", -- 0xD4
- X"00", -- 0xD5
- X"00", -- 0xD6
- X"00", -- 0xD7
- X"00", -- 0xD8
- X"00", -- 0xD9
- X"00", -- 0xDA
- X"00", -- 0xDB
- X"00", -- 0xDC
- X"00", -- 0xDD
- X"00", -- 0xDE
- X"00", -- 0xDF
- X"00", -- 0xE0
- X"00", -- 0xE1
- X"00", -- 0xE2
- X"00", -- 0xE3
- X"00", -- 0xE4
- X"00", -- 0xE5
- X"00", -- 0xE6
- X"00", -- 0xE7
- X"00", -- 0xE8
- X"00", -- 0xE9
- X"00", -- 0xEA
- X"00", -- 0xEB
- X"00", -- 0xEC
- X"00", -- 0xED
- X"00", -- 0xEE
- X"00", -- 0xEF
- X"00", -- 0xF0
- X"00", -- 0xF1
- X"00", -- 0xF2
- X"00", -- 0xF3
- X"00", -- 0xF4
- X"00", -- 0xF5
- X"00", -- 0xF6
- X"00", -- 0xF7
- X"00", -- 0xF8
- X"00", -- 0xF9
- X"00", -- 0xFA
- X"00", -- 0xFB
- X"00", -- 0xFC
- X"00", -- 0xFD
- X"00", -- 0xFE
- X"00" -- 0xFF
- );
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : dmem_addr_t;
- signal jtag_ld_dout : dmem_data_t;
- signal jtag_ld_din : dmem_data_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (15 downto 0);
- constant id : unsigned (15 downto 0) := X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
- jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= xmem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/JCpu/src/itest_irom.vhdl b/lib/CPUs/JCpu/src/itest_irom.vhdl
deleted file mode 100644
index 0ed28f2..0000000
--- a/lib/CPUs/JCpu/src/itest_irom.vhdl
+++ /dev/null
@@ -1,1086 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-ENTITY irom IS
- Port
- (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
-END irom;
-
-ARCHITECTURE itest OF irom IS
-
- type imem_rom_t is array (0 to 1023) of inst_t;
-
- -- Assembled from itest.jsm
- constant imem_rom : imem_rom_t :=
- (
- "110000" & X"010", -- 0x000: JMP 0x010
- "110000" & X"288", -- 0x001: JMP 0x288
- "000000" & X"000", -- 0x002:
- "000000" & X"000", -- 0x003:
- "000000" & X"000", -- 0x004:
- "000000" & X"000", -- 0x005:
- "000000" & X"000", -- 0x006:
- "000000" & X"000", -- 0x007:
- "000000" & X"000", -- 0x008:
- "000000" & X"000", -- 0x009:
- "000000" & X"000", -- 0x00A:
- "000000" & X"000", -- 0x00B:
- "000000" & X"000", -- 0x00C:
- "000000" & X"000", -- 0x00D:
- "000000" & X"000", -- 0x00E:
- "000000" & X"000", -- 0x00F:
- "111011" & X"03B", -- 0x010: CALL 0x03B
- "101001" & X"000", -- 0x011: CIN R00, (0x00)
- "100100" & X"000", -- 0x012: XOUT (0x00), R00
- "111011" & X"04C", -- 0x013: CALL 0x04C
- "000011" & X"010", -- 0x014: MOV R00, 0x01
- "100100" & X"010", -- 0x015: XOUT (0x01), R00
- "111011" & X"08D", -- 0x016: CALL 0x08D
- "000011" & X"020", -- 0x017: MOV R00, 0x02
- "100100" & X"010", -- 0x018: XOUT (0x01), R00
- "111011" & X"0C9", -- 0x019: CALL 0x0C9
- "000011" & X"030", -- 0x01A: MOV R00, 0x03
- "100100" & X"010", -- 0x01B: XOUT (0x01), R00
- "111011" & X"0DB", -- 0x01C: CALL 0x0DB
- "000011" & X"040", -- 0x01D: MOV R00, 0x04
- "100100" & X"010", -- 0x01E: XOUT (0x01), R00
- "111011" & X"0ED", -- 0x01F: CALL 0x0ED
- "000011" & X"050", -- 0x020: MOV R00, 0x05
- "100100" & X"010", -- 0x021: XOUT (0x01), R00
- "111011" & X"0FF", -- 0x022: CALL 0x0FF
- "000011" & X"060", -- 0x023: MOV R00, 0x06
- "100100" & X"010", -- 0x024: XOUT (0x01), R00
- "111011" & X"115", -- 0x025: CALL 0x115
- "000011" & X"070", -- 0x026: MOV R00, 0x07
- "100100" & X"010", -- 0x027: XOUT (0x01), R00
- "111011" & X"12B", -- 0x028: CALL 0x12B
- "000011" & X"080", -- 0x029: MOV R00, 0x08
- "100100" & X"010", -- 0x02A: XOUT (0x01), R00
- "111011" & X"137", -- 0x02B: CALL 0x137
- "000011" & X"090", -- 0x02C: MOV R00, 0x09
- "100100" & X"010", -- 0x02D: XOUT (0x01), R00
- "111011" & X"15A", -- 0x02E: CALL 0x15A
- "000011" & X"0A0", -- 0x02F: MOV R00, 0x0A
- "100100" & X"010", -- 0x030: XOUT (0x01), R00
- "111011" & X"22A", -- 0x031: CALL 0x22A
- "000011" & X"0B0", -- 0x032: MOV R00, 0x0B
- "100100" & X"010", -- 0x033: XOUT (0x01), R00
- "111011" & X"24D", -- 0x034: CALL 0x24D
- "000011" & X"0C0", -- 0x035: MOV R00, 0x0C
- "100100" & X"010", -- 0x036: XOUT (0x01), R00
- "111011" & X"278", -- 0x037: CALL 0x278
- "000011" & X"FF0", -- 0x038: MOV R00, 0xFF
- "100100" & X"010", -- 0x039: XOUT (0x01), R00
- "110000" & X"2FF", -- 0x03A: JMP 0x2FF
- "000011" & X"000", -- 0x03B: MOV R00, 0x00
- "000011" & X"001", -- 0x03C: MOV R01, 0x00
- "000011" & X"002", -- 0x03D: MOV R02, 0x00
- "000011" & X"003", -- 0x03E: MOV R03, 0x00
- "000011" & X"004", -- 0x03F: MOV R04, 0x00
- "000011" & X"005", -- 0x040: MOV R05, 0x00
- "000011" & X"006", -- 0x041: MOV R06, 0x00
- "000011" & X"007", -- 0x042: MOV R07, 0x00
- "000011" & X"008", -- 0x043: MOV R08, 0x00
- "000011" & X"009", -- 0x044: MOV R09, 0x00
- "000011" & X"00A", -- 0x045: MOV R10, 0x00
- "000011" & X"00B", -- 0x046: MOV R11, 0x00
- "000011" & X"00C", -- 0x047: MOV R12, 0x00
- "000011" & X"00D", -- 0x048: MOV R13, 0x00
- "000011" & X"00E", -- 0x049: MOV R14, 0x00
- "000011" & X"00F", -- 0x04A: MOV R15, 0x00
- "111110" & X"000", -- 0x04B: RET
- "000011" & X"100", -- 0x04C: MOV R00, 0x10
- "001111" & X"100", -- 0x04D: CMP R00, 0x10
- "111010" & X"3FF", -- 0x04E: JNE 0x3FF
- "010001" & X"010", -- 0x04F: ADD R00, 0x01
- "000010" & X"001", -- 0x050: MOV R01, R00
- "001111" & X"111", -- 0x051: CMP R01, 0x11
- "111010" & X"3FF", -- 0x052: JNE 0x3FF
- "010001" & X"011", -- 0x053: ADD R01, 0x01
- "000010" & X"012", -- 0x054: MOV R02, R01
- "001111" & X"122", -- 0x055: CMP R02, 0x12
- "111010" & X"3FF", -- 0x056: JNE 0x3FF
- "010001" & X"012", -- 0x057: ADD R02, 0x01
- "000010" & X"023", -- 0x058: MOV R03, R02
- "001111" & X"133", -- 0x059: CMP R03, 0x13
- "111010" & X"3FF", -- 0x05A: JNE 0x3FF
- "010001" & X"013", -- 0x05B: ADD R03, 0x01
- "000010" & X"034", -- 0x05C: MOV R04, R03
- "001111" & X"144", -- 0x05D: CMP R04, 0x14
- "111010" & X"3FF", -- 0x05E: JNE 0x3FF
- "010001" & X"014", -- 0x05F: ADD R04, 0x01
- "000010" & X"045", -- 0x060: MOV R05, R04
- "001111" & X"155", -- 0x061: CMP R05, 0x15
- "111010" & X"3FF", -- 0x062: JNE 0x3FF
- "010001" & X"015", -- 0x063: ADD R05, 0x01
- "000010" & X"056", -- 0x064: MOV R06, R05
- "001111" & X"166", -- 0x065: CMP R06, 0x16
- "111010" & X"3FF", -- 0x066: JNE 0x3FF
- "010001" & X"016", -- 0x067: ADD R06, 0x01
- "000010" & X"067", -- 0x068: MOV R07, R06
- "001111" & X"177", -- 0x069: CMP R07, 0x17
- "111010" & X"3FF", -- 0x06A: JNE 0x3FF
- "010001" & X"017", -- 0x06B: ADD R07, 0x01
- "000010" & X"078", -- 0x06C: MOV R08, R07
- "001111" & X"188", -- 0x06D: CMP R08, 0x18
- "111010" & X"3FF", -- 0x06E: JNE 0x3FF
- "010001" & X"018", -- 0x06F: ADD R08, 0x01
- "000010" & X"089", -- 0x070: MOV R09, R08
- "001111" & X"199", -- 0x071: CMP R09, 0x19
- "111010" & X"3FF", -- 0x072: JNE 0x3FF
- "010001" & X"019", -- 0x073: ADD R09, 0x01
- "000010" & X"09A", -- 0x074: MOV R10, R09
- "001111" & X"1AA", -- 0x075: CMP R10, 0x1A
- "111010" & X"3FF", -- 0x076: JNE 0x3FF
- "010001" & X"01A", -- 0x077: ADD R10, 0x01
- "000010" & X"0AB", -- 0x078: MOV R11, R10
- "001111" & X"1BB", -- 0x079: CMP R11, 0x1B
- "111010" & X"3FF", -- 0x07A: JNE 0x3FF
- "010001" & X"01B", -- 0x07B: ADD R11, 0x01
- "000010" & X"0BC", -- 0x07C: MOV R12, R11
- "001111" & X"1CC", -- 0x07D: CMP R12, 0x1C
- "111010" & X"3FF", -- 0x07E: JNE 0x3FF
- "010001" & X"01C", -- 0x07F: ADD R12, 0x01
- "000010" & X"0CD", -- 0x080: MOV R13, R12
- "001111" & X"1DD", -- 0x081: CMP R13, 0x1D
- "111010" & X"3FF", -- 0x082: JNE 0x3FF
- "010001" & X"01D", -- 0x083: ADD R13, 0x01
- "000010" & X"0DE", -- 0x084: MOV R14, R13
- "001111" & X"1EE", -- 0x085: CMP R14, 0x1E
- "111010" & X"3FF", -- 0x086: JNE 0x3FF
- "010001" & X"01E", -- 0x087: ADD R14, 0x01
- "000010" & X"0EF", -- 0x088: MOV R15, R14
- "001111" & X"1FF", -- 0x089: CMP R15, 0x1F
- "111010" & X"3FF", -- 0x08A: JNE 0x3FF
- "010001" & X"01F", -- 0x08B: ADD R15, 0x01
- "111110" & X"000", -- 0x08C: RET
- "000011" & X"000", -- 0x08D: MOV R00, 0x00
- "001111" & X"000", -- 0x08E: TST R00
- "110010" & X"3FF", -- 0x08F: JNZ 0x3FF
- "110011" & X"3FF", -- 0x090: JC 0x3FF
- "001111" & X"000", -- 0x091: CMP R00, 0x00
- "111010" & X"3FF", -- 0x092: JNE 0x3FF
- "110101" & X"3FF", -- 0x093: JLT 0x3FF
- "110110" & X"3FF", -- 0x094: JGT 0x3FF
- "110111" & X"097", -- 0x095: JLE 0x097
- "110000" & X"3FF", -- 0x096: JMP 0x3FF
- "111001" & X"099", -- 0x097: JEQ 0x099
- "110000" & X"3FF", -- 0x098: JMP 0x3FF
- "111000" & X"09B", -- 0x099: JGE 0x09B
- "110000" & X"3FF", -- 0x09A: JMP 0x3FF
- "001111" & X"550", -- 0x09B: CMP R00, 0x55
- "111001" & X"3FF", -- 0x09C: JEQ 0x3FF
- "110101" & X"09F", -- 0x09D: JLT 0x09F
- "110000" & X"3FF", -- 0x09E: JMP 0x3FF
- "110111" & X"0A1", -- 0x09F: JLE 0x0A1
- "110000" & X"3FF", -- 0x0A0: JMP 0x3FF
- "111000" & X"3FF", -- 0x0A1: JGE 0x3FF
- "110110" & X"3FF", -- 0x0A2: JGT 0x3FF
- "000011" & X"550", -- 0x0A3: MOV R00, 0x55
- "001111" & X"000", -- 0x0A4: TST R00
- "110001" & X"3FF", -- 0x0A5: JZ 0x3FF
- "110011" & X"3FF", -- 0x0A6: JC 0x3FF
- "001111" & X"AA0", -- 0x0A7: CMP R00, 0xAA
- "111001" & X"3FF", -- 0x0A8: JEQ 0x3FF
- "111010" & X"0AB", -- 0x0A9: JNE 0x0AB
- "110000" & X"3FF", -- 0x0AA: JMP 0x3FF
- "110101" & X"0AD", -- 0x0AB: JLT 0x0AD
- "110000" & X"3FF", -- 0x0AC: JMP 0x3FF
- "110111" & X"0AF", -- 0x0AD: JLE 0x0AF
- "110000" & X"3FF", -- 0x0AE: JMP 0x3FF
- "110110" & X"3FF", -- 0x0AF: JGT 0x3FF
- "001111" & X"550", -- 0x0B0: CMP R00, 0x55
- "111001" & X"0B3", -- 0x0B1: JEQ 0x0B3
- "110000" & X"3FF", -- 0x0B2: JMP 0x3FF
- "111010" & X"3FF", -- 0x0B3: JNE 0x3FF
- "110101" & X"3FF", -- 0x0B4: JLT 0x3FF
- "110111" & X"0B7", -- 0x0B5: JLE 0x0B7
- "110000" & X"3FF", -- 0x0B6: JMP 0x3FF
- "110110" & X"3FF", -- 0x0B7: JGT 0x3FF
- "111000" & X"0BA", -- 0x0B8: JGE 0x0BA
- "110000" & X"3FF", -- 0x0B9: JMP 0x3FF
- "000011" & X"AA0", -- 0x0BA: MOV R00, 0xAA
- "001111" & X"000", -- 0x0BB: TST R00
- "110001" & X"3FF", -- 0x0BC: JZ 0x3FF
- "110011" & X"3FF", -- 0x0BD: JC 0x3FF
- "001111" & X"550", -- 0x0BE: CMP R00, 0x55
- "111001" & X"3FF", -- 0x0BF: JEQ 0x3FF
- "111010" & X"0C2", -- 0x0C0: JNE 0x0C2
- "110000" & X"3FF", -- 0x0C1: JMP 0x3FF
- "110110" & X"0C4", -- 0x0C2: JGT 0x0C4
- "110000" & X"3FF", -- 0x0C3: JMP 0x3FF
- "111000" & X"0C6", -- 0x0C4: JGE 0x0C6
- "110000" & X"3FF", -- 0x0C5: JMP 0x3FF
- "110101" & X"3FF", -- 0x0C6: JLT 0x3FF
- "110111" & X"3FF", -- 0x0C7: JLE 0x3FF
- "111110" & X"000", -- 0x0C8: RET
- "000011" & X"000", -- 0x0C9: MOV R00, 0x00
- "000011" & X"001", -- 0x0CA: MOV R01, 0x00
- "000010" & X"002", -- 0x0CB: MOV R02, R00
- "000010" & X"013", -- 0x0CC: MOV R03, R01
- "010001" & X"010", -- 0x0CD: ADD R00, 0x01
- "010011" & X"001", -- 0x0CE: ADDC R01, 0x00
- "010001" & X"012", -- 0x0CF: ADD R02, 0x01
- "001111" & X"002", -- 0x0D0: CMP R02, 0x00
- "111010" & X"0D4", -- 0x0D1: JNE 0x0D4
- "010001" & X"013", -- 0x0D2: ADD R03, 0x01
- "001111" & X"023", -- 0x0D3: CMP R03, 0x02
- "111010" & X"0CD", -- 0x0D4: JNE 0x0CD
- "001110" & X"020", -- 0x0D5: CMP R00, R02
- "111010" & X"3FF", -- 0x0D6: JNE 0x3FF
- "001110" & X"031", -- 0x0D7: CMP R01, R03
- "111010" & X"3FF", -- 0x0D8: JNE 0x3FF
- "000011" & X"000", -- 0x0D9: MOV R00, 0x00
- "111110" & X"000", -- 0x0DA: RET
- "000011" & X"000", -- 0x0DB: MOV R00, 0x00
- "000011" & X"031", -- 0x0DC: MOV R01, 0x03
- "000010" & X"002", -- 0x0DD: MOV R02, R00
- "000010" & X"013", -- 0x0DE: MOV R03, R01
- "010101" & X"010", -- 0x0DF: SUB R00, 0x01
- "010111" & X"001", -- 0x0E0: SUBC R01, 0x00
- "010101" & X"012", -- 0x0E1: SUB R02, 0x01
- "001111" & X"FF2", -- 0x0E2: CMP R02, 0xFF
- "111010" & X"0E6", -- 0x0E3: JNE 0x0E6
- "010101" & X"013", -- 0x0E4: SUB R03, 0x01
- "001111" & X"003", -- 0x0E5: CMP R03, 0x00
- "111010" & X"0DF", -- 0x0E6: JNE 0x0DF
- "001110" & X"020", -- 0x0E7: CMP R00, R02
- "111010" & X"3FF", -- 0x0E8: JNE 0x3FF
- "001110" & X"031", -- 0x0E9: CMP R01, R03
- "111010" & X"3FF", -- 0x0EA: JNE 0x3FF
- "000011" & X"000", -- 0x0EB: MOV R00, 0x00
- "111110" & X"000", -- 0x0EC: RET
- "000011" & X"030", -- 0x0ED: MOV R00, 0x03
- "000011" & X"051", -- 0x0EE: MOV R01, 0x05
- "101110" & X"050", -- 0x0EF: SUB 0x05, R00
- "010101" & X"031", -- 0x0F0: SUB R01, 0x03
- "001110" & X"010", -- 0x0F1: CMP R00, R01
- "111010" & X"3FF", -- 0x0F2: JNE 0x3FF
- "000011" & X"030", -- 0x0F3: MOV R00, 0x03
- "000011" & X"051", -- 0x0F4: MOV R01, 0x05
- "010100" & X"010", -- 0x0F5: SUB R00, R01
- "101111" & X"000", -- 0x0F6: SUBC 0x00, R00
- "001111" & X"010", -- 0x0F7: CMP R00, 0x01
- "111010" & X"3FF", -- 0x0F8: JNE 0x3FF
- "010001" & X"000", -- 0x0F9: ADD R00, 0x00
- "010110" & X"001", -- 0x0FA: SUBC R01, R00
- "001111" & X"041", -- 0x0FB: CMP R01, 0x04
- "111010" & X"3FF", -- 0x0FC: JNE 0x3FF
- "000011" & X"000", -- 0x0FD: MOV R00, 0x00
- "111110" & X"000", -- 0x0FE: RET
- "000011" & X"010", -- 0x0FF: MOV R00, 0x01
- "001101" & X"5A0", -- 0x100: MOVC (0x5A), R00
- "010101" & X"010", -- 0x101: DEC R00
- "001101" & X"000", -- 0x102: MOVC (0x00), R00
- "001010" & X"5A1", -- 0x103: MOVC R01, (0x5A)
- "001100" & X"A51", -- 0x104: MOVC (R01), 0xA5
- "001001" & X"010", -- 0x105: MOVC R00, (R01)
- "001001" & X"011", -- 0x106: MOVC R01, (R01)
- "010001" & X"5A1", -- 0x107: ADD R01, 0x5A
- "001001" & X"010", -- 0x108: MOVC R00, (R01)
- "001011" & X"000", -- 0x109: MOVC (R00), R00
- "001001" & X"002", -- 0x10A: MOVC R02, (R00)
- "001110" & X"002", -- 0x10B: CMP R02, R00
- "111010" & X"3FF", -- 0x10C: JNE 0x3FF
- "001011" & X"021", -- 0x10D: MOVC (R01), R02
- "001001" & X"022", -- 0x10E: MOVC R02, (R02)
- "001110" & X"012", -- 0x10F: CMP R02, R01
- "111010" & X"3FF", -- 0x110: JNE 0x3FF
- "010101" & X"011", -- 0x111: DEC R01
- "010001" & X"010", -- 0x112: INC R00
- "110010" & X"109", -- 0x113: JNZ 0x109
- "111110" & X"000", -- 0x114: RET
- "000011" & X"010", -- 0x115: MOV R00, 0x01
- "001000" & X"600", -- 0x116: MOVX (0x60), R00
- "010101" & X"010", -- 0x117: DEC R00
- "001000" & X"060", -- 0x118: MOVX (0x06), R00
- "000101" & X"601", -- 0x119: MOVX R01, (0x60)
- "000111" & X"A51", -- 0x11A: MOVX (R01), 0xA5
- "000100" & X"010", -- 0x11B: MOVX R00, (R01)
- "000100" & X"011", -- 0x11C: MOVX R01, (R01)
- "010001" & X"5A1", -- 0x11D: ADD R01, 0x5A
- "000100" & X"010", -- 0x11E: MOVX R00, (R01)
- "000110" & X"000", -- 0x11F: MOVX (R00), R00
- "000100" & X"002", -- 0x120: MOVX R02, (R00)
- "001110" & X"002", -- 0x121: CMP R02, R00
- "111010" & X"3FF", -- 0x122: JNE 0x3FF
- "000110" & X"021", -- 0x123: MOVX (R01), R02
- "000100" & X"022", -- 0x124: MOVX R02, (R02)
- "001110" & X"012", -- 0x125: CMP R02, R01
- "111010" & X"3FF", -- 0x126: JNE 0x3FF
- "010101" & X"011", -- 0x127: DEC R01
- "010001" & X"010", -- 0x128: INC R00
- "110010" & X"11F", -- 0x129: JNZ 0x11F
- "111110" & X"000", -- 0x12A: RET
- "000011" & X"AA0", -- 0x12B: MOV R00, 0xAA
- "000011" & X"001", -- 0x12C: MOV R01, 0x00
- "111100" & X"000", -- 0x12D: PUSH R00
- "010001" & X"010", -- 0x12E: INC R00
- "010101" & X"011", -- 0x12F: DEC R01
- "110010" & X"12D", -- 0x130: JNZ 0x12D
- "111101" & X"000", -- 0x131: POP R00
- "010101" & X"011", -- 0x132: DEC R01
- "110010" & X"131", -- 0x133: JNZ 0x131
- "001111" & X"AA0", -- 0x134: CMP R00, 0xAA
- "111010" & X"3FF", -- 0x135: JNE 0x3FF
- "111110" & X"000", -- 0x136: RET
- "000011" & X"550", -- 0x137: MOV R00, 0x55
- "111100" & X"000", -- 0x138: PUSH R00
- "000011" & X"000", -- 0x139: MOV R00, 0x00
- "000011" & X"FF1", -- 0x13A: MOV R01, 0xFF
- "111011" & X"151", -- 0x13B: CALL 0x151
- "111101" & X"000", -- 0x13C: POP R00
- "001111" & X"550", -- 0x13D: CMP R00, 0x55
- "111010" & X"3FF", -- 0x13E: JNE 0x3FF
- "000011" & X"010", -- 0x13F: MOV R00, 0x01
- "000011" & X"481", -- 0x140: MOV R01, 0x48
- "100110" & X"050", -- 0x141: COUT (0x05), R00
- "111100" & X"001", -- 0x142: PUSH R01
- "000011" & X"000", -- 0x143: MOV R00, 0x00
- "000011" & X"3B1", -- 0x144: MOV R01, 0x3B
- "100110" & X"050", -- 0x145: COUT (0x05), R00
- "111100" & X"001", -- 0x146: PUSH R01
- "111110" & X"000", -- 0x147: RET
- "000011" & X"010", -- 0x148: MOV R00, 0x01
- "000011" & X"501", -- 0x149: MOV R01, 0x50
- "100110" & X"050", -- 0x14A: COUT (0x05), R00
- "111100" & X"001", -- 0x14B: PUSH R01
- "000011" & X"000", -- 0x14C: MOV R00, 0x00
- "000011" & X"3B1", -- 0x14D: MOV R01, 0x3B
- "100110" & X"050", -- 0x14E: COUT (0x05), R00
- "111100" & X"001", -- 0x14F: PUSH R01
- "111110" & X"000", -- 0x150: RET
- "001110" & X"010", -- 0x151: CMP R00, R01
- "111001" & X"155", -- 0x152: JEQ 0x155
- "010001" & X"010", -- 0x153: INC R00
- "110000" & X"158", -- 0x154: JMP 0x158
- "010101" & X"010", -- 0x155: DEC R00
- "010101" & X"011", -- 0x156: DEC R01
- "111110" & X"000", -- 0x157: RET
- "111011" & X"151", -- 0x158: CALL 0x151
- "110000" & X"155", -- 0x159: JMP 0x155
- "000011" & X"A50", -- 0x15A: MOV R00, 0xA5
- "000011" & X"5A1", -- 0x15B: MOV R01, 0x5A
- "101010" & X"000", -- 0x15C: SWAP R00
- "001111" & X"5A0", -- 0x15D: CMP R00, 0x5A
- "111010" & X"3FF", -- 0x15E: JNE 0x3FF
- "101010" & X"000", -- 0x15F: SWAP R00
- "001111" & X"A50", -- 0x160: CMP R00, 0xA5
- "111010" & X"3FF", -- 0x161: JNE 0x3FF
- "000011" & X"D20", -- 0x162: MOV R00, 0xD2
- "101010" & X"000", -- 0x163: SWAP R00
- "001111" & X"2D0", -- 0x164: CMP R00, 0x2D
- "111010" & X"3FF", -- 0x165: JNE 0x3FF
- "101010" & X"001", -- 0x166: SWAP R01
- "001111" & X"2D0", -- 0x167: CMP R00, 0x2D
- "111010" & X"3FF", -- 0x168: JNE 0x3FF
- "001111" & X"A51", -- 0x169: CMP R01, 0xA5
- "111010" & X"3FF", -- 0x16A: JNE 0x3FF
- "000011" & X"2D0", -- 0x16B: MOV R00, 0x2D
- "011110" & X"000", -- 0x16C: SHL R00
- "001111" & X"5A0", -- 0x16D: CMP R00, 0x5A
- "111010" & X"3FF", -- 0x16E: JNE 0x3FF
- "011110" & X"000", -- 0x16F: SHL R00
- "001111" & X"B40", -- 0x170: CMP R00, 0xB4
- "111010" & X"3FF", -- 0x171: JNE 0x3FF
- "011110" & X"000", -- 0x172: SHL R00
- "001111" & X"680", -- 0x173: CMP R00, 0x68
- "111010" & X"3FF", -- 0x174: JNE 0x3FF
- "011110" & X"000", -- 0x175: SHL R00
- "001111" & X"D00", -- 0x176: CMP R00, 0xD0
- "111010" & X"3FF", -- 0x177: JNE 0x3FF
- "011110" & X"000", -- 0x178: SHL R00
- "001111" & X"A00", -- 0x179: CMP R00, 0xA0
- "111010" & X"3FF", -- 0x17A: JNE 0x3FF
- "011110" & X"000", -- 0x17B: SHL R00
- "001111" & X"400", -- 0x17C: CMP R00, 0x40
- "111010" & X"3FF", -- 0x17D: JNE 0x3FF
- "011110" & X"000", -- 0x17E: SHL R00
- "001111" & X"800", -- 0x17F: CMP R00, 0x80
- "111010" & X"3FF", -- 0x180: JNE 0x3FF
- "011110" & X"000", -- 0x181: SHL R00
- "001111" & X"000", -- 0x182: CMP R00, 0x00
- "111010" & X"3FF", -- 0x183: JNE 0x3FF
- "000011" & X"841", -- 0x184: MOV R01, 0x84
- "011111" & X"001", -- 0x185: SHR R01
- "001111" & X"421", -- 0x186: CMP R01, 0x42
- "111010" & X"3FF", -- 0x187: JNE 0x3FF
- "011111" & X"001", -- 0x188: SHR R01
- "001111" & X"211", -- 0x189: CMP R01, 0x21
- "111010" & X"3FF", -- 0x18A: JNE 0x3FF
- "011111" & X"001", -- 0x18B: SHR R01
- "001111" & X"101", -- 0x18C: CMP R01, 0x10
- "111010" & X"3FF", -- 0x18D: JNE 0x3FF
- "011111" & X"001", -- 0x18E: SHR R01
- "001111" & X"081", -- 0x18F: CMP R01, 0x08
- "111010" & X"3FF", -- 0x190: JNE 0x3FF
- "011111" & X"001", -- 0x191: SHR R01
- "001111" & X"041", -- 0x192: CMP R01, 0x04
- "111010" & X"3FF", -- 0x193: JNE 0x3FF
- "011111" & X"001", -- 0x194: SHR R01
- "001111" & X"021", -- 0x195: CMP R01, 0x02
- "111010" & X"3FF", -- 0x196: JNE 0x3FF
- "011111" & X"001", -- 0x197: SHR R01
- "001111" & X"011", -- 0x198: CMP R01, 0x01
- "111010" & X"3FF", -- 0x199: JNE 0x3FF
- "011111" & X"001", -- 0x19A: SHR R01
- "001111" & X"001", -- 0x19B: CMP R01, 0x00
- "111010" & X"3FF", -- 0x19C: JNE 0x3FF
- "000011" & X"C50", -- 0x19D: MOV R00, 0xC5
- "100000" & X"000", -- 0x19E: ROL R00
- "001111" & X"8B0", -- 0x19F: CMP R00, 0x8B
- "111010" & X"3FF", -- 0x1A0: JNE 0x3FF
- "100000" & X"000", -- 0x1A1: ROL R00
- "001111" & X"170", -- 0x1A2: CMP R00, 0x17
- "111010" & X"3FF", -- 0x1A3: JNE 0x3FF
- "100000" & X"000", -- 0x1A4: ROL R00
- "001111" & X"2E0", -- 0x1A5: CMP R00, 0x2E
- "111010" & X"3FF", -- 0x1A6: JNE 0x3FF
- "100000" & X"000", -- 0x1A7: ROL R00
- "001111" & X"5C0", -- 0x1A8: CMP R00, 0x5C
- "111010" & X"3FF", -- 0x1A9: JNE 0x3FF
- "100000" & X"000", -- 0x1AA: ROL R00
- "001111" & X"B80", -- 0x1AB: CMP R00, 0xB8
- "111010" & X"3FF", -- 0x1AC: JNE 0x3FF
- "100000" & X"000", -- 0x1AD: ROL R00
- "001111" & X"710", -- 0x1AE: CMP R00, 0x71
- "111010" & X"3FF", -- 0x1AF: JNE 0x3FF
- "100000" & X"000", -- 0x1B0: ROL R00
- "001111" & X"E20", -- 0x1B1: CMP R00, 0xE2
- "111010" & X"3FF", -- 0x1B2: JNE 0x3FF
- "100000" & X"000", -- 0x1B3: ROL R00
- "001111" & X"C50", -- 0x1B4: CMP R00, 0xC5
- "111010" & X"3FF", -- 0x1B5: JNE 0x3FF
- "000011" & X"631", -- 0x1B6: MOV R01, 0x63
- "100001" & X"001", -- 0x1B7: ROR R01
- "001111" & X"B11", -- 0x1B8: CMP R01, 0xB1
- "111010" & X"3FF", -- 0x1B9: JNE 0x3FF
- "100001" & X"001", -- 0x1BA: ROR R01
- "001111" & X"D81", -- 0x1BB: CMP R01, 0xD8
- "111010" & X"3FF", -- 0x1BC: JNE 0x3FF
- "100001" & X"001", -- 0x1BD: ROR R01
- "001111" & X"6C1", -- 0x1BE: CMP R01, 0x6C
- "111010" & X"3FF", -- 0x1BF: JNE 0x3FF
- "100001" & X"001", -- 0x1C0: ROR R01
- "001111" & X"361", -- 0x1C1: CMP R01, 0x36
- "111010" & X"3FF", -- 0x1C2: JNE 0x3FF
- "100001" & X"001", -- 0x1C3: ROR R01
- "001111" & X"1B1", -- 0x1C4: CMP R01, 0x1B
- "111010" & X"3FF", -- 0x1C5: JNE 0x3FF
- "100001" & X"001", -- 0x1C6: ROR R01
- "001111" & X"8D1", -- 0x1C7: CMP R01, 0x8D
- "111010" & X"3FF", -- 0x1C8: JNE 0x3FF
- "100001" & X"001", -- 0x1C9: ROR R01
- "001111" & X"C61", -- 0x1CA: CMP R01, 0xC6
- "111010" & X"3FF", -- 0x1CB: JNE 0x3FF
- "100001" & X"001", -- 0x1CC: ROR R01
- "001111" & X"631", -- 0x1CD: CMP R01, 0x63
- "111010" & X"3FF", -- 0x1CE: JNE 0x3FF
- "011100" & X"000", -- 0x1CF: XOR R00, R00
- "000011" & X"C50", -- 0x1D0: MOV R00, 0xC5
- "100010" & X"000", -- 0x1D1: ROLC R00
- "111100" & X"000", -- 0x1D2: PUSH R00
- "100010" & X"000", -- 0x1D3: ROLC R00
- "111100" & X"000", -- 0x1D4: PUSH R00
- "100010" & X"000", -- 0x1D5: ROLC R00
- "111100" & X"000", -- 0x1D6: PUSH R00
- "100010" & X"000", -- 0x1D7: ROLC R00
- "111100" & X"000", -- 0x1D8: PUSH R00
- "100010" & X"000", -- 0x1D9: ROLC R00
- "111100" & X"000", -- 0x1DA: PUSH R00
- "100010" & X"000", -- 0x1DB: ROLC R00
- "111100" & X"000", -- 0x1DC: PUSH R00
- "100010" & X"000", -- 0x1DD: ROLC R00
- "111100" & X"000", -- 0x1DE: PUSH R00
- "100010" & X"000", -- 0x1DF: ROLC R00
- "111100" & X"000", -- 0x1E0: PUSH R00
- "100010" & X"000", -- 0x1E1: ROLC R00
- "001111" & X"C50", -- 0x1E2: CMP R00, 0xC5
- "111010" & X"3FF", -- 0x1E3: JNE 0x3FF
- "111101" & X"000", -- 0x1E4: POP R00
- "001111" & X"620", -- 0x1E5: CMP R00, 0x62
- "111010" & X"3FF", -- 0x1E6: JNE 0x3FF
- "111101" & X"000", -- 0x1E7: POP R00
- "001111" & X"B10", -- 0x1E8: CMP R00, 0xB1
- "111010" & X"3FF", -- 0x1E9: JNE 0x3FF
- "111101" & X"000", -- 0x1EA: POP R00
- "001111" & X"580", -- 0x1EB: CMP R00, 0x58
- "111010" & X"3FF", -- 0x1EC: JNE 0x3FF
- "111101" & X"000", -- 0x1ED: POP R00
- "001111" & X"AC0", -- 0x1EE: CMP R00, 0xAC
- "111010" & X"3FF", -- 0x1EF: JNE 0x3FF
- "111101" & X"000", -- 0x1F0: POP R00
- "001111" & X"560", -- 0x1F1: CMP R00, 0x56
- "111010" & X"3FF", -- 0x1F2: JNE 0x3FF
- "111101" & X"000", -- 0x1F3: POP R00
- "001111" & X"2B0", -- 0x1F4: CMP R00, 0x2B
- "111010" & X"3FF", -- 0x1F5: JNE 0x3FF
- "111101" & X"000", -- 0x1F6: POP R00
- "001111" & X"150", -- 0x1F7: CMP R00, 0x15
- "111010" & X"3FF", -- 0x1F8: JNE 0x3FF
- "111101" & X"000", -- 0x1F9: POP R00
- "001111" & X"8A0", -- 0x1FA: CMP R00, 0x8A
- "111010" & X"3FF", -- 0x1FB: JNE 0x3FF
- "011100" & X"011", -- 0x1FC: XOR R01, R01
- "000011" & X"631", -- 0x1FD: MOV R01, 0x63
- "100011" & X"001", -- 0x1FE: RORC R01
- "111100" & X"001", -- 0x1FF: PUSH R01
- "100011" & X"001", -- 0x200: RORC R01
- "111100" & X"001", -- 0x201: PUSH R01
- "100011" & X"001", -- 0x202: RORC R01
- "111100" & X"001", -- 0x203: PUSH R01
- "100011" & X"001", -- 0x204: RORC R01
- "111100" & X"001", -- 0x205: PUSH R01
- "100011" & X"001", -- 0x206: RORC R01
- "111100" & X"001", -- 0x207: PUSH R01
- "100011" & X"001", -- 0x208: RORC R01
- "111100" & X"001", -- 0x209: PUSH R01
- "100011" & X"001", -- 0x20A: RORC R01
- "111100" & X"001", -- 0x20B: PUSH R01
- "100011" & X"001", -- 0x20C: RORC R01
- "111100" & X"001", -- 0x20D: PUSH R01
- "100011" & X"001", -- 0x20E: RORC R01
- "001111" & X"631", -- 0x20F: CMP R01, 0x63
- "111010" & X"3FF", -- 0x210: JNE 0x3FF
- "111101" & X"001", -- 0x211: POP R01
- "001111" & X"C61", -- 0x212: CMP R01, 0xC6
- "111010" & X"3FF", -- 0x213: JNE 0x3FF
- "111101" & X"001", -- 0x214: POP R01
- "001111" & X"8C1", -- 0x215: CMP R01, 0x8C
- "111010" & X"3FF", -- 0x216: JNE 0x3FF
- "111101" & X"001", -- 0x217: POP R01
- "001111" & X"191", -- 0x218: CMP R01, 0x19
- "111010" & X"3FF", -- 0x219: JNE 0x3FF
- "111101" & X"001", -- 0x21A: POP R01
- "001111" & X"331", -- 0x21B: CMP R01, 0x33
- "111010" & X"3FF", -- 0x21C: JNE 0x3FF
- "111101" & X"001", -- 0x21D: POP R01
- "001111" & X"661", -- 0x21E: CMP R01, 0x66
- "111010" & X"3FF", -- 0x21F: JNE 0x3FF
- "111101" & X"001", -- 0x220: POP R01
- "001111" & X"CC1", -- 0x221: CMP R01, 0xCC
- "111010" & X"3FF", -- 0x222: JNE 0x3FF
- "111101" & X"001", -- 0x223: POP R01
- "001111" & X"981", -- 0x224: CMP R01, 0x98
- "111010" & X"3FF", -- 0x225: JNE 0x3FF
- "111101" & X"001", -- 0x226: POP R01
- "001111" & X"311", -- 0x227: CMP R01, 0x31
- "111010" & X"3FF", -- 0x228: JNE 0x3FF
- "111110" & X"000", -- 0x229: RET
- "000011" & X"A50", -- 0x22A: MOV R00, 0xA5
- "101010" & X"000", -- 0x22B: SWAP R00
- "111100" & X"000", -- 0x22C: PUSH R00
- "011001" & X"0F0", -- 0x22D: AND R00, 0x0F
- "001111" & X"0A0", -- 0x22E: CMP R00, 0x0A
- "111010" & X"3FF", -- 0x22F: JNE 0x3FF
- "111101" & X"000", -- 0x230: POP R00
- "111100" & X"000", -- 0x231: PUSH R00
- "011001" & X"0F0", -- 0x232: AND R00, 0x0F
- "001111" & X"0A0", -- 0x233: CMP R00, 0x0A
- "111101" & X"001", -- 0x234: POP R01
- "111010" & X"3FF", -- 0x235: JNE 0x3FF
- "101010" & X"001", -- 0x236: SWAP R01
- "000011" & X"0F2", -- 0x237: MOV R02, 0x0F
- "011000" & X"021", -- 0x238: AND R01, R02
- "001111" & X"051", -- 0x239: CMP R01, 0x05
- "111010" & X"3FF", -- 0x23A: JNE 0x3FF
- "000011" & X"050", -- 0x23B: MOV R00, 0x05
- "000011" & X"A02", -- 0x23C: MOV R02, 0xA0
- "101010" & X"000", -- 0x23D: SWAP R00
- "011010" & X"002", -- 0x23E: OR R02, R00
- "001111" & X"F02", -- 0x23F: CMP R02, 0xF0
- "111010" & X"3FF", -- 0x240: JNE 0x3FF
- "101010" & X"000", -- 0x241: SWAP R00
- "011011" & X"500", -- 0x242: OR R00, 0x50
- "001111" & X"550", -- 0x243: CMP R00, 0x55
- "111010" & X"3FF", -- 0x244: JNE 0x3FF
- "000011" & X"011", -- 0x245: MOV R01, 0x01
- "000011" & X"010", -- 0x246: MOV R00, 0x01
- "011101" & X"010", -- 0x247: XOR R00, 0x01
- "110010" & X"3FF", -- 0x248: JNZ 0x3FF
- "011100" & X"010", -- 0x249: XOR R00, R01
- "001111" & X"010", -- 0x24A: CMP R00, 0x01
- "111010" & X"3FF", -- 0x24B: JNE 0x3FF
- "111110" & X"000", -- 0x24C: RET
- "000011" & X"030", -- 0x24D: MOV R00, 0x03
- "100110" & X"030", -- 0x24E: COUT (0x03), R00
- "101000" & X"020", -- 0x24F: XIN R00, (0x02)
- "011011" & X"010", -- 0x250: OR R00, 0x01
- "100100" & X"020", -- 0x251: XOUT (0x02), R00
- "000000" & X"000", -- 0x252: NOP
- "000000" & X"000", -- 0x253: NOP
- "000000" & X"000", -- 0x254: NOP
- "000000" & X"000", -- 0x255: NOP
- "000000" & X"000", -- 0x256: NOP
- "000000" & X"000", -- 0x257: NOP
- "101000" & X"020", -- 0x258: XIN R00, (0x02)
- "011001" & X"FE0", -- 0x259: AND R00, 0xFE
- "100100" & X"020", -- 0x25A: XOUT (0x02), R00
- "000000" & X"000", -- 0x25B: NOP
- "000000" & X"000", -- 0x25C: NOP
- "000000" & X"000", -- 0x25D: NOP
- "000000" & X"000", -- 0x25E: NOP
- "101001" & X"030", -- 0x25F: CIN R00, (0x03)
- "011011" & X"800", -- 0x260: OR R00, 0x80
- "100110" & X"030", -- 0x261: COUT (0x03), R00
- "000000" & X"000", -- 0x262: NOP
- "101001" & X"030", -- 0x263: CIN R00, (0x03)
- "011011" & X"800", -- 0x264: OR R00, 0x80
- "100110" & X"030", -- 0x265: COUT (0x03), R00
- "000000" & X"000", -- 0x266: NOP
- "101001" & X"030", -- 0x267: CIN R00, (0x03)
- "011011" & X"800", -- 0x268: OR R00, 0x80
- "100110" & X"030", -- 0x269: COUT (0x03), R00
- "000000" & X"000", -- 0x26A: NOP
- "101001" & X"030", -- 0x26B: CIN R00, (0x03)
- "011011" & X"800", -- 0x26C: OR R00, 0x80
- "100110" & X"030", -- 0x26D: COUT (0x03), R00
- "000000" & X"000", -- 0x26E: NOP
- "000000" & X"000", -- 0x26F: NOP
- "000000" & X"000", -- 0x270: NOP
- "000000" & X"000", -- 0x271: NOP
- "000000" & X"000", -- 0x272: NOP
- "000000" & X"000", -- 0x273: NOP
- "000000" & X"000", -- 0x274: NOP
- "000000" & X"000", -- 0x275: NOP
- "000000" & X"000", -- 0x276: NOP
- "111110" & X"000", -- 0x277: RET
- "010101" & X"000", -- 0x278: SUB R00, 0x00
- "110011" & X"3FF", -- 0x279: JC 0x3FF
- "101011" & X"000", -- 0x27A: SETC
- "110100" & X"3FF", -- 0x27B: JNC 0x3FF
- "000000" & X"000", -- 0x27C: NOP
- "010101" & X"000", -- 0x27D: SUB R00, 0x00
- "110011" & X"3FF", -- 0x27E: JC 0x3FF
- "000011" & X"000", -- 0x27F: MOV R00, 0x00
- "010101" & X"000", -- 0x280: CLRC
- "110011" & X"3FF", -- 0x281: JC 0x3FF
- "101011" & X"000", -- 0x282: SETC
- "110100" & X"3FF", -- 0x283: JNC 0x3FF
- "000000" & X"000", -- 0x284: NOP
- "010101" & X"000", -- 0x285: CLRC
- "110011" & X"3FF", -- 0x286: JC 0x3FF
- "111110" & X"000", -- 0x287: RET
- "010001" & X"01E", -- 0x288: INC R14
- "111111" & X"000", -- 0x289: RETI
- "000000" & X"000", -- 0x28A:
- "000000" & X"000", -- 0x28B:
- "000000" & X"000", -- 0x28C:
- "000000" & X"000", -- 0x28D:
- "000000" & X"000", -- 0x28E:
- "000000" & X"000", -- 0x28F:
- "000000" & X"000", -- 0x290:
- "000000" & X"000", -- 0x291:
- "000000" & X"000", -- 0x292:
- "000000" & X"000", -- 0x293:
- "000000" & X"000", -- 0x294:
- "000000" & X"000", -- 0x295:
- "000000" & X"000", -- 0x296:
- "000000" & X"000", -- 0x297:
- "000000" & X"000", -- 0x298:
- "000000" & X"000", -- 0x299:
- "000000" & X"000", -- 0x29A:
- "000000" & X"000", -- 0x29B:
- "000000" & X"000", -- 0x29C:
- "000000" & X"000", -- 0x29D:
- "000000" & X"000", -- 0x29E:
- "000000" & X"000", -- 0x29F:
- "000000" & X"000", -- 0x2A0:
- "000000" & X"000", -- 0x2A1:
- "000000" & X"000", -- 0x2A2:
- "000000" & X"000", -- 0x2A3:
- "000000" & X"000", -- 0x2A4:
- "000000" & X"000", -- 0x2A5:
- "000000" & X"000", -- 0x2A6:
- "000000" & X"000", -- 0x2A7:
- "000000" & X"000", -- 0x2A8:
- "000000" & X"000", -- 0x2A9:
- "000000" & X"000", -- 0x2AA:
- "000000" & X"000", -- 0x2AB:
- "000000" & X"000", -- 0x2AC:
- "000000" & X"000", -- 0x2AD:
- "000000" & X"000", -- 0x2AE:
- "000000" & X"000", -- 0x2AF:
- "000000" & X"000", -- 0x2B0:
- "000000" & X"000", -- 0x2B1:
- "000000" & X"000", -- 0x2B2:
- "000000" & X"000", -- 0x2B3:
- "000000" & X"000", -- 0x2B4:
- "000000" & X"000", -- 0x2B5:
- "000000" & X"000", -- 0x2B6:
- "000000" & X"000", -- 0x2B7:
- "000000" & X"000", -- 0x2B8:
- "000000" & X"000", -- 0x2B9:
- "000000" & X"000", -- 0x2BA:
- "000000" & X"000", -- 0x2BB:
- "000000" & X"000", -- 0x2BC:
- "000000" & X"000", -- 0x2BD:
- "000000" & X"000", -- 0x2BE:
- "000000" & X"000", -- 0x2BF:
- "000000" & X"000", -- 0x2C0:
- "000000" & X"000", -- 0x2C1:
- "000000" & X"000", -- 0x2C2:
- "000000" & X"000", -- 0x2C3:
- "000000" & X"000", -- 0x2C4:
- "000000" & X"000", -- 0x2C5:
- "000000" & X"000", -- 0x2C6:
- "000000" & X"000", -- 0x2C7:
- "000000" & X"000", -- 0x2C8:
- "000000" & X"000", -- 0x2C9:
- "000000" & X"000", -- 0x2CA:
- "000000" & X"000", -- 0x2CB:
- "000000" & X"000", -- 0x2CC:
- "000000" & X"000", -- 0x2CD:
- "000000" & X"000", -- 0x2CE:
- "000000" & X"000", -- 0x2CF:
- "000000" & X"000", -- 0x2D0:
- "000000" & X"000", -- 0x2D1:
- "000000" & X"000", -- 0x2D2:
- "000000" & X"000", -- 0x2D3:
- "000000" & X"000", -- 0x2D4:
- "000000" & X"000", -- 0x2D5:
- "000000" & X"000", -- 0x2D6:
- "000000" & X"000", -- 0x2D7:
- "000000" & X"000", -- 0x2D8:
- "000000" & X"000", -- 0x2D9:
- "000000" & X"000", -- 0x2DA:
- "000000" & X"000", -- 0x2DB:
- "000000" & X"000", -- 0x2DC:
- "000000" & X"000", -- 0x2DD:
- "000000" & X"000", -- 0x2DE:
- "000000" & X"000", -- 0x2DF:
- "000000" & X"000", -- 0x2E0:
- "000000" & X"000", -- 0x2E1:
- "000000" & X"000", -- 0x2E2:
- "000000" & X"000", -- 0x2E3:
- "000000" & X"000", -- 0x2E4:
- "000000" & X"000", -- 0x2E5:
- "000000" & X"000", -- 0x2E6:
- "000000" & X"000", -- 0x2E7:
- "000000" & X"000", -- 0x2E8:
- "000000" & X"000", -- 0x2E9:
- "000000" & X"000", -- 0x2EA:
- "000000" & X"000", -- 0x2EB:
- "000000" & X"000", -- 0x2EC:
- "000000" & X"000", -- 0x2ED:
- "000000" & X"000", -- 0x2EE:
- "000000" & X"000", -- 0x2EF:
- "000000" & X"000", -- 0x2F0:
- "000000" & X"000", -- 0x2F1:
- "000000" & X"000", -- 0x2F2:
- "000000" & X"000", -- 0x2F3:
- "000000" & X"000", -- 0x2F4:
- "000000" & X"000", -- 0x2F5:
- "000000" & X"000", -- 0x2F6:
- "000000" & X"000", -- 0x2F7:
- "000000" & X"000", -- 0x2F8:
- "000000" & X"000", -- 0x2F9:
- "000000" & X"000", -- 0x2FA:
- "000000" & X"000", -- 0x2FB:
- "000000" & X"000", -- 0x2FC:
- "000000" & X"000", -- 0x2FD:
- "000000" & X"000", -- 0x2FE:
- "110000" & X"2FF", -- 0x2FF: JMP 0x2FF
- "000000" & X"000", -- 0x300:
- "000000" & X"000", -- 0x301:
- "000000" & X"000", -- 0x302:
- "000000" & X"000", -- 0x303:
- "000000" & X"000", -- 0x304:
- "000000" & X"000", -- 0x305:
- "000000" & X"000", -- 0x306:
- "000000" & X"000", -- 0x307:
- "000000" & X"000", -- 0x308:
- "000000" & X"000", -- 0x309:
- "000000" & X"000", -- 0x30A:
- "000000" & X"000", -- 0x30B:
- "000000" & X"000", -- 0x30C:
- "000000" & X"000", -- 0x30D:
- "000000" & X"000", -- 0x30E:
- "000000" & X"000", -- 0x30F:
- "000000" & X"000", -- 0x310:
- "000000" & X"000", -- 0x311:
- "000000" & X"000", -- 0x312:
- "000000" & X"000", -- 0x313:
- "000000" & X"000", -- 0x314:
- "000000" & X"000", -- 0x315:
- "000000" & X"000", -- 0x316:
- "000000" & X"000", -- 0x317:
- "000000" & X"000", -- 0x318:
- "000000" & X"000", -- 0x319:
- "000000" & X"000", -- 0x31A:
- "000000" & X"000", -- 0x31B:
- "000000" & X"000", -- 0x31C:
- "000000" & X"000", -- 0x31D:
- "000000" & X"000", -- 0x31E:
- "000000" & X"000", -- 0x31F:
- "000000" & X"000", -- 0x320:
- "000000" & X"000", -- 0x321:
- "000000" & X"000", -- 0x322:
- "000000" & X"000", -- 0x323:
- "000000" & X"000", -- 0x324:
- "000000" & X"000", -- 0x325:
- "000000" & X"000", -- 0x326:
- "000000" & X"000", -- 0x327:
- "000000" & X"000", -- 0x328:
- "000000" & X"000", -- 0x329:
- "000000" & X"000", -- 0x32A:
- "000000" & X"000", -- 0x32B:
- "000000" & X"000", -- 0x32C:
- "000000" & X"000", -- 0x32D:
- "000000" & X"000", -- 0x32E:
- "000000" & X"000", -- 0x32F:
- "000000" & X"000", -- 0x330:
- "000000" & X"000", -- 0x331:
- "000000" & X"000", -- 0x332:
- "000000" & X"000", -- 0x333:
- "000000" & X"000", -- 0x334:
- "000000" & X"000", -- 0x335:
- "000000" & X"000", -- 0x336:
- "000000" & X"000", -- 0x337:
- "000000" & X"000", -- 0x338:
- "000000" & X"000", -- 0x339:
- "000000" & X"000", -- 0x33A:
- "000000" & X"000", -- 0x33B:
- "000000" & X"000", -- 0x33C:
- "000000" & X"000", -- 0x33D:
- "000000" & X"000", -- 0x33E:
- "000000" & X"000", -- 0x33F:
- "000000" & X"000", -- 0x340:
- "000000" & X"000", -- 0x341:
- "000000" & X"000", -- 0x342:
- "000000" & X"000", -- 0x343:
- "000000" & X"000", -- 0x344:
- "000000" & X"000", -- 0x345:
- "000000" & X"000", -- 0x346:
- "000000" & X"000", -- 0x347:
- "000000" & X"000", -- 0x348:
- "000000" & X"000", -- 0x349:
- "000000" & X"000", -- 0x34A:
- "000000" & X"000", -- 0x34B:
- "000000" & X"000", -- 0x34C:
- "000000" & X"000", -- 0x34D:
- "000000" & X"000", -- 0x34E:
- "000000" & X"000", -- 0x34F:
- "000000" & X"000", -- 0x350:
- "000000" & X"000", -- 0x351:
- "000000" & X"000", -- 0x352:
- "000000" & X"000", -- 0x353:
- "000000" & X"000", -- 0x354:
- "000000" & X"000", -- 0x355:
- "000000" & X"000", -- 0x356:
- "000000" & X"000", -- 0x357:
- "000000" & X"000", -- 0x358:
- "000000" & X"000", -- 0x359:
- "000000" & X"000", -- 0x35A:
- "000000" & X"000", -- 0x35B:
- "000000" & X"000", -- 0x35C:
- "000000" & X"000", -- 0x35D:
- "000000" & X"000", -- 0x35E:
- "000000" & X"000", -- 0x35F:
- "000000" & X"000", -- 0x360:
- "000000" & X"000", -- 0x361:
- "000000" & X"000", -- 0x362:
- "000000" & X"000", -- 0x363:
- "000000" & X"000", -- 0x364:
- "000000" & X"000", -- 0x365:
- "000000" & X"000", -- 0x366:
- "000000" & X"000", -- 0x367:
- "000000" & X"000", -- 0x368:
- "000000" & X"000", -- 0x369:
- "000000" & X"000", -- 0x36A:
- "000000" & X"000", -- 0x36B:
- "000000" & X"000", -- 0x36C:
- "000000" & X"000", -- 0x36D:
- "000000" & X"000", -- 0x36E:
- "000000" & X"000", -- 0x36F:
- "000000" & X"000", -- 0x370:
- "000000" & X"000", -- 0x371:
- "000000" & X"000", -- 0x372:
- "000000" & X"000", -- 0x373:
- "000000" & X"000", -- 0x374:
- "000000" & X"000", -- 0x375:
- "000000" & X"000", -- 0x376:
- "000000" & X"000", -- 0x377:
- "000000" & X"000", -- 0x378:
- "000000" & X"000", -- 0x379:
- "000000" & X"000", -- 0x37A:
- "000000" & X"000", -- 0x37B:
- "000000" & X"000", -- 0x37C:
- "000000" & X"000", -- 0x37D:
- "000000" & X"000", -- 0x37E:
- "000000" & X"000", -- 0x37F:
- "000000" & X"000", -- 0x380:
- "000000" & X"000", -- 0x381:
- "000000" & X"000", -- 0x382:
- "000000" & X"000", -- 0x383:
- "000000" & X"000", -- 0x384:
- "000000" & X"000", -- 0x385:
- "000000" & X"000", -- 0x386:
- "000000" & X"000", -- 0x387:
- "000000" & X"000", -- 0x388:
- "000000" & X"000", -- 0x389:
- "000000" & X"000", -- 0x38A:
- "000000" & X"000", -- 0x38B:
- "000000" & X"000", -- 0x38C:
- "000000" & X"000", -- 0x38D:
- "000000" & X"000", -- 0x38E:
- "000000" & X"000", -- 0x38F:
- "000000" & X"000", -- 0x390:
- "000000" & X"000", -- 0x391:
- "000000" & X"000", -- 0x392:
- "000000" & X"000", -- 0x393:
- "000000" & X"000", -- 0x394:
- "000000" & X"000", -- 0x395:
- "000000" & X"000", -- 0x396:
- "000000" & X"000", -- 0x397:
- "000000" & X"000", -- 0x398:
- "000000" & X"000", -- 0x399:
- "000000" & X"000", -- 0x39A:
- "000000" & X"000", -- 0x39B:
- "000000" & X"000", -- 0x39C:
- "000000" & X"000", -- 0x39D:
- "000000" & X"000", -- 0x39E:
- "000000" & X"000", -- 0x39F:
- "000000" & X"000", -- 0x3A0:
- "000000" & X"000", -- 0x3A1:
- "000000" & X"000", -- 0x3A2:
- "000000" & X"000", -- 0x3A3:
- "000000" & X"000", -- 0x3A4:
- "000000" & X"000", -- 0x3A5:
- "000000" & X"000", -- 0x3A6:
- "000000" & X"000", -- 0x3A7:
- "000000" & X"000", -- 0x3A8:
- "000000" & X"000", -- 0x3A9:
- "000000" & X"000", -- 0x3AA:
- "000000" & X"000", -- 0x3AB:
- "000000" & X"000", -- 0x3AC:
- "000000" & X"000", -- 0x3AD:
- "000000" & X"000", -- 0x3AE:
- "000000" & X"000", -- 0x3AF:
- "000000" & X"000", -- 0x3B0:
- "000000" & X"000", -- 0x3B1:
- "000000" & X"000", -- 0x3B2:
- "000000" & X"000", -- 0x3B3:
- "000000" & X"000", -- 0x3B4:
- "000000" & X"000", -- 0x3B5:
- "000000" & X"000", -- 0x3B6:
- "000000" & X"000", -- 0x3B7:
- "000000" & X"000", -- 0x3B8:
- "000000" & X"000", -- 0x3B9:
- "000000" & X"000", -- 0x3BA:
- "000000" & X"000", -- 0x3BB:
- "000000" & X"000", -- 0x3BC:
- "000000" & X"000", -- 0x3BD:
- "000000" & X"000", -- 0x3BE:
- "000000" & X"000", -- 0x3BF:
- "000000" & X"000", -- 0x3C0:
- "000000" & X"000", -- 0x3C1:
- "000000" & X"000", -- 0x3C2:
- "000000" & X"000", -- 0x3C3:
- "000000" & X"000", -- 0x3C4:
- "000000" & X"000", -- 0x3C5:
- "000000" & X"000", -- 0x3C6:
- "000000" & X"000", -- 0x3C7:
- "000000" & X"000", -- 0x3C8:
- "000000" & X"000", -- 0x3C9:
- "000000" & X"000", -- 0x3CA:
- "000000" & X"000", -- 0x3CB:
- "000000" & X"000", -- 0x3CC:
- "000000" & X"000", -- 0x3CD:
- "000000" & X"000", -- 0x3CE:
- "000000" & X"000", -- 0x3CF:
- "000000" & X"000", -- 0x3D0:
- "000000" & X"000", -- 0x3D1:
- "000000" & X"000", -- 0x3D2:
- "000000" & X"000", -- 0x3D3:
- "000000" & X"000", -- 0x3D4:
- "000000" & X"000", -- 0x3D5:
- "000000" & X"000", -- 0x3D6:
- "000000" & X"000", -- 0x3D7:
- "000000" & X"000", -- 0x3D8:
- "000000" & X"000", -- 0x3D9:
- "000000" & X"000", -- 0x3DA:
- "000000" & X"000", -- 0x3DB:
- "000000" & X"000", -- 0x3DC:
- "000000" & X"000", -- 0x3DD:
- "000000" & X"000", -- 0x3DE:
- "000000" & X"000", -- 0x3DF:
- "000000" & X"000", -- 0x3E0:
- "000000" & X"000", -- 0x3E1:
- "000000" & X"000", -- 0x3E2:
- "000000" & X"000", -- 0x3E3:
- "000000" & X"000", -- 0x3E4:
- "000000" & X"000", -- 0x3E5:
- "000000" & X"000", -- 0x3E6:
- "000000" & X"000", -- 0x3E7:
- "000000" & X"000", -- 0x3E8:
- "000000" & X"000", -- 0x3E9:
- "000000" & X"000", -- 0x3EA:
- "000000" & X"000", -- 0x3EB:
- "000000" & X"000", -- 0x3EC:
- "000000" & X"000", -- 0x3ED:
- "000000" & X"000", -- 0x3EE:
- "000000" & X"000", -- 0x3EF:
- "000000" & X"000", -- 0x3F0:
- "000000" & X"000", -- 0x3F1:
- "000000" & X"000", -- 0x3F2:
- "000000" & X"000", -- 0x3F3:
- "000000" & X"000", -- 0x3F4:
- "000000" & X"000", -- 0x3F5:
- "000000" & X"000", -- 0x3F6:
- "000000" & X"000", -- 0x3F7:
- "000000" & X"000", -- 0x3F8:
- "000000" & X"000", -- 0x3F9:
- "000000" & X"000", -- 0x3FA:
- "000000" & X"000", -- 0x3FB:
- "000000" & X"000", -- 0x3FC:
- "000000" & X"000", -- 0x3FD:
- "000000" & X"000", -- 0x3FE:
- "110000" & X"3FF" -- 0x3FF: JMP 0x3FF
- );
-
-begin
-
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= imem_rom(to_integer(addr));
- end if;
- end process;
-
-end itest;
-
diff --git a/lib/CPUs/JCpu/src/itest_irom_ld.vhdl b/lib/CPUs/JCpu/src/itest_irom_ld.vhdl
deleted file mode 100644
index d4371a1..0000000
--- a/lib/CPUs/JCpu/src/itest_irom_ld.vhdl
+++ /dev/null
@@ -1,1181 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY irom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
-
-END irom;
-
-ARCHITECTURE loadable OF irom IS
-
- -- JASM_ROM_INSERT_HERE
-
- -- Assembled from itest.jsm
- type imem_rom_t is array (0 to 1023) of inst_t;
- signal imem_rom : imem_rom_t :=
- (
- "110000" & X"010", -- 0x000: JMP 0x010
- "110000" & X"288", -- 0x001: JMP 0x288
- "000000" & X"000", -- 0x002:
- "000000" & X"000", -- 0x003:
- "000000" & X"000", -- 0x004:
- "000000" & X"000", -- 0x005:
- "000000" & X"000", -- 0x006:
- "000000" & X"000", -- 0x007:
- "000000" & X"000", -- 0x008:
- "000000" & X"000", -- 0x009:
- "000000" & X"000", -- 0x00A:
- "000000" & X"000", -- 0x00B:
- "000000" & X"000", -- 0x00C:
- "000000" & X"000", -- 0x00D:
- "000000" & X"000", -- 0x00E:
- "000000" & X"000", -- 0x00F:
- "111011" & X"03B", -- 0x010: CALL 0x03B
- "101001" & X"000", -- 0x011: CIN R00, (0x00)
- "100100" & X"000", -- 0x012: XOUT (0x00), R00
- "111011" & X"04C", -- 0x013: CALL 0x04C
- "000011" & X"010", -- 0x014: MOV R00, 0x01
- "100100" & X"010", -- 0x015: XOUT (0x01), R00
- "111011" & X"08D", -- 0x016: CALL 0x08D
- "000011" & X"020", -- 0x017: MOV R00, 0x02
- "100100" & X"010", -- 0x018: XOUT (0x01), R00
- "111011" & X"0C9", -- 0x019: CALL 0x0C9
- "000011" & X"030", -- 0x01A: MOV R00, 0x03
- "100100" & X"010", -- 0x01B: XOUT (0x01), R00
- "111011" & X"0DB", -- 0x01C: CALL 0x0DB
- "000011" & X"040", -- 0x01D: MOV R00, 0x04
- "100100" & X"010", -- 0x01E: XOUT (0x01), R00
- "111011" & X"0ED", -- 0x01F: CALL 0x0ED
- "000011" & X"050", -- 0x020: MOV R00, 0x05
- "100100" & X"010", -- 0x021: XOUT (0x01), R00
- "111011" & X"0FF", -- 0x022: CALL 0x0FF
- "000011" & X"060", -- 0x023: MOV R00, 0x06
- "100100" & X"010", -- 0x024: XOUT (0x01), R00
- "111011" & X"115", -- 0x025: CALL 0x115
- "000011" & X"070", -- 0x026: MOV R00, 0x07
- "100100" & X"010", -- 0x027: XOUT (0x01), R00
- "111011" & X"12B", -- 0x028: CALL 0x12B
- "000011" & X"080", -- 0x029: MOV R00, 0x08
- "100100" & X"010", -- 0x02A: XOUT (0x01), R00
- "111011" & X"137", -- 0x02B: CALL 0x137
- "000011" & X"090", -- 0x02C: MOV R00, 0x09
- "100100" & X"010", -- 0x02D: XOUT (0x01), R00
- "111011" & X"15A", -- 0x02E: CALL 0x15A
- "000011" & X"0A0", -- 0x02F: MOV R00, 0x0A
- "100100" & X"010", -- 0x030: XOUT (0x01), R00
- "111011" & X"22A", -- 0x031: CALL 0x22A
- "000011" & X"0B0", -- 0x032: MOV R00, 0x0B
- "100100" & X"010", -- 0x033: XOUT (0x01), R00
- "111011" & X"24D", -- 0x034: CALL 0x24D
- "000011" & X"0C0", -- 0x035: MOV R00, 0x0C
- "100100" & X"010", -- 0x036: XOUT (0x01), R00
- "111011" & X"278", -- 0x037: CALL 0x278
- "000011" & X"FF0", -- 0x038: MOV R00, 0xFF
- "100100" & X"010", -- 0x039: XOUT (0x01), R00
- "110000" & X"2FF", -- 0x03A: JMP 0x2FF
- "000011" & X"000", -- 0x03B: MOV R00, 0x00
- "000011" & X"001", -- 0x03C: MOV R01, 0x00
- "000011" & X"002", -- 0x03D: MOV R02, 0x00
- "000011" & X"003", -- 0x03E: MOV R03, 0x00
- "000011" & X"004", -- 0x03F: MOV R04, 0x00
- "000011" & X"005", -- 0x040: MOV R05, 0x00
- "000011" & X"006", -- 0x041: MOV R06, 0x00
- "000011" & X"007", -- 0x042: MOV R07, 0x00
- "000011" & X"008", -- 0x043: MOV R08, 0x00
- "000011" & X"009", -- 0x044: MOV R09, 0x00
- "000011" & X"00A", -- 0x045: MOV R10, 0x00
- "000011" & X"00B", -- 0x046: MOV R11, 0x00
- "000011" & X"00C", -- 0x047: MOV R12, 0x00
- "000011" & X"00D", -- 0x048: MOV R13, 0x00
- "000011" & X"00E", -- 0x049: MOV R14, 0x00
- "000011" & X"00F", -- 0x04A: MOV R15, 0x00
- "111110" & X"000", -- 0x04B: RET
- "000011" & X"100", -- 0x04C: MOV R00, 0x10
- "001111" & X"100", -- 0x04D: CMP R00, 0x10
- "111010" & X"3FF", -- 0x04E: JNE 0x3FF
- "010001" & X"010", -- 0x04F: ADD R00, 0x01
- "000010" & X"001", -- 0x050: MOV R01, R00
- "001111" & X"111", -- 0x051: CMP R01, 0x11
- "111010" & X"3FF", -- 0x052: JNE 0x3FF
- "010001" & X"011", -- 0x053: ADD R01, 0x01
- "000010" & X"012", -- 0x054: MOV R02, R01
- "001111" & X"122", -- 0x055: CMP R02, 0x12
- "111010" & X"3FF", -- 0x056: JNE 0x3FF
- "010001" & X"012", -- 0x057: ADD R02, 0x01
- "000010" & X"023", -- 0x058: MOV R03, R02
- "001111" & X"133", -- 0x059: CMP R03, 0x13
- "111010" & X"3FF", -- 0x05A: JNE 0x3FF
- "010001" & X"013", -- 0x05B: ADD R03, 0x01
- "000010" & X"034", -- 0x05C: MOV R04, R03
- "001111" & X"144", -- 0x05D: CMP R04, 0x14
- "111010" & X"3FF", -- 0x05E: JNE 0x3FF
- "010001" & X"014", -- 0x05F: ADD R04, 0x01
- "000010" & X"045", -- 0x060: MOV R05, R04
- "001111" & X"155", -- 0x061: CMP R05, 0x15
- "111010" & X"3FF", -- 0x062: JNE 0x3FF
- "010001" & X"015", -- 0x063: ADD R05, 0x01
- "000010" & X"056", -- 0x064: MOV R06, R05
- "001111" & X"166", -- 0x065: CMP R06, 0x16
- "111010" & X"3FF", -- 0x066: JNE 0x3FF
- "010001" & X"016", -- 0x067: ADD R06, 0x01
- "000010" & X"067", -- 0x068: MOV R07, R06
- "001111" & X"177", -- 0x069: CMP R07, 0x17
- "111010" & X"3FF", -- 0x06A: JNE 0x3FF
- "010001" & X"017", -- 0x06B: ADD R07, 0x01
- "000010" & X"078", -- 0x06C: MOV R08, R07
- "001111" & X"188", -- 0x06D: CMP R08, 0x18
- "111010" & X"3FF", -- 0x06E: JNE 0x3FF
- "010001" & X"018", -- 0x06F: ADD R08, 0x01
- "000010" & X"089", -- 0x070: MOV R09, R08
- "001111" & X"199", -- 0x071: CMP R09, 0x19
- "111010" & X"3FF", -- 0x072: JNE 0x3FF
- "010001" & X"019", -- 0x073: ADD R09, 0x01
- "000010" & X"09A", -- 0x074: MOV R10, R09
- "001111" & X"1AA", -- 0x075: CMP R10, 0x1A
- "111010" & X"3FF", -- 0x076: JNE 0x3FF
- "010001" & X"01A", -- 0x077: ADD R10, 0x01
- "000010" & X"0AB", -- 0x078: MOV R11, R10
- "001111" & X"1BB", -- 0x079: CMP R11, 0x1B
- "111010" & X"3FF", -- 0x07A: JNE 0x3FF
- "010001" & X"01B", -- 0x07B: ADD R11, 0x01
- "000010" & X"0BC", -- 0x07C: MOV R12, R11
- "001111" & X"1CC", -- 0x07D: CMP R12, 0x1C
- "111010" & X"3FF", -- 0x07E: JNE 0x3FF
- "010001" & X"01C", -- 0x07F: ADD R12, 0x01
- "000010" & X"0CD", -- 0x080: MOV R13, R12
- "001111" & X"1DD", -- 0x081: CMP R13, 0x1D
- "111010" & X"3FF", -- 0x082: JNE 0x3FF
- "010001" & X"01D", -- 0x083: ADD R13, 0x01
- "000010" & X"0DE", -- 0x084: MOV R14, R13
- "001111" & X"1EE", -- 0x085: CMP R14, 0x1E
- "111010" & X"3FF", -- 0x086: JNE 0x3FF
- "010001" & X"01E", -- 0x087: ADD R14, 0x01
- "000010" & X"0EF", -- 0x088: MOV R15, R14
- "001111" & X"1FF", -- 0x089: CMP R15, 0x1F
- "111010" & X"3FF", -- 0x08A: JNE 0x3FF
- "010001" & X"01F", -- 0x08B: ADD R15, 0x01
- "111110" & X"000", -- 0x08C: RET
- "000011" & X"000", -- 0x08D: MOV R00, 0x00
- "001111" & X"000", -- 0x08E: TST R00
- "110010" & X"3FF", -- 0x08F: JNZ 0x3FF
- "110011" & X"3FF", -- 0x090: JC 0x3FF
- "001111" & X"000", -- 0x091: CMP R00, 0x00
- "111010" & X"3FF", -- 0x092: JNE 0x3FF
- "110101" & X"3FF", -- 0x093: JLT 0x3FF
- "110110" & X"3FF", -- 0x094: JGT 0x3FF
- "110111" & X"097", -- 0x095: JLE 0x097
- "110000" & X"3FF", -- 0x096: JMP 0x3FF
- "111001" & X"099", -- 0x097: JEQ 0x099
- "110000" & X"3FF", -- 0x098: JMP 0x3FF
- "111000" & X"09B", -- 0x099: JGE 0x09B
- "110000" & X"3FF", -- 0x09A: JMP 0x3FF
- "001111" & X"550", -- 0x09B: CMP R00, 0x55
- "111001" & X"3FF", -- 0x09C: JEQ 0x3FF
- "110101" & X"09F", -- 0x09D: JLT 0x09F
- "110000" & X"3FF", -- 0x09E: JMP 0x3FF
- "110111" & X"0A1", -- 0x09F: JLE 0x0A1
- "110000" & X"3FF", -- 0x0A0: JMP 0x3FF
- "111000" & X"3FF", -- 0x0A1: JGE 0x3FF
- "110110" & X"3FF", -- 0x0A2: JGT 0x3FF
- "000011" & X"550", -- 0x0A3: MOV R00, 0x55
- "001111" & X"000", -- 0x0A4: TST R00
- "110001" & X"3FF", -- 0x0A5: JZ 0x3FF
- "110011" & X"3FF", -- 0x0A6: JC 0x3FF
- "001111" & X"AA0", -- 0x0A7: CMP R00, 0xAA
- "111001" & X"3FF", -- 0x0A8: JEQ 0x3FF
- "111010" & X"0AB", -- 0x0A9: JNE 0x0AB
- "110000" & X"3FF", -- 0x0AA: JMP 0x3FF
- "110101" & X"0AD", -- 0x0AB: JLT 0x0AD
- "110000" & X"3FF", -- 0x0AC: JMP 0x3FF
- "110111" & X"0AF", -- 0x0AD: JLE 0x0AF
- "110000" & X"3FF", -- 0x0AE: JMP 0x3FF
- "110110" & X"3FF", -- 0x0AF: JGT 0x3FF
- "001111" & X"550", -- 0x0B0: CMP R00, 0x55
- "111001" & X"0B3", -- 0x0B1: JEQ 0x0B3
- "110000" & X"3FF", -- 0x0B2: JMP 0x3FF
- "111010" & X"3FF", -- 0x0B3: JNE 0x3FF
- "110101" & X"3FF", -- 0x0B4: JLT 0x3FF
- "110111" & X"0B7", -- 0x0B5: JLE 0x0B7
- "110000" & X"3FF", -- 0x0B6: JMP 0x3FF
- "110110" & X"3FF", -- 0x0B7: JGT 0x3FF
- "111000" & X"0BA", -- 0x0B8: JGE 0x0BA
- "110000" & X"3FF", -- 0x0B9: JMP 0x3FF
- "000011" & X"AA0", -- 0x0BA: MOV R00, 0xAA
- "001111" & X"000", -- 0x0BB: TST R00
- "110001" & X"3FF", -- 0x0BC: JZ 0x3FF
- "110011" & X"3FF", -- 0x0BD: JC 0x3FF
- "001111" & X"550", -- 0x0BE: CMP R00, 0x55
- "111001" & X"3FF", -- 0x0BF: JEQ 0x3FF
- "111010" & X"0C2", -- 0x0C0: JNE 0x0C2
- "110000" & X"3FF", -- 0x0C1: JMP 0x3FF
- "110110" & X"0C4", -- 0x0C2: JGT 0x0C4
- "110000" & X"3FF", -- 0x0C3: JMP 0x3FF
- "111000" & X"0C6", -- 0x0C4: JGE 0x0C6
- "110000" & X"3FF", -- 0x0C5: JMP 0x3FF
- "110101" & X"3FF", -- 0x0C6: JLT 0x3FF
- "110111" & X"3FF", -- 0x0C7: JLE 0x3FF
- "111110" & X"000", -- 0x0C8: RET
- "000011" & X"000", -- 0x0C9: MOV R00, 0x00
- "000011" & X"001", -- 0x0CA: MOV R01, 0x00
- "000010" & X"002", -- 0x0CB: MOV R02, R00
- "000010" & X"013", -- 0x0CC: MOV R03, R01
- "010001" & X"010", -- 0x0CD: ADD R00, 0x01
- "010011" & X"001", -- 0x0CE: ADDC R01, 0x00
- "010001" & X"012", -- 0x0CF: ADD R02, 0x01
- "001111" & X"002", -- 0x0D0: CMP R02, 0x00
- "111010" & X"0D4", -- 0x0D1: JNE 0x0D4
- "010001" & X"013", -- 0x0D2: ADD R03, 0x01
- "001111" & X"023", -- 0x0D3: CMP R03, 0x02
- "111010" & X"0CD", -- 0x0D4: JNE 0x0CD
- "001110" & X"020", -- 0x0D5: CMP R00, R02
- "111010" & X"3FF", -- 0x0D6: JNE 0x3FF
- "001110" & X"031", -- 0x0D7: CMP R01, R03
- "111010" & X"3FF", -- 0x0D8: JNE 0x3FF
- "000011" & X"000", -- 0x0D9: MOV R00, 0x00
- "111110" & X"000", -- 0x0DA: RET
- "000011" & X"000", -- 0x0DB: MOV R00, 0x00
- "000011" & X"031", -- 0x0DC: MOV R01, 0x03
- "000010" & X"002", -- 0x0DD: MOV R02, R00
- "000010" & X"013", -- 0x0DE: MOV R03, R01
- "010101" & X"010", -- 0x0DF: SUB R00, 0x01
- "010111" & X"001", -- 0x0E0: SUBC R01, 0x00
- "010101" & X"012", -- 0x0E1: SUB R02, 0x01
- "001111" & X"FF2", -- 0x0E2: CMP R02, 0xFF
- "111010" & X"0E6", -- 0x0E3: JNE 0x0E6
- "010101" & X"013", -- 0x0E4: SUB R03, 0x01
- "001111" & X"003", -- 0x0E5: CMP R03, 0x00
- "111010" & X"0DF", -- 0x0E6: JNE 0x0DF
- "001110" & X"020", -- 0x0E7: CMP R00, R02
- "111010" & X"3FF", -- 0x0E8: JNE 0x3FF
- "001110" & X"031", -- 0x0E9: CMP R01, R03
- "111010" & X"3FF", -- 0x0EA: JNE 0x3FF
- "000011" & X"000", -- 0x0EB: MOV R00, 0x00
- "111110" & X"000", -- 0x0EC: RET
- "000011" & X"030", -- 0x0ED: MOV R00, 0x03
- "000011" & X"051", -- 0x0EE: MOV R01, 0x05
- "101110" & X"050", -- 0x0EF: SUB 0x05, R00
- "010101" & X"031", -- 0x0F0: SUB R01, 0x03
- "001110" & X"010", -- 0x0F1: CMP R00, R01
- "111010" & X"3FF", -- 0x0F2: JNE 0x3FF
- "000011" & X"030", -- 0x0F3: MOV R00, 0x03
- "000011" & X"051", -- 0x0F4: MOV R01, 0x05
- "010100" & X"010", -- 0x0F5: SUB R00, R01
- "101111" & X"000", -- 0x0F6: SUBC 0x00, R00
- "001111" & X"010", -- 0x0F7: CMP R00, 0x01
- "111010" & X"3FF", -- 0x0F8: JNE 0x3FF
- "010001" & X"000", -- 0x0F9: ADD R00, 0x00
- "010110" & X"001", -- 0x0FA: SUBC R01, R00
- "001111" & X"041", -- 0x0FB: CMP R01, 0x04
- "111010" & X"3FF", -- 0x0FC: JNE 0x3FF
- "000011" & X"000", -- 0x0FD: MOV R00, 0x00
- "111110" & X"000", -- 0x0FE: RET
- "000011" & X"010", -- 0x0FF: MOV R00, 0x01
- "001101" & X"5A0", -- 0x100: MOVC (0x5A), R00
- "010101" & X"010", -- 0x101: DEC R00
- "001101" & X"000", -- 0x102: MOVC (0x00), R00
- "001010" & X"5A1", -- 0x103: MOVC R01, (0x5A)
- "001100" & X"A51", -- 0x104: MOVC (R01), 0xA5
- "001001" & X"010", -- 0x105: MOVC R00, (R01)
- "001001" & X"011", -- 0x106: MOVC R01, (R01)
- "010001" & X"5A1", -- 0x107: ADD R01, 0x5A
- "001001" & X"010", -- 0x108: MOVC R00, (R01)
- "001011" & X"000", -- 0x109: MOVC (R00), R00
- "001001" & X"002", -- 0x10A: MOVC R02, (R00)
- "001110" & X"002", -- 0x10B: CMP R02, R00
- "111010" & X"3FF", -- 0x10C: JNE 0x3FF
- "001011" & X"021", -- 0x10D: MOVC (R01), R02
- "001001" & X"022", -- 0x10E: MOVC R02, (R02)
- "001110" & X"012", -- 0x10F: CMP R02, R01
- "111010" & X"3FF", -- 0x110: JNE 0x3FF
- "010101" & X"011", -- 0x111: DEC R01
- "010001" & X"010", -- 0x112: INC R00
- "110010" & X"109", -- 0x113: JNZ 0x109
- "111110" & X"000", -- 0x114: RET
- "000011" & X"010", -- 0x115: MOV R00, 0x01
- "001000" & X"600", -- 0x116: MOVX (0x60), R00
- "010101" & X"010", -- 0x117: DEC R00
- "001000" & X"060", -- 0x118: MOVX (0x06), R00
- "000101" & X"601", -- 0x119: MOVX R01, (0x60)
- "000111" & X"A51", -- 0x11A: MOVX (R01), 0xA5
- "000100" & X"010", -- 0x11B: MOVX R00, (R01)
- "000100" & X"011", -- 0x11C: MOVX R01, (R01)
- "010001" & X"5A1", -- 0x11D: ADD R01, 0x5A
- "000100" & X"010", -- 0x11E: MOVX R00, (R01)
- "000110" & X"000", -- 0x11F: MOVX (R00), R00
- "000100" & X"002", -- 0x120: MOVX R02, (R00)
- "001110" & X"002", -- 0x121: CMP R02, R00
- "111010" & X"3FF", -- 0x122: JNE 0x3FF
- "000110" & X"021", -- 0x123: MOVX (R01), R02
- "000100" & X"022", -- 0x124: MOVX R02, (R02)
- "001110" & X"012", -- 0x125: CMP R02, R01
- "111010" & X"3FF", -- 0x126: JNE 0x3FF
- "010101" & X"011", -- 0x127: DEC R01
- "010001" & X"010", -- 0x128: INC R00
- "110010" & X"11F", -- 0x129: JNZ 0x11F
- "111110" & X"000", -- 0x12A: RET
- "000011" & X"AA0", -- 0x12B: MOV R00, 0xAA
- "000011" & X"001", -- 0x12C: MOV R01, 0x00
- "111100" & X"000", -- 0x12D: PUSH R00
- "010001" & X"010", -- 0x12E: INC R00
- "010101" & X"011", -- 0x12F: DEC R01
- "110010" & X"12D", -- 0x130: JNZ 0x12D
- "111101" & X"000", -- 0x131: POP R00
- "010101" & X"011", -- 0x132: DEC R01
- "110010" & X"131", -- 0x133: JNZ 0x131
- "001111" & X"AA0", -- 0x134: CMP R00, 0xAA
- "111010" & X"3FF", -- 0x135: JNE 0x3FF
- "111110" & X"000", -- 0x136: RET
- "000011" & X"550", -- 0x137: MOV R00, 0x55
- "111100" & X"000", -- 0x138: PUSH R00
- "000011" & X"000", -- 0x139: MOV R00, 0x00
- "000011" & X"FF1", -- 0x13A: MOV R01, 0xFF
- "111011" & X"151", -- 0x13B: CALL 0x151
- "111101" & X"000", -- 0x13C: POP R00
- "001111" & X"550", -- 0x13D: CMP R00, 0x55
- "111010" & X"3FF", -- 0x13E: JNE 0x3FF
- "000011" & X"010", -- 0x13F: MOV R00, 0x01
- "000011" & X"481", -- 0x140: MOV R01, 0x48
- "100110" & X"050", -- 0x141: COUT (0x05), R00
- "111100" & X"001", -- 0x142: PUSH R01
- "000011" & X"000", -- 0x143: MOV R00, 0x00
- "000011" & X"3B1", -- 0x144: MOV R01, 0x3B
- "100110" & X"050", -- 0x145: COUT (0x05), R00
- "111100" & X"001", -- 0x146: PUSH R01
- "111110" & X"000", -- 0x147: RET
- "000011" & X"010", -- 0x148: MOV R00, 0x01
- "000011" & X"501", -- 0x149: MOV R01, 0x50
- "100110" & X"050", -- 0x14A: COUT (0x05), R00
- "111100" & X"001", -- 0x14B: PUSH R01
- "000011" & X"000", -- 0x14C: MOV R00, 0x00
- "000011" & X"3B1", -- 0x14D: MOV R01, 0x3B
- "100110" & X"050", -- 0x14E: COUT (0x05), R00
- "111100" & X"001", -- 0x14F: PUSH R01
- "111110" & X"000", -- 0x150: RET
- "001110" & X"010", -- 0x151: CMP R00, R01
- "111001" & X"155", -- 0x152: JEQ 0x155
- "010001" & X"010", -- 0x153: INC R00
- "110000" & X"158", -- 0x154: JMP 0x158
- "010101" & X"010", -- 0x155: DEC R00
- "010101" & X"011", -- 0x156: DEC R01
- "111110" & X"000", -- 0x157: RET
- "111011" & X"151", -- 0x158: CALL 0x151
- "110000" & X"155", -- 0x159: JMP 0x155
- "000011" & X"A50", -- 0x15A: MOV R00, 0xA5
- "000011" & X"5A1", -- 0x15B: MOV R01, 0x5A
- "101010" & X"000", -- 0x15C: SWAP R00
- "001111" & X"5A0", -- 0x15D: CMP R00, 0x5A
- "111010" & X"3FF", -- 0x15E: JNE 0x3FF
- "101010" & X"000", -- 0x15F: SWAP R00
- "001111" & X"A50", -- 0x160: CMP R00, 0xA5
- "111010" & X"3FF", -- 0x161: JNE 0x3FF
- "000011" & X"D20", -- 0x162: MOV R00, 0xD2
- "101010" & X"000", -- 0x163: SWAP R00
- "001111" & X"2D0", -- 0x164: CMP R00, 0x2D
- "111010" & X"3FF", -- 0x165: JNE 0x3FF
- "101010" & X"001", -- 0x166: SWAP R01
- "001111" & X"2D0", -- 0x167: CMP R00, 0x2D
- "111010" & X"3FF", -- 0x168: JNE 0x3FF
- "001111" & X"A51", -- 0x169: CMP R01, 0xA5
- "111010" & X"3FF", -- 0x16A: JNE 0x3FF
- "000011" & X"2D0", -- 0x16B: MOV R00, 0x2D
- "011110" & X"000", -- 0x16C: SHL R00
- "001111" & X"5A0", -- 0x16D: CMP R00, 0x5A
- "111010" & X"3FF", -- 0x16E: JNE 0x3FF
- "011110" & X"000", -- 0x16F: SHL R00
- "001111" & X"B40", -- 0x170: CMP R00, 0xB4
- "111010" & X"3FF", -- 0x171: JNE 0x3FF
- "011110" & X"000", -- 0x172: SHL R00
- "001111" & X"680", -- 0x173: CMP R00, 0x68
- "111010" & X"3FF", -- 0x174: JNE 0x3FF
- "011110" & X"000", -- 0x175: SHL R00
- "001111" & X"D00", -- 0x176: CMP R00, 0xD0
- "111010" & X"3FF", -- 0x177: JNE 0x3FF
- "011110" & X"000", -- 0x178: SHL R00
- "001111" & X"A00", -- 0x179: CMP R00, 0xA0
- "111010" & X"3FF", -- 0x17A: JNE 0x3FF
- "011110" & X"000", -- 0x17B: SHL R00
- "001111" & X"400", -- 0x17C: CMP R00, 0x40
- "111010" & X"3FF", -- 0x17D: JNE 0x3FF
- "011110" & X"000", -- 0x17E: SHL R00
- "001111" & X"800", -- 0x17F: CMP R00, 0x80
- "111010" & X"3FF", -- 0x180: JNE 0x3FF
- "011110" & X"000", -- 0x181: SHL R00
- "001111" & X"000", -- 0x182: CMP R00, 0x00
- "111010" & X"3FF", -- 0x183: JNE 0x3FF
- "000011" & X"841", -- 0x184: MOV R01, 0x84
- "011111" & X"001", -- 0x185: SHR R01
- "001111" & X"421", -- 0x186: CMP R01, 0x42
- "111010" & X"3FF", -- 0x187: JNE 0x3FF
- "011111" & X"001", -- 0x188: SHR R01
- "001111" & X"211", -- 0x189: CMP R01, 0x21
- "111010" & X"3FF", -- 0x18A: JNE 0x3FF
- "011111" & X"001", -- 0x18B: SHR R01
- "001111" & X"101", -- 0x18C: CMP R01, 0x10
- "111010" & X"3FF", -- 0x18D: JNE 0x3FF
- "011111" & X"001", -- 0x18E: SHR R01
- "001111" & X"081", -- 0x18F: CMP R01, 0x08
- "111010" & X"3FF", -- 0x190: JNE 0x3FF
- "011111" & X"001", -- 0x191: SHR R01
- "001111" & X"041", -- 0x192: CMP R01, 0x04
- "111010" & X"3FF", -- 0x193: JNE 0x3FF
- "011111" & X"001", -- 0x194: SHR R01
- "001111" & X"021", -- 0x195: CMP R01, 0x02
- "111010" & X"3FF", -- 0x196: JNE 0x3FF
- "011111" & X"001", -- 0x197: SHR R01
- "001111" & X"011", -- 0x198: CMP R01, 0x01
- "111010" & X"3FF", -- 0x199: JNE 0x3FF
- "011111" & X"001", -- 0x19A: SHR R01
- "001111" & X"001", -- 0x19B: CMP R01, 0x00
- "111010" & X"3FF", -- 0x19C: JNE 0x3FF
- "000011" & X"C50", -- 0x19D: MOV R00, 0xC5
- "100000" & X"000", -- 0x19E: ROL R00
- "001111" & X"8B0", -- 0x19F: CMP R00, 0x8B
- "111010" & X"3FF", -- 0x1A0: JNE 0x3FF
- "100000" & X"000", -- 0x1A1: ROL R00
- "001111" & X"170", -- 0x1A2: CMP R00, 0x17
- "111010" & X"3FF", -- 0x1A3: JNE 0x3FF
- "100000" & X"000", -- 0x1A4: ROL R00
- "001111" & X"2E0", -- 0x1A5: CMP R00, 0x2E
- "111010" & X"3FF", -- 0x1A6: JNE 0x3FF
- "100000" & X"000", -- 0x1A7: ROL R00
- "001111" & X"5C0", -- 0x1A8: CMP R00, 0x5C
- "111010" & X"3FF", -- 0x1A9: JNE 0x3FF
- "100000" & X"000", -- 0x1AA: ROL R00
- "001111" & X"B80", -- 0x1AB: CMP R00, 0xB8
- "111010" & X"3FF", -- 0x1AC: JNE 0x3FF
- "100000" & X"000", -- 0x1AD: ROL R00
- "001111" & X"710", -- 0x1AE: CMP R00, 0x71
- "111010" & X"3FF", -- 0x1AF: JNE 0x3FF
- "100000" & X"000", -- 0x1B0: ROL R00
- "001111" & X"E20", -- 0x1B1: CMP R00, 0xE2
- "111010" & X"3FF", -- 0x1B2: JNE 0x3FF
- "100000" & X"000", -- 0x1B3: ROL R00
- "001111" & X"C50", -- 0x1B4: CMP R00, 0xC5
- "111010" & X"3FF", -- 0x1B5: JNE 0x3FF
- "000011" & X"631", -- 0x1B6: MOV R01, 0x63
- "100001" & X"001", -- 0x1B7: ROR R01
- "001111" & X"B11", -- 0x1B8: CMP R01, 0xB1
- "111010" & X"3FF", -- 0x1B9: JNE 0x3FF
- "100001" & X"001", -- 0x1BA: ROR R01
- "001111" & X"D81", -- 0x1BB: CMP R01, 0xD8
- "111010" & X"3FF", -- 0x1BC: JNE 0x3FF
- "100001" & X"001", -- 0x1BD: ROR R01
- "001111" & X"6C1", -- 0x1BE: CMP R01, 0x6C
- "111010" & X"3FF", -- 0x1BF: JNE 0x3FF
- "100001" & X"001", -- 0x1C0: ROR R01
- "001111" & X"361", -- 0x1C1: CMP R01, 0x36
- "111010" & X"3FF", -- 0x1C2: JNE 0x3FF
- "100001" & X"001", -- 0x1C3: ROR R01
- "001111" & X"1B1", -- 0x1C4: CMP R01, 0x1B
- "111010" & X"3FF", -- 0x1C5: JNE 0x3FF
- "100001" & X"001", -- 0x1C6: ROR R01
- "001111" & X"8D1", -- 0x1C7: CMP R01, 0x8D
- "111010" & X"3FF", -- 0x1C8: JNE 0x3FF
- "100001" & X"001", -- 0x1C9: ROR R01
- "001111" & X"C61", -- 0x1CA: CMP R01, 0xC6
- "111010" & X"3FF", -- 0x1CB: JNE 0x3FF
- "100001" & X"001", -- 0x1CC: ROR R01
- "001111" & X"631", -- 0x1CD: CMP R01, 0x63
- "111010" & X"3FF", -- 0x1CE: JNE 0x3FF
- "011100" & X"000", -- 0x1CF: XOR R00, R00
- "000011" & X"C50", -- 0x1D0: MOV R00, 0xC5
- "100010" & X"000", -- 0x1D1: ROLC R00
- "111100" & X"000", -- 0x1D2: PUSH R00
- "100010" & X"000", -- 0x1D3: ROLC R00
- "111100" & X"000", -- 0x1D4: PUSH R00
- "100010" & X"000", -- 0x1D5: ROLC R00
- "111100" & X"000", -- 0x1D6: PUSH R00
- "100010" & X"000", -- 0x1D7: ROLC R00
- "111100" & X"000", -- 0x1D8: PUSH R00
- "100010" & X"000", -- 0x1D9: ROLC R00
- "111100" & X"000", -- 0x1DA: PUSH R00
- "100010" & X"000", -- 0x1DB: ROLC R00
- "111100" & X"000", -- 0x1DC: PUSH R00
- "100010" & X"000", -- 0x1DD: ROLC R00
- "111100" & X"000", -- 0x1DE: PUSH R00
- "100010" & X"000", -- 0x1DF: ROLC R00
- "111100" & X"000", -- 0x1E0: PUSH R00
- "100010" & X"000", -- 0x1E1: ROLC R00
- "001111" & X"C50", -- 0x1E2: CMP R00, 0xC5
- "111010" & X"3FF", -- 0x1E3: JNE 0x3FF
- "111101" & X"000", -- 0x1E4: POP R00
- "001111" & X"620", -- 0x1E5: CMP R00, 0x62
- "111010" & X"3FF", -- 0x1E6: JNE 0x3FF
- "111101" & X"000", -- 0x1E7: POP R00
- "001111" & X"B10", -- 0x1E8: CMP R00, 0xB1
- "111010" & X"3FF", -- 0x1E9: JNE 0x3FF
- "111101" & X"000", -- 0x1EA: POP R00
- "001111" & X"580", -- 0x1EB: CMP R00, 0x58
- "111010" & X"3FF", -- 0x1EC: JNE 0x3FF
- "111101" & X"000", -- 0x1ED: POP R00
- "001111" & X"AC0", -- 0x1EE: CMP R00, 0xAC
- "111010" & X"3FF", -- 0x1EF: JNE 0x3FF
- "111101" & X"000", -- 0x1F0: POP R00
- "001111" & X"560", -- 0x1F1: CMP R00, 0x56
- "111010" & X"3FF", -- 0x1F2: JNE 0x3FF
- "111101" & X"000", -- 0x1F3: POP R00
- "001111" & X"2B0", -- 0x1F4: CMP R00, 0x2B
- "111010" & X"3FF", -- 0x1F5: JNE 0x3FF
- "111101" & X"000", -- 0x1F6: POP R00
- "001111" & X"150", -- 0x1F7: CMP R00, 0x15
- "111010" & X"3FF", -- 0x1F8: JNE 0x3FF
- "111101" & X"000", -- 0x1F9: POP R00
- "001111" & X"8A0", -- 0x1FA: CMP R00, 0x8A
- "111010" & X"3FF", -- 0x1FB: JNE 0x3FF
- "011100" & X"011", -- 0x1FC: XOR R01, R01
- "000011" & X"631", -- 0x1FD: MOV R01, 0x63
- "100011" & X"001", -- 0x1FE: RORC R01
- "111100" & X"001", -- 0x1FF: PUSH R01
- "100011" & X"001", -- 0x200: RORC R01
- "111100" & X"001", -- 0x201: PUSH R01
- "100011" & X"001", -- 0x202: RORC R01
- "111100" & X"001", -- 0x203: PUSH R01
- "100011" & X"001", -- 0x204: RORC R01
- "111100" & X"001", -- 0x205: PUSH R01
- "100011" & X"001", -- 0x206: RORC R01
- "111100" & X"001", -- 0x207: PUSH R01
- "100011" & X"001", -- 0x208: RORC R01
- "111100" & X"001", -- 0x209: PUSH R01
- "100011" & X"001", -- 0x20A: RORC R01
- "111100" & X"001", -- 0x20B: PUSH R01
- "100011" & X"001", -- 0x20C: RORC R01
- "111100" & X"001", -- 0x20D: PUSH R01
- "100011" & X"001", -- 0x20E: RORC R01
- "001111" & X"631", -- 0x20F: CMP R01, 0x63
- "111010" & X"3FF", -- 0x210: JNE 0x3FF
- "111101" & X"001", -- 0x211: POP R01
- "001111" & X"C61", -- 0x212: CMP R01, 0xC6
- "111010" & X"3FF", -- 0x213: JNE 0x3FF
- "111101" & X"001", -- 0x214: POP R01
- "001111" & X"8C1", -- 0x215: CMP R01, 0x8C
- "111010" & X"3FF", -- 0x216: JNE 0x3FF
- "111101" & X"001", -- 0x217: POP R01
- "001111" & X"191", -- 0x218: CMP R01, 0x19
- "111010" & X"3FF", -- 0x219: JNE 0x3FF
- "111101" & X"001", -- 0x21A: POP R01
- "001111" & X"331", -- 0x21B: CMP R01, 0x33
- "111010" & X"3FF", -- 0x21C: JNE 0x3FF
- "111101" & X"001", -- 0x21D: POP R01
- "001111" & X"661", -- 0x21E: CMP R01, 0x66
- "111010" & X"3FF", -- 0x21F: JNE 0x3FF
- "111101" & X"001", -- 0x220: POP R01
- "001111" & X"CC1", -- 0x221: CMP R01, 0xCC
- "111010" & X"3FF", -- 0x222: JNE 0x3FF
- "111101" & X"001", -- 0x223: POP R01
- "001111" & X"981", -- 0x224: CMP R01, 0x98
- "111010" & X"3FF", -- 0x225: JNE 0x3FF
- "111101" & X"001", -- 0x226: POP R01
- "001111" & X"311", -- 0x227: CMP R01, 0x31
- "111010" & X"3FF", -- 0x228: JNE 0x3FF
- "111110" & X"000", -- 0x229: RET
- "000011" & X"A50", -- 0x22A: MOV R00, 0xA5
- "101010" & X"000", -- 0x22B: SWAP R00
- "111100" & X"000", -- 0x22C: PUSH R00
- "011001" & X"0F0", -- 0x22D: AND R00, 0x0F
- "001111" & X"0A0", -- 0x22E: CMP R00, 0x0A
- "111010" & X"3FF", -- 0x22F: JNE 0x3FF
- "111101" & X"000", -- 0x230: POP R00
- "111100" & X"000", -- 0x231: PUSH R00
- "011001" & X"0F0", -- 0x232: AND R00, 0x0F
- "001111" & X"0A0", -- 0x233: CMP R00, 0x0A
- "111101" & X"001", -- 0x234: POP R01
- "111010" & X"3FF", -- 0x235: JNE 0x3FF
- "101010" & X"001", -- 0x236: SWAP R01
- "000011" & X"0F2", -- 0x237: MOV R02, 0x0F
- "011000" & X"021", -- 0x238: AND R01, R02
- "001111" & X"051", -- 0x239: CMP R01, 0x05
- "111010" & X"3FF", -- 0x23A: JNE 0x3FF
- "000011" & X"050", -- 0x23B: MOV R00, 0x05
- "000011" & X"A02", -- 0x23C: MOV R02, 0xA0
- "101010" & X"000", -- 0x23D: SWAP R00
- "011010" & X"002", -- 0x23E: OR R02, R00
- "001111" & X"F02", -- 0x23F: CMP R02, 0xF0
- "111010" & X"3FF", -- 0x240: JNE 0x3FF
- "101010" & X"000", -- 0x241: SWAP R00
- "011011" & X"500", -- 0x242: OR R00, 0x50
- "001111" & X"550", -- 0x243: CMP R00, 0x55
- "111010" & X"3FF", -- 0x244: JNE 0x3FF
- "000011" & X"011", -- 0x245: MOV R01, 0x01
- "000011" & X"010", -- 0x246: MOV R00, 0x01
- "011101" & X"010", -- 0x247: XOR R00, 0x01
- "110010" & X"3FF", -- 0x248: JNZ 0x3FF
- "011100" & X"010", -- 0x249: XOR R00, R01
- "001111" & X"010", -- 0x24A: CMP R00, 0x01
- "111010" & X"3FF", -- 0x24B: JNE 0x3FF
- "111110" & X"000", -- 0x24C: RET
- "000011" & X"030", -- 0x24D: MOV R00, 0x03
- "100110" & X"030", -- 0x24E: COUT (0x03), R00
- "101000" & X"020", -- 0x24F: XIN R00, (0x02)
- "011011" & X"010", -- 0x250: OR R00, 0x01
- "100100" & X"020", -- 0x251: XOUT (0x02), R00
- "000000" & X"000", -- 0x252: NOP
- "000000" & X"000", -- 0x253: NOP
- "000000" & X"000", -- 0x254: NOP
- "000000" & X"000", -- 0x255: NOP
- "000000" & X"000", -- 0x256: NOP
- "000000" & X"000", -- 0x257: NOP
- "101000" & X"020", -- 0x258: XIN R00, (0x02)
- "011001" & X"FE0", -- 0x259: AND R00, 0xFE
- "100100" & X"020", -- 0x25A: XOUT (0x02), R00
- "000000" & X"000", -- 0x25B: NOP
- "000000" & X"000", -- 0x25C: NOP
- "000000" & X"000", -- 0x25D: NOP
- "000000" & X"000", -- 0x25E: NOP
- "101001" & X"030", -- 0x25F: CIN R00, (0x03)
- "011011" & X"800", -- 0x260: OR R00, 0x80
- "100110" & X"030", -- 0x261: COUT (0x03), R00
- "000000" & X"000", -- 0x262: NOP
- "101001" & X"030", -- 0x263: CIN R00, (0x03)
- "011011" & X"800", -- 0x264: OR R00, 0x80
- "100110" & X"030", -- 0x265: COUT (0x03), R00
- "000000" & X"000", -- 0x266: NOP
- "101001" & X"030", -- 0x267: CIN R00, (0x03)
- "011011" & X"800", -- 0x268: OR R00, 0x80
- "100110" & X"030", -- 0x269: COUT (0x03), R00
- "000000" & X"000", -- 0x26A: NOP
- "101001" & X"030", -- 0x26B: CIN R00, (0x03)
- "011011" & X"800", -- 0x26C: OR R00, 0x80
- "100110" & X"030", -- 0x26D: COUT (0x03), R00
- "000000" & X"000", -- 0x26E: NOP
- "000000" & X"000", -- 0x26F: NOP
- "000000" & X"000", -- 0x270: NOP
- "000000" & X"000", -- 0x271: NOP
- "000000" & X"000", -- 0x272: NOP
- "000000" & X"000", -- 0x273: NOP
- "000000" & X"000", -- 0x274: NOP
- "000000" & X"000", -- 0x275: NOP
- "000000" & X"000", -- 0x276: NOP
- "111110" & X"000", -- 0x277: RET
- "010101" & X"000", -- 0x278: SUB R00, 0x00
- "110011" & X"3FF", -- 0x279: JC 0x3FF
- "101011" & X"000", -- 0x27A: SETC
- "110100" & X"3FF", -- 0x27B: JNC 0x3FF
- "000000" & X"000", -- 0x27C: NOP
- "010101" & X"000", -- 0x27D: SUB R00, 0x00
- "110011" & X"3FF", -- 0x27E: JC 0x3FF
- "000011" & X"000", -- 0x27F: MOV R00, 0x00
- "010101" & X"000", -- 0x280: CLRC
- "110011" & X"3FF", -- 0x281: JC 0x3FF
- "101011" & X"000", -- 0x282: SETC
- "110100" & X"3FF", -- 0x283: JNC 0x3FF
- "000000" & X"000", -- 0x284: NOP
- "010101" & X"000", -- 0x285: CLRC
- "110011" & X"3FF", -- 0x286: JC 0x3FF
- "111110" & X"000", -- 0x287: RET
- "010001" & X"01E", -- 0x288: INC R14
- "111111" & X"000", -- 0x289: RETI
- "000000" & X"000", -- 0x28A:
- "000000" & X"000", -- 0x28B:
- "000000" & X"000", -- 0x28C:
- "000000" & X"000", -- 0x28D:
- "000000" & X"000", -- 0x28E:
- "000000" & X"000", -- 0x28F:
- "000000" & X"000", -- 0x290:
- "000000" & X"000", -- 0x291:
- "000000" & X"000", -- 0x292:
- "000000" & X"000", -- 0x293:
- "000000" & X"000", -- 0x294:
- "000000" & X"000", -- 0x295:
- "000000" & X"000", -- 0x296:
- "000000" & X"000", -- 0x297:
- "000000" & X"000", -- 0x298:
- "000000" & X"000", -- 0x299:
- "000000" & X"000", -- 0x29A:
- "000000" & X"000", -- 0x29B:
- "000000" & X"000", -- 0x29C:
- "000000" & X"000", -- 0x29D:
- "000000" & X"000", -- 0x29E:
- "000000" & X"000", -- 0x29F:
- "000000" & X"000", -- 0x2A0:
- "000000" & X"000", -- 0x2A1:
- "000000" & X"000", -- 0x2A2:
- "000000" & X"000", -- 0x2A3:
- "000000" & X"000", -- 0x2A4:
- "000000" & X"000", -- 0x2A5:
- "000000" & X"000", -- 0x2A6:
- "000000" & X"000", -- 0x2A7:
- "000000" & X"000", -- 0x2A8:
- "000000" & X"000", -- 0x2A9:
- "000000" & X"000", -- 0x2AA:
- "000000" & X"000", -- 0x2AB:
- "000000" & X"000", -- 0x2AC:
- "000000" & X"000", -- 0x2AD:
- "000000" & X"000", -- 0x2AE:
- "000000" & X"000", -- 0x2AF:
- "000000" & X"000", -- 0x2B0:
- "000000" & X"000", -- 0x2B1:
- "000000" & X"000", -- 0x2B2:
- "000000" & X"000", -- 0x2B3:
- "000000" & X"000", -- 0x2B4:
- "000000" & X"000", -- 0x2B5:
- "000000" & X"000", -- 0x2B6:
- "000000" & X"000", -- 0x2B7:
- "000000" & X"000", -- 0x2B8:
- "000000" & X"000", -- 0x2B9:
- "000000" & X"000", -- 0x2BA:
- "000000" & X"000", -- 0x2BB:
- "000000" & X"000", -- 0x2BC:
- "000000" & X"000", -- 0x2BD:
- "000000" & X"000", -- 0x2BE:
- "000000" & X"000", -- 0x2BF:
- "000000" & X"000", -- 0x2C0:
- "000000" & X"000", -- 0x2C1:
- "000000" & X"000", -- 0x2C2:
- "000000" & X"000", -- 0x2C3:
- "000000" & X"000", -- 0x2C4:
- "000000" & X"000", -- 0x2C5:
- "000000" & X"000", -- 0x2C6:
- "000000" & X"000", -- 0x2C7:
- "000000" & X"000", -- 0x2C8:
- "000000" & X"000", -- 0x2C9:
- "000000" & X"000", -- 0x2CA:
- "000000" & X"000", -- 0x2CB:
- "000000" & X"000", -- 0x2CC:
- "000000" & X"000", -- 0x2CD:
- "000000" & X"000", -- 0x2CE:
- "000000" & X"000", -- 0x2CF:
- "000000" & X"000", -- 0x2D0:
- "000000" & X"000", -- 0x2D1:
- "000000" & X"000", -- 0x2D2:
- "000000" & X"000", -- 0x2D3:
- "000000" & X"000", -- 0x2D4:
- "000000" & X"000", -- 0x2D5:
- "000000" & X"000", -- 0x2D6:
- "000000" & X"000", -- 0x2D7:
- "000000" & X"000", -- 0x2D8:
- "000000" & X"000", -- 0x2D9:
- "000000" & X"000", -- 0x2DA:
- "000000" & X"000", -- 0x2DB:
- "000000" & X"000", -- 0x2DC:
- "000000" & X"000", -- 0x2DD:
- "000000" & X"000", -- 0x2DE:
- "000000" & X"000", -- 0x2DF:
- "000000" & X"000", -- 0x2E0:
- "000000" & X"000", -- 0x2E1:
- "000000" & X"000", -- 0x2E2:
- "000000" & X"000", -- 0x2E3:
- "000000" & X"000", -- 0x2E4:
- "000000" & X"000", -- 0x2E5:
- "000000" & X"000", -- 0x2E6:
- "000000" & X"000", -- 0x2E7:
- "000000" & X"000", -- 0x2E8:
- "000000" & X"000", -- 0x2E9:
- "000000" & X"000", -- 0x2EA:
- "000000" & X"000", -- 0x2EB:
- "000000" & X"000", -- 0x2EC:
- "000000" & X"000", -- 0x2ED:
- "000000" & X"000", -- 0x2EE:
- "000000" & X"000", -- 0x2EF:
- "000000" & X"000", -- 0x2F0:
- "000000" & X"000", -- 0x2F1:
- "000000" & X"000", -- 0x2F2:
- "000000" & X"000", -- 0x2F3:
- "000000" & X"000", -- 0x2F4:
- "000000" & X"000", -- 0x2F5:
- "000000" & X"000", -- 0x2F6:
- "000000" & X"000", -- 0x2F7:
- "000000" & X"000", -- 0x2F8:
- "000000" & X"000", -- 0x2F9:
- "000000" & X"000", -- 0x2FA:
- "000000" & X"000", -- 0x2FB:
- "000000" & X"000", -- 0x2FC:
- "000000" & X"000", -- 0x2FD:
- "000000" & X"000", -- 0x2FE:
- "110000" & X"2FF", -- 0x2FF: JMP 0x2FF
- "000000" & X"000", -- 0x300:
- "000000" & X"000", -- 0x301:
- "000000" & X"000", -- 0x302:
- "000000" & X"000", -- 0x303:
- "000000" & X"000", -- 0x304:
- "000000" & X"000", -- 0x305:
- "000000" & X"000", -- 0x306:
- "000000" & X"000", -- 0x307:
- "000000" & X"000", -- 0x308:
- "000000" & X"000", -- 0x309:
- "000000" & X"000", -- 0x30A:
- "000000" & X"000", -- 0x30B:
- "000000" & X"000", -- 0x30C:
- "000000" & X"000", -- 0x30D:
- "000000" & X"000", -- 0x30E:
- "000000" & X"000", -- 0x30F:
- "000000" & X"000", -- 0x310:
- "000000" & X"000", -- 0x311:
- "000000" & X"000", -- 0x312:
- "000000" & X"000", -- 0x313:
- "000000" & X"000", -- 0x314:
- "000000" & X"000", -- 0x315:
- "000000" & X"000", -- 0x316:
- "000000" & X"000", -- 0x317:
- "000000" & X"000", -- 0x318:
- "000000" & X"000", -- 0x319:
- "000000" & X"000", -- 0x31A:
- "000000" & X"000", -- 0x31B:
- "000000" & X"000", -- 0x31C:
- "000000" & X"000", -- 0x31D:
- "000000" & X"000", -- 0x31E:
- "000000" & X"000", -- 0x31F:
- "000000" & X"000", -- 0x320:
- "000000" & X"000", -- 0x321:
- "000000" & X"000", -- 0x322:
- "000000" & X"000", -- 0x323:
- "000000" & X"000", -- 0x324:
- "000000" & X"000", -- 0x325:
- "000000" & X"000", -- 0x326:
- "000000" & X"000", -- 0x327:
- "000000" & X"000", -- 0x328:
- "000000" & X"000", -- 0x329:
- "000000" & X"000", -- 0x32A:
- "000000" & X"000", -- 0x32B:
- "000000" & X"000", -- 0x32C:
- "000000" & X"000", -- 0x32D:
- "000000" & X"000", -- 0x32E:
- "000000" & X"000", -- 0x32F:
- "000000" & X"000", -- 0x330:
- "000000" & X"000", -- 0x331:
- "000000" & X"000", -- 0x332:
- "000000" & X"000", -- 0x333:
- "000000" & X"000", -- 0x334:
- "000000" & X"000", -- 0x335:
- "000000" & X"000", -- 0x336:
- "000000" & X"000", -- 0x337:
- "000000" & X"000", -- 0x338:
- "000000" & X"000", -- 0x339:
- "000000" & X"000", -- 0x33A:
- "000000" & X"000", -- 0x33B:
- "000000" & X"000", -- 0x33C:
- "000000" & X"000", -- 0x33D:
- "000000" & X"000", -- 0x33E:
- "000000" & X"000", -- 0x33F:
- "000000" & X"000", -- 0x340:
- "000000" & X"000", -- 0x341:
- "000000" & X"000", -- 0x342:
- "000000" & X"000", -- 0x343:
- "000000" & X"000", -- 0x344:
- "000000" & X"000", -- 0x345:
- "000000" & X"000", -- 0x346:
- "000000" & X"000", -- 0x347:
- "000000" & X"000", -- 0x348:
- "000000" & X"000", -- 0x349:
- "000000" & X"000", -- 0x34A:
- "000000" & X"000", -- 0x34B:
- "000000" & X"000", -- 0x34C:
- "000000" & X"000", -- 0x34D:
- "000000" & X"000", -- 0x34E:
- "000000" & X"000", -- 0x34F:
- "000000" & X"000", -- 0x350:
- "000000" & X"000", -- 0x351:
- "000000" & X"000", -- 0x352:
- "000000" & X"000", -- 0x353:
- "000000" & X"000", -- 0x354:
- "000000" & X"000", -- 0x355:
- "000000" & X"000", -- 0x356:
- "000000" & X"000", -- 0x357:
- "000000" & X"000", -- 0x358:
- "000000" & X"000", -- 0x359:
- "000000" & X"000", -- 0x35A:
- "000000" & X"000", -- 0x35B:
- "000000" & X"000", -- 0x35C:
- "000000" & X"000", -- 0x35D:
- "000000" & X"000", -- 0x35E:
- "000000" & X"000", -- 0x35F:
- "000000" & X"000", -- 0x360:
- "000000" & X"000", -- 0x361:
- "000000" & X"000", -- 0x362:
- "000000" & X"000", -- 0x363:
- "000000" & X"000", -- 0x364:
- "000000" & X"000", -- 0x365:
- "000000" & X"000", -- 0x366:
- "000000" & X"000", -- 0x367:
- "000000" & X"000", -- 0x368:
- "000000" & X"000", -- 0x369:
- "000000" & X"000", -- 0x36A:
- "000000" & X"000", -- 0x36B:
- "000000" & X"000", -- 0x36C:
- "000000" & X"000", -- 0x36D:
- "000000" & X"000", -- 0x36E:
- "000000" & X"000", -- 0x36F:
- "000000" & X"000", -- 0x370:
- "000000" & X"000", -- 0x371:
- "000000" & X"000", -- 0x372:
- "000000" & X"000", -- 0x373:
- "000000" & X"000", -- 0x374:
- "000000" & X"000", -- 0x375:
- "000000" & X"000", -- 0x376:
- "000000" & X"000", -- 0x377:
- "000000" & X"000", -- 0x378:
- "000000" & X"000", -- 0x379:
- "000000" & X"000", -- 0x37A:
- "000000" & X"000", -- 0x37B:
- "000000" & X"000", -- 0x37C:
- "000000" & X"000", -- 0x37D:
- "000000" & X"000", -- 0x37E:
- "000000" & X"000", -- 0x37F:
- "000000" & X"000", -- 0x380:
- "000000" & X"000", -- 0x381:
- "000000" & X"000", -- 0x382:
- "000000" & X"000", -- 0x383:
- "000000" & X"000", -- 0x384:
- "000000" & X"000", -- 0x385:
- "000000" & X"000", -- 0x386:
- "000000" & X"000", -- 0x387:
- "000000" & X"000", -- 0x388:
- "000000" & X"000", -- 0x389:
- "000000" & X"000", -- 0x38A:
- "000000" & X"000", -- 0x38B:
- "000000" & X"000", -- 0x38C:
- "000000" & X"000", -- 0x38D:
- "000000" & X"000", -- 0x38E:
- "000000" & X"000", -- 0x38F:
- "000000" & X"000", -- 0x390:
- "000000" & X"000", -- 0x391:
- "000000" & X"000", -- 0x392:
- "000000" & X"000", -- 0x393:
- "000000" & X"000", -- 0x394:
- "000000" & X"000", -- 0x395:
- "000000" & X"000", -- 0x396:
- "000000" & X"000", -- 0x397:
- "000000" & X"000", -- 0x398:
- "000000" & X"000", -- 0x399:
- "000000" & X"000", -- 0x39A:
- "000000" & X"000", -- 0x39B:
- "000000" & X"000", -- 0x39C:
- "000000" & X"000", -- 0x39D:
- "000000" & X"000", -- 0x39E:
- "000000" & X"000", -- 0x39F:
- "000000" & X"000", -- 0x3A0:
- "000000" & X"000", -- 0x3A1:
- "000000" & X"000", -- 0x3A2:
- "000000" & X"000", -- 0x3A3:
- "000000" & X"000", -- 0x3A4:
- "000000" & X"000", -- 0x3A5:
- "000000" & X"000", -- 0x3A6:
- "000000" & X"000", -- 0x3A7:
- "000000" & X"000", -- 0x3A8:
- "000000" & X"000", -- 0x3A9:
- "000000" & X"000", -- 0x3AA:
- "000000" & X"000", -- 0x3AB:
- "000000" & X"000", -- 0x3AC:
- "000000" & X"000", -- 0x3AD:
- "000000" & X"000", -- 0x3AE:
- "000000" & X"000", -- 0x3AF:
- "000000" & X"000", -- 0x3B0:
- "000000" & X"000", -- 0x3B1:
- "000000" & X"000", -- 0x3B2:
- "000000" & X"000", -- 0x3B3:
- "000000" & X"000", -- 0x3B4:
- "000000" & X"000", -- 0x3B5:
- "000000" & X"000", -- 0x3B6:
- "000000" & X"000", -- 0x3B7:
- "000000" & X"000", -- 0x3B8:
- "000000" & X"000", -- 0x3B9:
- "000000" & X"000", -- 0x3BA:
- "000000" & X"000", -- 0x3BB:
- "000000" & X"000", -- 0x3BC:
- "000000" & X"000", -- 0x3BD:
- "000000" & X"000", -- 0x3BE:
- "000000" & X"000", -- 0x3BF:
- "000000" & X"000", -- 0x3C0:
- "000000" & X"000", -- 0x3C1:
- "000000" & X"000", -- 0x3C2:
- "000000" & X"000", -- 0x3C3:
- "000000" & X"000", -- 0x3C4:
- "000000" & X"000", -- 0x3C5:
- "000000" & X"000", -- 0x3C6:
- "000000" & X"000", -- 0x3C7:
- "000000" & X"000", -- 0x3C8:
- "000000" & X"000", -- 0x3C9:
- "000000" & X"000", -- 0x3CA:
- "000000" & X"000", -- 0x3CB:
- "000000" & X"000", -- 0x3CC:
- "000000" & X"000", -- 0x3CD:
- "000000" & X"000", -- 0x3CE:
- "000000" & X"000", -- 0x3CF:
- "000000" & X"000", -- 0x3D0:
- "000000" & X"000", -- 0x3D1:
- "000000" & X"000", -- 0x3D2:
- "000000" & X"000", -- 0x3D3:
- "000000" & X"000", -- 0x3D4:
- "000000" & X"000", -- 0x3D5:
- "000000" & X"000", -- 0x3D6:
- "000000" & X"000", -- 0x3D7:
- "000000" & X"000", -- 0x3D8:
- "000000" & X"000", -- 0x3D9:
- "000000" & X"000", -- 0x3DA:
- "000000" & X"000", -- 0x3DB:
- "000000" & X"000", -- 0x3DC:
- "000000" & X"000", -- 0x3DD:
- "000000" & X"000", -- 0x3DE:
- "000000" & X"000", -- 0x3DF:
- "000000" & X"000", -- 0x3E0:
- "000000" & X"000", -- 0x3E1:
- "000000" & X"000", -- 0x3E2:
- "000000" & X"000", -- 0x3E3:
- "000000" & X"000", -- 0x3E4:
- "000000" & X"000", -- 0x3E5:
- "000000" & X"000", -- 0x3E6:
- "000000" & X"000", -- 0x3E7:
- "000000" & X"000", -- 0x3E8:
- "000000" & X"000", -- 0x3E9:
- "000000" & X"000", -- 0x3EA:
- "000000" & X"000", -- 0x3EB:
- "000000" & X"000", -- 0x3EC:
- "000000" & X"000", -- 0x3ED:
- "000000" & X"000", -- 0x3EE:
- "000000" & X"000", -- 0x3EF:
- "000000" & X"000", -- 0x3F0:
- "000000" & X"000", -- 0x3F1:
- "000000" & X"000", -- 0x3F2:
- "000000" & X"000", -- 0x3F3:
- "000000" & X"000", -- 0x3F4:
- "000000" & X"000", -- 0x3F5:
- "000000" & X"000", -- 0x3F6:
- "000000" & X"000", -- 0x3F7:
- "000000" & X"000", -- 0x3F8:
- "000000" & X"000", -- 0x3F9:
- "000000" & X"000", -- 0x3FA:
- "000000" & X"000", -- 0x3FB:
- "000000" & X"000", -- 0x3FC:
- "000000" & X"000", -- 0x3FD:
- "000000" & X"000", -- 0x3FE:
- "110000" & X"3FF" -- 0x3FF: JMP 0x3FF
- );
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : inst_addr_t;
- signal jtag_ld_dout : inst_t;
- signal jtag_ld_din : inst_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (31 downto 0);
- constant id : unsigned (31 downto 0) := X"BABE" & X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst1 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 1 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-inst_addr_t'length+1);
- jtag_ld_din <= user_regi(inst_t'length-1 downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto inst_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= imem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- imem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= imem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/JCpu/src/itest_xrom.vhdl b/lib/CPUs/JCpu/src/itest_xrom.vhdl
deleted file mode 100644
index 4206abc..0000000
--- a/lib/CPUs/JCpu/src/itest_xrom.vhdl
+++ /dev/null
@@ -1,317 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-ENTITY xrom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in dmem_addr_t;
- dout : out dmem_data_t
- );
-END xrom;
-
-ARCHITECTURE itest OF xrom IS
-
- type xmem_rom_t is array (0 to 255) of dmem_data_t;
-
- -- Assembled from itest.jsm
- constant xmem_rom : xmem_rom_t :=
- (
- X"48", -- 0x00
- X"61", -- 0x01
- X"6C", -- 0x02
- X"6C", -- 0x03
- X"6F", -- 0x04
- X"00", -- 0x05
- X"00", -- 0x06
- X"00", -- 0x07
- X"00", -- 0x08
- X"00", -- 0x09
- X"00", -- 0x0A
- X"00", -- 0x0B
- X"00", -- 0x0C
- X"00", -- 0x0D
- X"00", -- 0x0E
- X"00", -- 0x0F
- X"00", -- 0x10
- X"00", -- 0x11
- X"00", -- 0x12
- X"00", -- 0x13
- X"00", -- 0x14
- X"00", -- 0x15
- X"00", -- 0x16
- X"00", -- 0x17
- X"00", -- 0x18
- X"00", -- 0x19
- X"00", -- 0x1A
- X"00", -- 0x1B
- X"00", -- 0x1C
- X"00", -- 0x1D
- X"00", -- 0x1E
- X"00", -- 0x1F
- X"00", -- 0x20
- X"00", -- 0x21
- X"00", -- 0x22
- X"00", -- 0x23
- X"00", -- 0x24
- X"00", -- 0x25
- X"00", -- 0x26
- X"00", -- 0x27
- X"00", -- 0x28
- X"00", -- 0x29
- X"00", -- 0x2A
- X"00", -- 0x2B
- X"00", -- 0x2C
- X"00", -- 0x2D
- X"00", -- 0x2E
- X"00", -- 0x2F
- X"00", -- 0x30
- X"00", -- 0x31
- X"00", -- 0x32
- X"00", -- 0x33
- X"00", -- 0x34
- X"00", -- 0x35
- X"00", -- 0x36
- X"00", -- 0x37
- X"00", -- 0x38
- X"00", -- 0x39
- X"00", -- 0x3A
- X"00", -- 0x3B
- X"00", -- 0x3C
- X"00", -- 0x3D
- X"00", -- 0x3E
- X"00", -- 0x3F
- X"00", -- 0x40
- X"00", -- 0x41
- X"00", -- 0x42
- X"00", -- 0x43
- X"00", -- 0x44
- X"00", -- 0x45
- X"00", -- 0x46
- X"00", -- 0x47
- X"00", -- 0x48
- X"00", -- 0x49
- X"00", -- 0x4A
- X"00", -- 0x4B
- X"00", -- 0x4C
- X"00", -- 0x4D
- X"00", -- 0x4E
- X"00", -- 0x4F
- X"00", -- 0x50
- X"00", -- 0x51
- X"00", -- 0x52
- X"00", -- 0x53
- X"00", -- 0x54
- X"00", -- 0x55
- X"00", -- 0x56
- X"00", -- 0x57
- X"00", -- 0x58
- X"00", -- 0x59
- X"00", -- 0x5A
- X"00", -- 0x5B
- X"00", -- 0x5C
- X"00", -- 0x5D
- X"00", -- 0x5E
- X"00", -- 0x5F
- X"00", -- 0x60
- X"00", -- 0x61
- X"00", -- 0x62
- X"00", -- 0x63
- X"00", -- 0x64
- X"00", -- 0x65
- X"00", -- 0x66
- X"00", -- 0x67
- X"00", -- 0x68
- X"00", -- 0x69
- X"00", -- 0x6A
- X"00", -- 0x6B
- X"00", -- 0x6C
- X"00", -- 0x6D
- X"00", -- 0x6E
- X"00", -- 0x6F
- X"00", -- 0x70
- X"00", -- 0x71
- X"00", -- 0x72
- X"00", -- 0x73
- X"00", -- 0x74
- X"00", -- 0x75
- X"00", -- 0x76
- X"00", -- 0x77
- X"00", -- 0x78
- X"00", -- 0x79
- X"00", -- 0x7A
- X"00", -- 0x7B
- X"00", -- 0x7C
- X"00", -- 0x7D
- X"00", -- 0x7E
- X"00", -- 0x7F
- X"00", -- 0x80
- X"00", -- 0x81
- X"00", -- 0x82
- X"00", -- 0x83
- X"00", -- 0x84
- X"00", -- 0x85
- X"00", -- 0x86
- X"00", -- 0x87
- X"00", -- 0x88
- X"00", -- 0x89
- X"00", -- 0x8A
- X"00", -- 0x8B
- X"00", -- 0x8C
- X"00", -- 0x8D
- X"00", -- 0x8E
- X"00", -- 0x8F
- X"00", -- 0x90
- X"00", -- 0x91
- X"00", -- 0x92
- X"00", -- 0x93
- X"00", -- 0x94
- X"00", -- 0x95
- X"00", -- 0x96
- X"00", -- 0x97
- X"00", -- 0x98
- X"00", -- 0x99
- X"00", -- 0x9A
- X"00", -- 0x9B
- X"00", -- 0x9C
- X"00", -- 0x9D
- X"00", -- 0x9E
- X"00", -- 0x9F
- X"00", -- 0xA0
- X"00", -- 0xA1
- X"00", -- 0xA2
- X"00", -- 0xA3
- X"00", -- 0xA4
- X"00", -- 0xA5
- X"00", -- 0xA6
- X"00", -- 0xA7
- X"00", -- 0xA8
- X"00", -- 0xA9
- X"00", -- 0xAA
- X"00", -- 0xAB
- X"00", -- 0xAC
- X"00", -- 0xAD
- X"00", -- 0xAE
- X"00", -- 0xAF
- X"00", -- 0xB0
- X"00", -- 0xB1
- X"00", -- 0xB2
- X"00", -- 0xB3
- X"00", -- 0xB4
- X"00", -- 0xB5
- X"00", -- 0xB6
- X"00", -- 0xB7
- X"00", -- 0xB8
- X"00", -- 0xB9
- X"00", -- 0xBA
- X"00", -- 0xBB
- X"00", -- 0xBC
- X"00", -- 0xBD
- X"00", -- 0xBE
- X"00", -- 0xBF
- X"00", -- 0xC0
- X"00", -- 0xC1
- X"00", -- 0xC2
- X"00", -- 0xC3
- X"00", -- 0xC4
- X"00", -- 0xC5
- X"00", -- 0xC6
- X"00", -- 0xC7
- X"00", -- 0xC8
- X"00", -- 0xC9
- X"00", -- 0xCA
- X"00", -- 0xCB
- X"00", -- 0xCC
- X"00", -- 0xCD
- X"00", -- 0xCE
- X"00", -- 0xCF
- X"00", -- 0xD0
- X"00", -- 0xD1
- X"00", -- 0xD2
- X"00", -- 0xD3
- X"00", -- 0xD4
- X"00", -- 0xD5
- X"00", -- 0xD6
- X"00", -- 0xD7
- X"00", -- 0xD8
- X"00", -- 0xD9
- X"00", -- 0xDA
- X"00", -- 0xDB
- X"00", -- 0xDC
- X"00", -- 0xDD
- X"00", -- 0xDE
- X"00", -- 0xDF
- X"00", -- 0xE0
- X"00", -- 0xE1
- X"00", -- 0xE2
- X"00", -- 0xE3
- X"00", -- 0xE4
- X"00", -- 0xE5
- X"00", -- 0xE6
- X"00", -- 0xE7
- X"00", -- 0xE8
- X"00", -- 0xE9
- X"00", -- 0xEA
- X"00", -- 0xEB
- X"00", -- 0xEC
- X"00", -- 0xED
- X"00", -- 0xEE
- X"00", -- 0xEF
- X"00", -- 0xF0
- X"00", -- 0xF1
- X"00", -- 0xF2
- X"00", -- 0xF3
- X"00", -- 0xF4
- X"00", -- 0xF5
- X"00", -- 0xF6
- X"00", -- 0xF7
- X"00", -- 0xF8
- X"00", -- 0xF9
- X"00", -- 0xFA
- X"00", -- 0xFB
- X"00", -- 0xFC
- X"00", -- 0xFD
- X"00", -- 0xFE
- X"00" -- 0xFF
- );
-
-begin
-
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= xmem_rom(to_integer(addr));
- end if;
- end process;
-
-end itest;
-
diff --git a/lib/CPUs/JCpu/src/itest_xrom_ld.vhdl b/lib/CPUs/JCpu/src/itest_xrom_ld.vhdl
deleted file mode 100644
index 60a84ac..0000000
--- a/lib/CPUs/JCpu/src/itest_xrom_ld.vhdl
+++ /dev/null
@@ -1,413 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY xrom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in dmem_addr_t;
- dout : out dmem_data_t
- );
-
-END xrom;
-
-ARCHITECTURE loadable OF xrom IS
-
- -- JASM_ROM_INSERT_HERE
-
- -- Assembled from itest.jsm
- type xmem_rom_t is array (0 to 255) of dmem_data_t;
- signal xmem_rom : xmem_rom_t :=
- (
- X"48", -- 0x00
- X"61", -- 0x01
- X"6C", -- 0x02
- X"6C", -- 0x03
- X"6F", -- 0x04
- X"00", -- 0x05
- X"00", -- 0x06
- X"00", -- 0x07
- X"00", -- 0x08
- X"00", -- 0x09
- X"00", -- 0x0A
- X"00", -- 0x0B
- X"00", -- 0x0C
- X"00", -- 0x0D
- X"00", -- 0x0E
- X"00", -- 0x0F
- X"00", -- 0x10
- X"00", -- 0x11
- X"00", -- 0x12
- X"00", -- 0x13
- X"00", -- 0x14
- X"00", -- 0x15
- X"00", -- 0x16
- X"00", -- 0x17
- X"00", -- 0x18
- X"00", -- 0x19
- X"00", -- 0x1A
- X"00", -- 0x1B
- X"00", -- 0x1C
- X"00", -- 0x1D
- X"00", -- 0x1E
- X"00", -- 0x1F
- X"00", -- 0x20
- X"00", -- 0x21
- X"00", -- 0x22
- X"00", -- 0x23
- X"00", -- 0x24
- X"00", -- 0x25
- X"00", -- 0x26
- X"00", -- 0x27
- X"00", -- 0x28
- X"00", -- 0x29
- X"00", -- 0x2A
- X"00", -- 0x2B
- X"00", -- 0x2C
- X"00", -- 0x2D
- X"00", -- 0x2E
- X"00", -- 0x2F
- X"00", -- 0x30
- X"00", -- 0x31
- X"00", -- 0x32
- X"00", -- 0x33
- X"00", -- 0x34
- X"00", -- 0x35
- X"00", -- 0x36
- X"00", -- 0x37
- X"00", -- 0x38
- X"00", -- 0x39
- X"00", -- 0x3A
- X"00", -- 0x3B
- X"00", -- 0x3C
- X"00", -- 0x3D
- X"00", -- 0x3E
- X"00", -- 0x3F
- X"00", -- 0x40
- X"00", -- 0x41
- X"00", -- 0x42
- X"00", -- 0x43
- X"00", -- 0x44
- X"00", -- 0x45
- X"00", -- 0x46
- X"00", -- 0x47
- X"00", -- 0x48
- X"00", -- 0x49
- X"00", -- 0x4A
- X"00", -- 0x4B
- X"00", -- 0x4C
- X"00", -- 0x4D
- X"00", -- 0x4E
- X"00", -- 0x4F
- X"00", -- 0x50
- X"00", -- 0x51
- X"00", -- 0x52
- X"00", -- 0x53
- X"00", -- 0x54
- X"00", -- 0x55
- X"00", -- 0x56
- X"00", -- 0x57
- X"00", -- 0x58
- X"00", -- 0x59
- X"00", -- 0x5A
- X"00", -- 0x5B
- X"00", -- 0x5C
- X"00", -- 0x5D
- X"00", -- 0x5E
- X"00", -- 0x5F
- X"00", -- 0x60
- X"00", -- 0x61
- X"00", -- 0x62
- X"00", -- 0x63
- X"00", -- 0x64
- X"00", -- 0x65
- X"00", -- 0x66
- X"00", -- 0x67
- X"00", -- 0x68
- X"00", -- 0x69
- X"00", -- 0x6A
- X"00", -- 0x6B
- X"00", -- 0x6C
- X"00", -- 0x6D
- X"00", -- 0x6E
- X"00", -- 0x6F
- X"00", -- 0x70
- X"00", -- 0x71
- X"00", -- 0x72
- X"00", -- 0x73
- X"00", -- 0x74
- X"00", -- 0x75
- X"00", -- 0x76
- X"00", -- 0x77
- X"00", -- 0x78
- X"00", -- 0x79
- X"00", -- 0x7A
- X"00", -- 0x7B
- X"00", -- 0x7C
- X"00", -- 0x7D
- X"00", -- 0x7E
- X"00", -- 0x7F
- X"00", -- 0x80
- X"00", -- 0x81
- X"00", -- 0x82
- X"00", -- 0x83
- X"00", -- 0x84
- X"00", -- 0x85
- X"00", -- 0x86
- X"00", -- 0x87
- X"00", -- 0x88
- X"00", -- 0x89
- X"00", -- 0x8A
- X"00", -- 0x8B
- X"00", -- 0x8C
- X"00", -- 0x8D
- X"00", -- 0x8E
- X"00", -- 0x8F
- X"00", -- 0x90
- X"00", -- 0x91
- X"00", -- 0x92
- X"00", -- 0x93
- X"00", -- 0x94
- X"00", -- 0x95
- X"00", -- 0x96
- X"00", -- 0x97
- X"00", -- 0x98
- X"00", -- 0x99
- X"00", -- 0x9A
- X"00", -- 0x9B
- X"00", -- 0x9C
- X"00", -- 0x9D
- X"00", -- 0x9E
- X"00", -- 0x9F
- X"00", -- 0xA0
- X"00", -- 0xA1
- X"00", -- 0xA2
- X"00", -- 0xA3
- X"00", -- 0xA4
- X"00", -- 0xA5
- X"00", -- 0xA6
- X"00", -- 0xA7
- X"00", -- 0xA8
- X"00", -- 0xA9
- X"00", -- 0xAA
- X"00", -- 0xAB
- X"00", -- 0xAC
- X"00", -- 0xAD
- X"00", -- 0xAE
- X"00", -- 0xAF
- X"00", -- 0xB0
- X"00", -- 0xB1
- X"00", -- 0xB2
- X"00", -- 0xB3
- X"00", -- 0xB4
- X"00", -- 0xB5
- X"00", -- 0xB6
- X"00", -- 0xB7
- X"00", -- 0xB8
- X"00", -- 0xB9
- X"00", -- 0xBA
- X"00", -- 0xBB
- X"00", -- 0xBC
- X"00", -- 0xBD
- X"00", -- 0xBE
- X"00", -- 0xBF
- X"00", -- 0xC0
- X"00", -- 0xC1
- X"00", -- 0xC2
- X"00", -- 0xC3
- X"00", -- 0xC4
- X"00", -- 0xC5
- X"00", -- 0xC6
- X"00", -- 0xC7
- X"00", -- 0xC8
- X"00", -- 0xC9
- X"00", -- 0xCA
- X"00", -- 0xCB
- X"00", -- 0xCC
- X"00", -- 0xCD
- X"00", -- 0xCE
- X"00", -- 0xCF
- X"00", -- 0xD0
- X"00", -- 0xD1
- X"00", -- 0xD2
- X"00", -- 0xD3
- X"00", -- 0xD4
- X"00", -- 0xD5
- X"00", -- 0xD6
- X"00", -- 0xD7
- X"00", -- 0xD8
- X"00", -- 0xD9
- X"00", -- 0xDA
- X"00", -- 0xDB
- X"00", -- 0xDC
- X"00", -- 0xDD
- X"00", -- 0xDE
- X"00", -- 0xDF
- X"00", -- 0xE0
- X"00", -- 0xE1
- X"00", -- 0xE2
- X"00", -- 0xE3
- X"00", -- 0xE4
- X"00", -- 0xE5
- X"00", -- 0xE6
- X"00", -- 0xE7
- X"00", -- 0xE8
- X"00", -- 0xE9
- X"00", -- 0xEA
- X"00", -- 0xEB
- X"00", -- 0xEC
- X"00", -- 0xED
- X"00", -- 0xEE
- X"00", -- 0xEF
- X"00", -- 0xF0
- X"00", -- 0xF1
- X"00", -- 0xF2
- X"00", -- 0xF3
- X"00", -- 0xF4
- X"00", -- 0xF5
- X"00", -- 0xF6
- X"00", -- 0xF7
- X"00", -- 0xF8
- X"00", -- 0xF9
- X"00", -- 0xFA
- X"00", -- 0xFB
- X"00", -- 0xFC
- X"00", -- 0xFD
- X"00", -- 0xFE
- X"00" -- 0xFF
- );
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : dmem_addr_t;
- signal jtag_ld_dout : dmem_data_t;
- signal jtag_ld_din : dmem_data_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (15 downto 0);
- constant id : unsigned (15 downto 0) := X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
- jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= xmem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/JCpu/src/mul8x8_irom.vhdl b/lib/CPUs/JCpu/src/mul8x8_irom.vhdl
deleted file mode 100644
index 3b0de3b..0000000
--- a/lib/CPUs/JCpu/src/mul8x8_irom.vhdl
+++ /dev/null
@@ -1,88 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-ENTITY irom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
-END irom;
-
-ARCHITECTURE mul8x8 OF irom IS
-
- type imem_rom_t is array (0 to 26) of inst_t;
-
- -- Assembled from mul8x8.jsm
- constant imem_rom : imem_rom_t :=
- (
- "110000" & X"001", -- 0x000: JMP 0x001
- "000011" & X"450", -- 0x001: MOV R00, 0x45
- "000011" & X"F51", -- 0x002: MOV R01, 0xF5
- "111011" & X"005", -- 0x003: CALL 0x005
- "110000" & X"004", -- 0x004: JMP 0x004
- "111100" & X"002", -- 0x005: PUSH R02
- "111100" & X"003", -- 0x006: PUSH R03
- "111100" & X"004", -- 0x007: PUSH R04
- "000010" & X"014", -- 0x008: MOV R04, R01
- "000011" & X"001", -- 0x009: MOV R01, 0x00
- "000011" & X"002", -- 0x00A: MOV R02, 0x00
- "000011" & X"003", -- 0x00B: MOV R03, 0x00
- "001111" & X"014", -- 0x00C: CMP R04, 0x01
- "111001" & X"015", -- 0x00D: JEQ 0x015
- "011111" & X"004", -- 0x00E: SHR R04
- "110100" & X"012", -- 0x00F: JNC 0x012
- "010000" & X"002", -- 0x010: ADD R02, R00
- "010010" & X"013", -- 0x011: ADDC R03, R01
- "011110" & X"000", -- 0x012: SHL R00
- "100010" & X"001", -- 0x013: ROLC R01
- "110000" & X"00C", -- 0x014: JMP 0x00C
- "010000" & X"020", -- 0x015: ADD R00, R02
- "010010" & X"031", -- 0x016: ADDC R01, R03
- "111101" & X"004", -- 0x017: POP R04
- "111101" & X"003", -- 0x018: POP R03
- "111101" & X"002", -- 0x019: POP R02
- "111110" & X"000" -- 0x01A: RET
- );
-
-begin
-
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= imem_rom(to_integer(addr));
- end if;
- end process;
-
-end mul8x8;
-
diff --git a/lib/CPUs/JCpu/src/mul8x8_irom_ld.vhdl b/lib/CPUs/JCpu/src/mul8x8_irom_ld.vhdl
deleted file mode 100644
index 4303d08..0000000
--- a/lib/CPUs/JCpu/src/mul8x8_irom_ld.vhdl
+++ /dev/null
@@ -1,1181 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY irom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
-
-END irom;
-
-ARCHITECTURE loadable OF irom IS
-
- -- JASM_ROM_INSERT_HERE
-
- -- Assembled from mul8x8.jsm
- type imem_rom_t is array (0 to 1023) of inst_t;
- signal imem_rom : imem_rom_t :=
- (
- "110000" & X"001", -- 0x000: JMP 0x001
- "000011" & X"450", -- 0x001: MOV R00, 0x45
- "000011" & X"F51", -- 0x002: MOV R01, 0xF5
- "111011" & X"005", -- 0x003: CALL 0x005
- "110000" & X"004", -- 0x004: JMP 0x004
- "111100" & X"002", -- 0x005: PUSH R02
- "111100" & X"003", -- 0x006: PUSH R03
- "111100" & X"004", -- 0x007: PUSH R04
- "000010" & X"014", -- 0x008: MOV R04, R01
- "000011" & X"001", -- 0x009: MOV R01, 0x00
- "000011" & X"002", -- 0x00A: MOV R02, 0x00
- "000011" & X"003", -- 0x00B: MOV R03, 0x00
- "001111" & X"014", -- 0x00C: CMP R04, 0x01
- "111001" & X"015", -- 0x00D: JEQ 0x015
- "011111" & X"004", -- 0x00E: SHR R04
- "110100" & X"012", -- 0x00F: JNC 0x012
- "010000" & X"002", -- 0x010: ADD R02, R00
- "010010" & X"013", -- 0x011: ADDC R03, R01
- "011110" & X"000", -- 0x012: SHL R00
- "100010" & X"001", -- 0x013: ROLC R01
- "110000" & X"00C", -- 0x014: JMP 0x00C
- "010000" & X"020", -- 0x015: ADD R00, R02
- "010010" & X"031", -- 0x016: ADDC R01, R03
- "111101" & X"004", -- 0x017: POP R04
- "111101" & X"003", -- 0x018: POP R03
- "111101" & X"002", -- 0x019: POP R02
- "111110" & X"000", -- 0x01A: RET
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000"
- );
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : inst_addr_t;
- signal jtag_ld_dout : inst_t;
- signal jtag_ld_din : inst_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (31 downto 0);
- constant id : unsigned (31 downto 0) := X"BABE" & X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst1 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 1 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-inst_addr_t'length+1);
- jtag_ld_din <= user_regi(inst_t'length-1 downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto inst_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= imem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- imem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= imem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/JCpu/src/mul8x8_xrom.vhdl b/lib/CPUs/JCpu/src/mul8x8_xrom.vhdl
deleted file mode 100644
index 508e8cf..0000000
--- a/lib/CPUs/JCpu/src/mul8x8_xrom.vhdl
+++ /dev/null
@@ -1,317 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-ENTITY xrom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in dmem_addr_t;
- dout : out dmem_data_t
- );
-END xrom;
-
-ARCHITECTURE mul8x8 OF xrom IS
-
- type xmem_rom_t is array (0 to 255) of dmem_data_t;
-
- -- Assembled from mul8x8.jsm
- constant xmem_rom : xmem_rom_t :=
- (
- X"00", -- 0x00
- X"00", -- 0x01
- X"00", -- 0x02
- X"00", -- 0x03
- X"00", -- 0x04
- X"00", -- 0x05
- X"00", -- 0x06
- X"00", -- 0x07
- X"00", -- 0x08
- X"00", -- 0x09
- X"00", -- 0x0A
- X"00", -- 0x0B
- X"00", -- 0x0C
- X"00", -- 0x0D
- X"00", -- 0x0E
- X"00", -- 0x0F
- X"00", -- 0x10
- X"00", -- 0x11
- X"00", -- 0x12
- X"00", -- 0x13
- X"00", -- 0x14
- X"00", -- 0x15
- X"00", -- 0x16
- X"00", -- 0x17
- X"00", -- 0x18
- X"00", -- 0x19
- X"00", -- 0x1A
- X"00", -- 0x1B
- X"00", -- 0x1C
- X"00", -- 0x1D
- X"00", -- 0x1E
- X"00", -- 0x1F
- X"00", -- 0x20
- X"00", -- 0x21
- X"00", -- 0x22
- X"00", -- 0x23
- X"00", -- 0x24
- X"00", -- 0x25
- X"00", -- 0x26
- X"00", -- 0x27
- X"00", -- 0x28
- X"00", -- 0x29
- X"00", -- 0x2A
- X"00", -- 0x2B
- X"00", -- 0x2C
- X"00", -- 0x2D
- X"00", -- 0x2E
- X"00", -- 0x2F
- X"00", -- 0x30
- X"00", -- 0x31
- X"00", -- 0x32
- X"00", -- 0x33
- X"00", -- 0x34
- X"00", -- 0x35
- X"00", -- 0x36
- X"00", -- 0x37
- X"00", -- 0x38
- X"00", -- 0x39
- X"00", -- 0x3A
- X"00", -- 0x3B
- X"00", -- 0x3C
- X"00", -- 0x3D
- X"00", -- 0x3E
- X"00", -- 0x3F
- X"00", -- 0x40
- X"00", -- 0x41
- X"00", -- 0x42
- X"00", -- 0x43
- X"00", -- 0x44
- X"00", -- 0x45
- X"00", -- 0x46
- X"00", -- 0x47
- X"00", -- 0x48
- X"00", -- 0x49
- X"00", -- 0x4A
- X"00", -- 0x4B
- X"00", -- 0x4C
- X"00", -- 0x4D
- X"00", -- 0x4E
- X"00", -- 0x4F
- X"00", -- 0x50
- X"00", -- 0x51
- X"00", -- 0x52
- X"00", -- 0x53
- X"00", -- 0x54
- X"00", -- 0x55
- X"00", -- 0x56
- X"00", -- 0x57
- X"00", -- 0x58
- X"00", -- 0x59
- X"00", -- 0x5A
- X"00", -- 0x5B
- X"00", -- 0x5C
- X"00", -- 0x5D
- X"00", -- 0x5E
- X"00", -- 0x5F
- X"00", -- 0x60
- X"00", -- 0x61
- X"00", -- 0x62
- X"00", -- 0x63
- X"00", -- 0x64
- X"00", -- 0x65
- X"00", -- 0x66
- X"00", -- 0x67
- X"00", -- 0x68
- X"00", -- 0x69
- X"00", -- 0x6A
- X"00", -- 0x6B
- X"00", -- 0x6C
- X"00", -- 0x6D
- X"00", -- 0x6E
- X"00", -- 0x6F
- X"00", -- 0x70
- X"00", -- 0x71
- X"00", -- 0x72
- X"00", -- 0x73
- X"00", -- 0x74
- X"00", -- 0x75
- X"00", -- 0x76
- X"00", -- 0x77
- X"00", -- 0x78
- X"00", -- 0x79
- X"00", -- 0x7A
- X"00", -- 0x7B
- X"00", -- 0x7C
- X"00", -- 0x7D
- X"00", -- 0x7E
- X"00", -- 0x7F
- X"00", -- 0x80
- X"00", -- 0x81
- X"00", -- 0x82
- X"00", -- 0x83
- X"00", -- 0x84
- X"00", -- 0x85
- X"00", -- 0x86
- X"00", -- 0x87
- X"00", -- 0x88
- X"00", -- 0x89
- X"00", -- 0x8A
- X"00", -- 0x8B
- X"00", -- 0x8C
- X"00", -- 0x8D
- X"00", -- 0x8E
- X"00", -- 0x8F
- X"00", -- 0x90
- X"00", -- 0x91
- X"00", -- 0x92
- X"00", -- 0x93
- X"00", -- 0x94
- X"00", -- 0x95
- X"00", -- 0x96
- X"00", -- 0x97
- X"00", -- 0x98
- X"00", -- 0x99
- X"00", -- 0x9A
- X"00", -- 0x9B
- X"00", -- 0x9C
- X"00", -- 0x9D
- X"00", -- 0x9E
- X"00", -- 0x9F
- X"00", -- 0xA0
- X"00", -- 0xA1
- X"00", -- 0xA2
- X"00", -- 0xA3
- X"00", -- 0xA4
- X"00", -- 0xA5
- X"00", -- 0xA6
- X"00", -- 0xA7
- X"00", -- 0xA8
- X"00", -- 0xA9
- X"00", -- 0xAA
- X"00", -- 0xAB
- X"00", -- 0xAC
- X"00", -- 0xAD
- X"00", -- 0xAE
- X"00", -- 0xAF
- X"00", -- 0xB0
- X"00", -- 0xB1
- X"00", -- 0xB2
- X"00", -- 0xB3
- X"00", -- 0xB4
- X"00", -- 0xB5
- X"00", -- 0xB6
- X"00", -- 0xB7
- X"00", -- 0xB8
- X"00", -- 0xB9
- X"00", -- 0xBA
- X"00", -- 0xBB
- X"00", -- 0xBC
- X"00", -- 0xBD
- X"00", -- 0xBE
- X"00", -- 0xBF
- X"00", -- 0xC0
- X"00", -- 0xC1
- X"00", -- 0xC2
- X"00", -- 0xC3
- X"00", -- 0xC4
- X"00", -- 0xC5
- X"00", -- 0xC6
- X"00", -- 0xC7
- X"00", -- 0xC8
- X"00", -- 0xC9
- X"00", -- 0xCA
- X"00", -- 0xCB
- X"00", -- 0xCC
- X"00", -- 0xCD
- X"00", -- 0xCE
- X"00", -- 0xCF
- X"00", -- 0xD0
- X"00", -- 0xD1
- X"00", -- 0xD2
- X"00", -- 0xD3
- X"00", -- 0xD4
- X"00", -- 0xD5
- X"00", -- 0xD6
- X"00", -- 0xD7
- X"00", -- 0xD8
- X"00", -- 0xD9
- X"00", -- 0xDA
- X"00", -- 0xDB
- X"00", -- 0xDC
- X"00", -- 0xDD
- X"00", -- 0xDE
- X"00", -- 0xDF
- X"00", -- 0xE0
- X"00", -- 0xE1
- X"00", -- 0xE2
- X"00", -- 0xE3
- X"00", -- 0xE4
- X"00", -- 0xE5
- X"00", -- 0xE6
- X"00", -- 0xE7
- X"00", -- 0xE8
- X"00", -- 0xE9
- X"00", -- 0xEA
- X"00", -- 0xEB
- X"00", -- 0xEC
- X"00", -- 0xED
- X"00", -- 0xEE
- X"00", -- 0xEF
- X"00", -- 0xF0
- X"00", -- 0xF1
- X"00", -- 0xF2
- X"00", -- 0xF3
- X"00", -- 0xF4
- X"00", -- 0xF5
- X"00", -- 0xF6
- X"00", -- 0xF7
- X"00", -- 0xF8
- X"00", -- 0xF9
- X"00", -- 0xFA
- X"00", -- 0xFB
- X"00", -- 0xFC
- X"00", -- 0xFD
- X"00", -- 0xFE
- X"00" -- 0xFF
- );
-
-begin
-
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= xmem_rom(to_integer(addr));
- end if;
- end process;
-
-end mul8x8;
-
diff --git a/lib/CPUs/JCpu/src/mul8x8_xrom_ld.vhdl b/lib/CPUs/JCpu/src/mul8x8_xrom_ld.vhdl
deleted file mode 100644
index a75d090..0000000
--- a/lib/CPUs/JCpu/src/mul8x8_xrom_ld.vhdl
+++ /dev/null
@@ -1,413 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY xrom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in dmem_addr_t;
- dout : out dmem_data_t
- );
-
-END xrom;
-
-ARCHITECTURE loadable OF xrom IS
-
- -- JASM_ROM_INSERT_HERE
-
- -- Assembled from mul8x8.jsm
- type xmem_rom_t is array (0 to 255) of dmem_data_t;
- signal xmem_rom : xmem_rom_t :=
- (
- X"00", -- 0x00
- X"00", -- 0x01
- X"00", -- 0x02
- X"00", -- 0x03
- X"00", -- 0x04
- X"00", -- 0x05
- X"00", -- 0x06
- X"00", -- 0x07
- X"00", -- 0x08
- X"00", -- 0x09
- X"00", -- 0x0A
- X"00", -- 0x0B
- X"00", -- 0x0C
- X"00", -- 0x0D
- X"00", -- 0x0E
- X"00", -- 0x0F
- X"00", -- 0x10
- X"00", -- 0x11
- X"00", -- 0x12
- X"00", -- 0x13
- X"00", -- 0x14
- X"00", -- 0x15
- X"00", -- 0x16
- X"00", -- 0x17
- X"00", -- 0x18
- X"00", -- 0x19
- X"00", -- 0x1A
- X"00", -- 0x1B
- X"00", -- 0x1C
- X"00", -- 0x1D
- X"00", -- 0x1E
- X"00", -- 0x1F
- X"00", -- 0x20
- X"00", -- 0x21
- X"00", -- 0x22
- X"00", -- 0x23
- X"00", -- 0x24
- X"00", -- 0x25
- X"00", -- 0x26
- X"00", -- 0x27
- X"00", -- 0x28
- X"00", -- 0x29
- X"00", -- 0x2A
- X"00", -- 0x2B
- X"00", -- 0x2C
- X"00", -- 0x2D
- X"00", -- 0x2E
- X"00", -- 0x2F
- X"00", -- 0x30
- X"00", -- 0x31
- X"00", -- 0x32
- X"00", -- 0x33
- X"00", -- 0x34
- X"00", -- 0x35
- X"00", -- 0x36
- X"00", -- 0x37
- X"00", -- 0x38
- X"00", -- 0x39
- X"00", -- 0x3A
- X"00", -- 0x3B
- X"00", -- 0x3C
- X"00", -- 0x3D
- X"00", -- 0x3E
- X"00", -- 0x3F
- X"00", -- 0x40
- X"00", -- 0x41
- X"00", -- 0x42
- X"00", -- 0x43
- X"00", -- 0x44
- X"00", -- 0x45
- X"00", -- 0x46
- X"00", -- 0x47
- X"00", -- 0x48
- X"00", -- 0x49
- X"00", -- 0x4A
- X"00", -- 0x4B
- X"00", -- 0x4C
- X"00", -- 0x4D
- X"00", -- 0x4E
- X"00", -- 0x4F
- X"00", -- 0x50
- X"00", -- 0x51
- X"00", -- 0x52
- X"00", -- 0x53
- X"00", -- 0x54
- X"00", -- 0x55
- X"00", -- 0x56
- X"00", -- 0x57
- X"00", -- 0x58
- X"00", -- 0x59
- X"00", -- 0x5A
- X"00", -- 0x5B
- X"00", -- 0x5C
- X"00", -- 0x5D
- X"00", -- 0x5E
- X"00", -- 0x5F
- X"00", -- 0x60
- X"00", -- 0x61
- X"00", -- 0x62
- X"00", -- 0x63
- X"00", -- 0x64
- X"00", -- 0x65
- X"00", -- 0x66
- X"00", -- 0x67
- X"00", -- 0x68
- X"00", -- 0x69
- X"00", -- 0x6A
- X"00", -- 0x6B
- X"00", -- 0x6C
- X"00", -- 0x6D
- X"00", -- 0x6E
- X"00", -- 0x6F
- X"00", -- 0x70
- X"00", -- 0x71
- X"00", -- 0x72
- X"00", -- 0x73
- X"00", -- 0x74
- X"00", -- 0x75
- X"00", -- 0x76
- X"00", -- 0x77
- X"00", -- 0x78
- X"00", -- 0x79
- X"00", -- 0x7A
- X"00", -- 0x7B
- X"00", -- 0x7C
- X"00", -- 0x7D
- X"00", -- 0x7E
- X"00", -- 0x7F
- X"00", -- 0x80
- X"00", -- 0x81
- X"00", -- 0x82
- X"00", -- 0x83
- X"00", -- 0x84
- X"00", -- 0x85
- X"00", -- 0x86
- X"00", -- 0x87
- X"00", -- 0x88
- X"00", -- 0x89
- X"00", -- 0x8A
- X"00", -- 0x8B
- X"00", -- 0x8C
- X"00", -- 0x8D
- X"00", -- 0x8E
- X"00", -- 0x8F
- X"00", -- 0x90
- X"00", -- 0x91
- X"00", -- 0x92
- X"00", -- 0x93
- X"00", -- 0x94
- X"00", -- 0x95
- X"00", -- 0x96
- X"00", -- 0x97
- X"00", -- 0x98
- X"00", -- 0x99
- X"00", -- 0x9A
- X"00", -- 0x9B
- X"00", -- 0x9C
- X"00", -- 0x9D
- X"00", -- 0x9E
- X"00", -- 0x9F
- X"00", -- 0xA0
- X"00", -- 0xA1
- X"00", -- 0xA2
- X"00", -- 0xA3
- X"00", -- 0xA4
- X"00", -- 0xA5
- X"00", -- 0xA6
- X"00", -- 0xA7
- X"00", -- 0xA8
- X"00", -- 0xA9
- X"00", -- 0xAA
- X"00", -- 0xAB
- X"00", -- 0xAC
- X"00", -- 0xAD
- X"00", -- 0xAE
- X"00", -- 0xAF
- X"00", -- 0xB0
- X"00", -- 0xB1
- X"00", -- 0xB2
- X"00", -- 0xB3
- X"00", -- 0xB4
- X"00", -- 0xB5
- X"00", -- 0xB6
- X"00", -- 0xB7
- X"00", -- 0xB8
- X"00", -- 0xB9
- X"00", -- 0xBA
- X"00", -- 0xBB
- X"00", -- 0xBC
- X"00", -- 0xBD
- X"00", -- 0xBE
- X"00", -- 0xBF
- X"00", -- 0xC0
- X"00", -- 0xC1
- X"00", -- 0xC2
- X"00", -- 0xC3
- X"00", -- 0xC4
- X"00", -- 0xC5
- X"00", -- 0xC6
- X"00", -- 0xC7
- X"00", -- 0xC8
- X"00", -- 0xC9
- X"00", -- 0xCA
- X"00", -- 0xCB
- X"00", -- 0xCC
- X"00", -- 0xCD
- X"00", -- 0xCE
- X"00", -- 0xCF
- X"00", -- 0xD0
- X"00", -- 0xD1
- X"00", -- 0xD2
- X"00", -- 0xD3
- X"00", -- 0xD4
- X"00", -- 0xD5
- X"00", -- 0xD6
- X"00", -- 0xD7
- X"00", -- 0xD8
- X"00", -- 0xD9
- X"00", -- 0xDA
- X"00", -- 0xDB
- X"00", -- 0xDC
- X"00", -- 0xDD
- X"00", -- 0xDE
- X"00", -- 0xDF
- X"00", -- 0xE0
- X"00", -- 0xE1
- X"00", -- 0xE2
- X"00", -- 0xE3
- X"00", -- 0xE4
- X"00", -- 0xE5
- X"00", -- 0xE6
- X"00", -- 0xE7
- X"00", -- 0xE8
- X"00", -- 0xE9
- X"00", -- 0xEA
- X"00", -- 0xEB
- X"00", -- 0xEC
- X"00", -- 0xED
- X"00", -- 0xEE
- X"00", -- 0xEF
- X"00", -- 0xF0
- X"00", -- 0xF1
- X"00", -- 0xF2
- X"00", -- 0xF3
- X"00", -- 0xF4
- X"00", -- 0xF5
- X"00", -- 0xF6
- X"00", -- 0xF7
- X"00", -- 0xF8
- X"00", -- 0xF9
- X"00", -- 0xFA
- X"00", -- 0xFB
- X"00", -- 0xFC
- X"00", -- 0xFD
- X"00", -- 0xFE
- X"00" -- 0xFF
- );
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : dmem_addr_t;
- signal jtag_ld_dout : dmem_data_t;
- signal jtag_ld_din : dmem_data_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (15 downto 0);
- constant id : unsigned (15 downto 0) := X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
- jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= xmem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/JCpu/src/reti_issue_irom.vhdl b/lib/CPUs/JCpu/src/reti_issue_irom.vhdl
deleted file mode 100644
index 9355a7d..0000000
--- a/lib/CPUs/JCpu/src/reti_issue_irom.vhdl
+++ /dev/null
@@ -1,89 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-ENTITY irom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
-END irom;
-
-ARCHITECTURE reti_issue OF irom IS
-
- type imem_rom_t is array (0 to 27) of inst_t;
-
- -- Assembled from reti_issue.jsm
- constant imem_rom : imem_rom_t :=
- (
- "110000" & X"002", -- 0x000: JMP 0x002
- "111111" & X"000", -- 0x001: RETI
- "000011" & X"050", -- 0x002: MOV R00, 0x05
- "100110" & X"030", -- 0x003: COUT (0x03), R00
- "000011" & X"000", -- 0x004: MOV R00, 0x00
- "000000" & X"000", -- 0x005: NOP
- "010001" & X"010", -- 0x006: INC R00
- "000000" & X"000", -- 0x007: NOP
- "111011" & X"01B", -- 0x008: CALL 0x01B
- "000000" & X"000", -- 0x009: NOP
- "111100" & X"003", -- 0x00A: PUSH R03
- "000000" & X"000", -- 0x00B: NOP
- "111100" & X"002", -- 0x00C: PUSH R02
- "000000" & X"000", -- 0x00D: NOP
- "111100" & X"001", -- 0x00E: PUSH R01
- "000000" & X"000", -- 0x00F: NOP
- "111100" & X"000", -- 0x010: PUSH R00
- "000000" & X"000", -- 0x011: NOP
- "111101" & X"000", -- 0x012: POP R00
- "000000" & X"000", -- 0x013: NOP
- "111101" & X"001", -- 0x014: POP R01
- "000000" & X"000", -- 0x015: NOP
- "111101" & X"002", -- 0x016: POP R02
- "000000" & X"000", -- 0x017: NOP
- "111101" & X"003", -- 0x018: POP R03
- "000000" & X"000", -- 0x019: NOP
- "110000" & X"005", -- 0x01A: JMP 0x005
- "111110" & X"000" -- 0x01B: RET
- );
-
-begin
-
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= imem_rom(to_integer(addr));
- end if;
- end process;
-
-end reti_issue;
-
diff --git a/lib/CPUs/JCpu/src/reti_issue_irom_ld.vhdl b/lib/CPUs/JCpu/src/reti_issue_irom_ld.vhdl
deleted file mode 100644
index d1b4bd1..0000000
--- a/lib/CPUs/JCpu/src/reti_issue_irom_ld.vhdl
+++ /dev/null
@@ -1,1181 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY irom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
-
-END irom;
-
-ARCHITECTURE loadable OF irom IS
-
- -- JASM_ROM_INSERT_HERE
-
- -- Assembled from reti_issue.jsm
- type imem_rom_t is array (0 to 1023) of inst_t;
- signal imem_rom : imem_rom_t :=
- (
- "110000" & X"002", -- 0x000: JMP 0x002
- "111111" & X"000", -- 0x001: RETI
- "000011" & X"050", -- 0x002: MOV R00, 0x05
- "100110" & X"030", -- 0x003: COUT (0x03), R00
- "000011" & X"000", -- 0x004: MOV R00, 0x00
- "000000" & X"000", -- 0x005: NOP
- "010001" & X"010", -- 0x006: INC R00
- "000000" & X"000", -- 0x007: NOP
- "111011" & X"01B", -- 0x008: CALL 0x01B
- "000000" & X"000", -- 0x009: NOP
- "111100" & X"003", -- 0x00A: PUSH R03
- "000000" & X"000", -- 0x00B: NOP
- "111100" & X"002", -- 0x00C: PUSH R02
- "000000" & X"000", -- 0x00D: NOP
- "111100" & X"001", -- 0x00E: PUSH R01
- "000000" & X"000", -- 0x00F: NOP
- "111100" & X"000", -- 0x010: PUSH R00
- "000000" & X"000", -- 0x011: NOP
- "111101" & X"000", -- 0x012: POP R00
- "000000" & X"000", -- 0x013: NOP
- "111101" & X"001", -- 0x014: POP R01
- "000000" & X"000", -- 0x015: NOP
- "111101" & X"002", -- 0x016: POP R02
- "000000" & X"000", -- 0x017: NOP
- "111101" & X"003", -- 0x018: POP R03
- "000000" & X"000", -- 0x019: NOP
- "110000" & X"005", -- 0x01A: JMP 0x005
- "111110" & X"000", -- 0x01B: RET
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000",
- "000000" & X"000"
- );
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : inst_addr_t;
- signal jtag_ld_dout : inst_t;
- signal jtag_ld_din : inst_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (31 downto 0);
- constant id : unsigned (31 downto 0) := X"BABE" & X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst1 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 1 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-inst_addr_t'length+1);
- jtag_ld_din <= user_regi(inst_t'length-1 downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto inst_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= imem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- imem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= imem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/JCpu/src/reti_issue_xrom.vhdl b/lib/CPUs/JCpu/src/reti_issue_xrom.vhdl
deleted file mode 100644
index a7a33f9..0000000
--- a/lib/CPUs/JCpu/src/reti_issue_xrom.vhdl
+++ /dev/null
@@ -1,317 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-ENTITY xrom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in dmem_addr_t;
- dout : out dmem_data_t
- );
-END xrom;
-
-ARCHITECTURE reti_issue OF xrom IS
-
- type xmem_rom_t is array (0 to 255) of dmem_data_t;
-
- -- Assembled from reti_issue.jsm
- constant xmem_rom : xmem_rom_t :=
- (
- X"00", -- 0x00
- X"00", -- 0x01
- X"00", -- 0x02
- X"00", -- 0x03
- X"00", -- 0x04
- X"00", -- 0x05
- X"00", -- 0x06
- X"00", -- 0x07
- X"00", -- 0x08
- X"00", -- 0x09
- X"00", -- 0x0A
- X"00", -- 0x0B
- X"00", -- 0x0C
- X"00", -- 0x0D
- X"00", -- 0x0E
- X"00", -- 0x0F
- X"00", -- 0x10
- X"00", -- 0x11
- X"00", -- 0x12
- X"00", -- 0x13
- X"00", -- 0x14
- X"00", -- 0x15
- X"00", -- 0x16
- X"00", -- 0x17
- X"00", -- 0x18
- X"00", -- 0x19
- X"00", -- 0x1A
- X"00", -- 0x1B
- X"00", -- 0x1C
- X"00", -- 0x1D
- X"00", -- 0x1E
- X"00", -- 0x1F
- X"00", -- 0x20
- X"00", -- 0x21
- X"00", -- 0x22
- X"00", -- 0x23
- X"00", -- 0x24
- X"00", -- 0x25
- X"00", -- 0x26
- X"00", -- 0x27
- X"00", -- 0x28
- X"00", -- 0x29
- X"00", -- 0x2A
- X"00", -- 0x2B
- X"00", -- 0x2C
- X"00", -- 0x2D
- X"00", -- 0x2E
- X"00", -- 0x2F
- X"00", -- 0x30
- X"00", -- 0x31
- X"00", -- 0x32
- X"00", -- 0x33
- X"00", -- 0x34
- X"00", -- 0x35
- X"00", -- 0x36
- X"00", -- 0x37
- X"00", -- 0x38
- X"00", -- 0x39
- X"00", -- 0x3A
- X"00", -- 0x3B
- X"00", -- 0x3C
- X"00", -- 0x3D
- X"00", -- 0x3E
- X"00", -- 0x3F
- X"00", -- 0x40
- X"00", -- 0x41
- X"00", -- 0x42
- X"00", -- 0x43
- X"00", -- 0x44
- X"00", -- 0x45
- X"00", -- 0x46
- X"00", -- 0x47
- X"00", -- 0x48
- X"00", -- 0x49
- X"00", -- 0x4A
- X"00", -- 0x4B
- X"00", -- 0x4C
- X"00", -- 0x4D
- X"00", -- 0x4E
- X"00", -- 0x4F
- X"00", -- 0x50
- X"00", -- 0x51
- X"00", -- 0x52
- X"00", -- 0x53
- X"00", -- 0x54
- X"00", -- 0x55
- X"00", -- 0x56
- X"00", -- 0x57
- X"00", -- 0x58
- X"00", -- 0x59
- X"00", -- 0x5A
- X"00", -- 0x5B
- X"00", -- 0x5C
- X"00", -- 0x5D
- X"00", -- 0x5E
- X"00", -- 0x5F
- X"00", -- 0x60
- X"00", -- 0x61
- X"00", -- 0x62
- X"00", -- 0x63
- X"00", -- 0x64
- X"00", -- 0x65
- X"00", -- 0x66
- X"00", -- 0x67
- X"00", -- 0x68
- X"00", -- 0x69
- X"00", -- 0x6A
- X"00", -- 0x6B
- X"00", -- 0x6C
- X"00", -- 0x6D
- X"00", -- 0x6E
- X"00", -- 0x6F
- X"00", -- 0x70
- X"00", -- 0x71
- X"00", -- 0x72
- X"00", -- 0x73
- X"00", -- 0x74
- X"00", -- 0x75
- X"00", -- 0x76
- X"00", -- 0x77
- X"00", -- 0x78
- X"00", -- 0x79
- X"00", -- 0x7A
- X"00", -- 0x7B
- X"00", -- 0x7C
- X"00", -- 0x7D
- X"00", -- 0x7E
- X"00", -- 0x7F
- X"00", -- 0x80
- X"00", -- 0x81
- X"00", -- 0x82
- X"00", -- 0x83
- X"00", -- 0x84
- X"00", -- 0x85
- X"00", -- 0x86
- X"00", -- 0x87
- X"00", -- 0x88
- X"00", -- 0x89
- X"00", -- 0x8A
- X"00", -- 0x8B
- X"00", -- 0x8C
- X"00", -- 0x8D
- X"00", -- 0x8E
- X"00", -- 0x8F
- X"00", -- 0x90
- X"00", -- 0x91
- X"00", -- 0x92
- X"00", -- 0x93
- X"00", -- 0x94
- X"00", -- 0x95
- X"00", -- 0x96
- X"00", -- 0x97
- X"00", -- 0x98
- X"00", -- 0x99
- X"00", -- 0x9A
- X"00", -- 0x9B
- X"00", -- 0x9C
- X"00", -- 0x9D
- X"00", -- 0x9E
- X"00", -- 0x9F
- X"00", -- 0xA0
- X"00", -- 0xA1
- X"00", -- 0xA2
- X"00", -- 0xA3
- X"00", -- 0xA4
- X"00", -- 0xA5
- X"00", -- 0xA6
- X"00", -- 0xA7
- X"00", -- 0xA8
- X"00", -- 0xA9
- X"00", -- 0xAA
- X"00", -- 0xAB
- X"00", -- 0xAC
- X"00", -- 0xAD
- X"00", -- 0xAE
- X"00", -- 0xAF
- X"00", -- 0xB0
- X"00", -- 0xB1
- X"00", -- 0xB2
- X"00", -- 0xB3
- X"00", -- 0xB4
- X"00", -- 0xB5
- X"00", -- 0xB6
- X"00", -- 0xB7
- X"00", -- 0xB8
- X"00", -- 0xB9
- X"00", -- 0xBA
- X"00", -- 0xBB
- X"00", -- 0xBC
- X"00", -- 0xBD
- X"00", -- 0xBE
- X"00", -- 0xBF
- X"00", -- 0xC0
- X"00", -- 0xC1
- X"00", -- 0xC2
- X"00", -- 0xC3
- X"00", -- 0xC4
- X"00", -- 0xC5
- X"00", -- 0xC6
- X"00", -- 0xC7
- X"00", -- 0xC8
- X"00", -- 0xC9
- X"00", -- 0xCA
- X"00", -- 0xCB
- X"00", -- 0xCC
- X"00", -- 0xCD
- X"00", -- 0xCE
- X"00", -- 0xCF
- X"00", -- 0xD0
- X"00", -- 0xD1
- X"00", -- 0xD2
- X"00", -- 0xD3
- X"00", -- 0xD4
- X"00", -- 0xD5
- X"00", -- 0xD6
- X"00", -- 0xD7
- X"00", -- 0xD8
- X"00", -- 0xD9
- X"00", -- 0xDA
- X"00", -- 0xDB
- X"00", -- 0xDC
- X"00", -- 0xDD
- X"00", -- 0xDE
- X"00", -- 0xDF
- X"00", -- 0xE0
- X"00", -- 0xE1
- X"00", -- 0xE2
- X"00", -- 0xE3
- X"00", -- 0xE4
- X"00", -- 0xE5
- X"00", -- 0xE6
- X"00", -- 0xE7
- X"00", -- 0xE8
- X"00", -- 0xE9
- X"00", -- 0xEA
- X"00", -- 0xEB
- X"00", -- 0xEC
- X"00", -- 0xED
- X"00", -- 0xEE
- X"00", -- 0xEF
- X"00", -- 0xF0
- X"00", -- 0xF1
- X"00", -- 0xF2
- X"00", -- 0xF3
- X"00", -- 0xF4
- X"00", -- 0xF5
- X"00", -- 0xF6
- X"00", -- 0xF7
- X"00", -- 0xF8
- X"00", -- 0xF9
- X"00", -- 0xFA
- X"00", -- 0xFB
- X"00", -- 0xFC
- X"00", -- 0xFD
- X"00", -- 0xFE
- X"00" -- 0xFF
- );
-
-begin
-
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= xmem_rom(to_integer(addr));
- end if;
- end process;
-
-end reti_issue;
-
diff --git a/lib/CPUs/JCpu/src/reti_issue_xrom_ld.vhdl b/lib/CPUs/JCpu/src/reti_issue_xrom_ld.vhdl
deleted file mode 100644
index 244c1b5..0000000
--- a/lib/CPUs/JCpu/src/reti_issue_xrom_ld.vhdl
+++ /dev/null
@@ -1,413 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY xrom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in dmem_addr_t;
- dout : out dmem_data_t
- );
-
-END xrom;
-
-ARCHITECTURE loadable OF xrom IS
-
- -- JASM_ROM_INSERT_HERE
-
- -- Assembled from reti_issue.jsm
- type xmem_rom_t is array (0 to 255) of dmem_data_t;
- signal xmem_rom : xmem_rom_t :=
- (
- X"00", -- 0x00
- X"00", -- 0x01
- X"00", -- 0x02
- X"00", -- 0x03
- X"00", -- 0x04
- X"00", -- 0x05
- X"00", -- 0x06
- X"00", -- 0x07
- X"00", -- 0x08
- X"00", -- 0x09
- X"00", -- 0x0A
- X"00", -- 0x0B
- X"00", -- 0x0C
- X"00", -- 0x0D
- X"00", -- 0x0E
- X"00", -- 0x0F
- X"00", -- 0x10
- X"00", -- 0x11
- X"00", -- 0x12
- X"00", -- 0x13
- X"00", -- 0x14
- X"00", -- 0x15
- X"00", -- 0x16
- X"00", -- 0x17
- X"00", -- 0x18
- X"00", -- 0x19
- X"00", -- 0x1A
- X"00", -- 0x1B
- X"00", -- 0x1C
- X"00", -- 0x1D
- X"00", -- 0x1E
- X"00", -- 0x1F
- X"00", -- 0x20
- X"00", -- 0x21
- X"00", -- 0x22
- X"00", -- 0x23
- X"00", -- 0x24
- X"00", -- 0x25
- X"00", -- 0x26
- X"00", -- 0x27
- X"00", -- 0x28
- X"00", -- 0x29
- X"00", -- 0x2A
- X"00", -- 0x2B
- X"00", -- 0x2C
- X"00", -- 0x2D
- X"00", -- 0x2E
- X"00", -- 0x2F
- X"00", -- 0x30
- X"00", -- 0x31
- X"00", -- 0x32
- X"00", -- 0x33
- X"00", -- 0x34
- X"00", -- 0x35
- X"00", -- 0x36
- X"00", -- 0x37
- X"00", -- 0x38
- X"00", -- 0x39
- X"00", -- 0x3A
- X"00", -- 0x3B
- X"00", -- 0x3C
- X"00", -- 0x3D
- X"00", -- 0x3E
- X"00", -- 0x3F
- X"00", -- 0x40
- X"00", -- 0x41
- X"00", -- 0x42
- X"00", -- 0x43
- X"00", -- 0x44
- X"00", -- 0x45
- X"00", -- 0x46
- X"00", -- 0x47
- X"00", -- 0x48
- X"00", -- 0x49
- X"00", -- 0x4A
- X"00", -- 0x4B
- X"00", -- 0x4C
- X"00", -- 0x4D
- X"00", -- 0x4E
- X"00", -- 0x4F
- X"00", -- 0x50
- X"00", -- 0x51
- X"00", -- 0x52
- X"00", -- 0x53
- X"00", -- 0x54
- X"00", -- 0x55
- X"00", -- 0x56
- X"00", -- 0x57
- X"00", -- 0x58
- X"00", -- 0x59
- X"00", -- 0x5A
- X"00", -- 0x5B
- X"00", -- 0x5C
- X"00", -- 0x5D
- X"00", -- 0x5E
- X"00", -- 0x5F
- X"00", -- 0x60
- X"00", -- 0x61
- X"00", -- 0x62
- X"00", -- 0x63
- X"00", -- 0x64
- X"00", -- 0x65
- X"00", -- 0x66
- X"00", -- 0x67
- X"00", -- 0x68
- X"00", -- 0x69
- X"00", -- 0x6A
- X"00", -- 0x6B
- X"00", -- 0x6C
- X"00", -- 0x6D
- X"00", -- 0x6E
- X"00", -- 0x6F
- X"00", -- 0x70
- X"00", -- 0x71
- X"00", -- 0x72
- X"00", -- 0x73
- X"00", -- 0x74
- X"00", -- 0x75
- X"00", -- 0x76
- X"00", -- 0x77
- X"00", -- 0x78
- X"00", -- 0x79
- X"00", -- 0x7A
- X"00", -- 0x7B
- X"00", -- 0x7C
- X"00", -- 0x7D
- X"00", -- 0x7E
- X"00", -- 0x7F
- X"00", -- 0x80
- X"00", -- 0x81
- X"00", -- 0x82
- X"00", -- 0x83
- X"00", -- 0x84
- X"00", -- 0x85
- X"00", -- 0x86
- X"00", -- 0x87
- X"00", -- 0x88
- X"00", -- 0x89
- X"00", -- 0x8A
- X"00", -- 0x8B
- X"00", -- 0x8C
- X"00", -- 0x8D
- X"00", -- 0x8E
- X"00", -- 0x8F
- X"00", -- 0x90
- X"00", -- 0x91
- X"00", -- 0x92
- X"00", -- 0x93
- X"00", -- 0x94
- X"00", -- 0x95
- X"00", -- 0x96
- X"00", -- 0x97
- X"00", -- 0x98
- X"00", -- 0x99
- X"00", -- 0x9A
- X"00", -- 0x9B
- X"00", -- 0x9C
- X"00", -- 0x9D
- X"00", -- 0x9E
- X"00", -- 0x9F
- X"00", -- 0xA0
- X"00", -- 0xA1
- X"00", -- 0xA2
- X"00", -- 0xA3
- X"00", -- 0xA4
- X"00", -- 0xA5
- X"00", -- 0xA6
- X"00", -- 0xA7
- X"00", -- 0xA8
- X"00", -- 0xA9
- X"00", -- 0xAA
- X"00", -- 0xAB
- X"00", -- 0xAC
- X"00", -- 0xAD
- X"00", -- 0xAE
- X"00", -- 0xAF
- X"00", -- 0xB0
- X"00", -- 0xB1
- X"00", -- 0xB2
- X"00", -- 0xB3
- X"00", -- 0xB4
- X"00", -- 0xB5
- X"00", -- 0xB6
- X"00", -- 0xB7
- X"00", -- 0xB8
- X"00", -- 0xB9
- X"00", -- 0xBA
- X"00", -- 0xBB
- X"00", -- 0xBC
- X"00", -- 0xBD
- X"00", -- 0xBE
- X"00", -- 0xBF
- X"00", -- 0xC0
- X"00", -- 0xC1
- X"00", -- 0xC2
- X"00", -- 0xC3
- X"00", -- 0xC4
- X"00", -- 0xC5
- X"00", -- 0xC6
- X"00", -- 0xC7
- X"00", -- 0xC8
- X"00", -- 0xC9
- X"00", -- 0xCA
- X"00", -- 0xCB
- X"00", -- 0xCC
- X"00", -- 0xCD
- X"00", -- 0xCE
- X"00", -- 0xCF
- X"00", -- 0xD0
- X"00", -- 0xD1
- X"00", -- 0xD2
- X"00", -- 0xD3
- X"00", -- 0xD4
- X"00", -- 0xD5
- X"00", -- 0xD6
- X"00", -- 0xD7
- X"00", -- 0xD8
- X"00", -- 0xD9
- X"00", -- 0xDA
- X"00", -- 0xDB
- X"00", -- 0xDC
- X"00", -- 0xDD
- X"00", -- 0xDE
- X"00", -- 0xDF
- X"00", -- 0xE0
- X"00", -- 0xE1
- X"00", -- 0xE2
- X"00", -- 0xE3
- X"00", -- 0xE4
- X"00", -- 0xE5
- X"00", -- 0xE6
- X"00", -- 0xE7
- X"00", -- 0xE8
- X"00", -- 0xE9
- X"00", -- 0xEA
- X"00", -- 0xEB
- X"00", -- 0xEC
- X"00", -- 0xED
- X"00", -- 0xEE
- X"00", -- 0xEF
- X"00", -- 0xF0
- X"00", -- 0xF1
- X"00", -- 0xF2
- X"00", -- 0xF3
- X"00", -- 0xF4
- X"00", -- 0xF5
- X"00", -- 0xF6
- X"00", -- 0xF7
- X"00", -- 0xF8
- X"00", -- 0xF9
- X"00", -- 0xFA
- X"00", -- 0xFB
- X"00", -- 0xFC
- X"00", -- 0xFD
- X"00", -- 0xFE
- X"00" -- 0xFF
- );
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : dmem_addr_t;
- signal jtag_ld_dout : dmem_data_t;
- signal jtag_ld_din : dmem_data_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (15 downto 0);
- constant id : unsigned (15 downto 0) := X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
- jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= xmem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/JCpu/src/tb_cpu_embedded.vhd b/lib/CPUs/JCpu/src/tb_cpu_embedded.vhd
deleted file mode 100644
index dafb553..0000000
--- a/lib/CPUs/JCpu/src/tb_cpu_embedded.vhd
+++ /dev/null
@@ -1,126 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: testbench for embedded cpu with rom
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-use std.textio.all; -- Imports the standard textio package.
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY tb_cpu_embedded IS
-END tb_cpu_embedded;
-
-ARCHITECTURE behavior OF tb_cpu_embedded IS
-
- COMPONENT cpu_embedded
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- int_in : in STD_LOGIC;
- int_ack : out STD_LOGIC;
- xmem_we : out STD_LOGIC;
- xmem_re : out STD_LOGIC;
- xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_addr : out unsigned (DMEM_ADDR_WIDTH-1 downto 0);
- io_sel : out STD_LOGIC
- );
- END COMPONENT;
-
- constant CLK_PERIOD : time := 10 ns;
- type sram_t is array (integer range <>) of dmem_data_t;
- signal rst : std_logic := '1';
- signal clk : std_logic := '1';
- signal ce : std_logic := '0';
- signal int_in : std_logic := '0';
- signal int_ack : std_logic;
- signal xmem_din : dmem_data_t := (others => '-');
- signal xmem_dout : dmem_data_t;
- signal xmem_addr : dmem_addr_t;
- signal xmem_we : std_logic;
- signal xmem_re : std_logic;
- signal io_sel : std_logic;
- signal sram : sram_t(0 to 2**dmem_addr_t'length-1);
-
-
-BEGIN
-
-uut: cpu_embedded
- PORT MAP(
- rst => rst,
- clk => clk,
- ce => ce,
- int_in => int_in,
- int_ack => int_ack,
- xmem_we => xmem_we,
- xmem_re => xmem_re,
- xmem_din => xmem_din,
- xmem_dout => xmem_dout,
- xmem_addr => xmem_addr,
- io_sel => io_sel
- );
-
-CLK_GEN: process
- begin
- wait for CLK_PERIOD/2;
- clk <= not clk;
- end process;
-
-STIMULUS: process
-
- begin
-
- wait for 3*CLK_PERIOD;
- rst <= '0';
- wait for 2*CLK_PERIOD;
-
- wait until rising_edge(clk);
- ce <= '1';
-
- wait for 1000*CLK_PERIOD;
-
- assert false report "Test finished" severity error;
- wait;
-
- end process;
-
-SRAM_RW: process(rst, clk, xmem_addr, xmem_dout, xmem_we)
- begin
- if (rst = '1') then
- xmem_din <= X"00";
- elsif rising_edge(clk) then
- if io_sel = '0' then
- if xmem_we = '1' then
- sram(to_integer(xmem_addr)) <= xmem_dout;
- end if;
- xmem_din <= to_01(sram(to_integer(xmem_addr)));
- else
- xmem_din <= X"FF";
- end if;
- end if;
- end process;
-
-END;
diff --git a/lib/CPUs/JCpu/src/tb_cpu_irq.vhd b/lib/CPUs/JCpu/src/tb_cpu_irq.vhd
deleted file mode 100644
index 8a19414..0000000
--- a/lib/CPUs/JCpu/src/tb_cpu_irq.vhd
+++ /dev/null
@@ -1,205 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: Formal test of correct function of JCPU,
--- also writes 'opc.lst' for JASM-assembler
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-use std.textio.all; -- Imports the standard textio package.
-
-library work;
-use work.cpu_pkg.all;
-use work.PCK_FIO.all;
-
-ENTITY tb_cpu IS
-END tb_cpu;
-
-ARCHITECTURE behavior OF tb_cpu IS
-
- COMPONENT cpu
- Generic (
- use_instr_register : boolean;
- use_ctrl_rom : boolean
- );
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- int_in : in STD_LOGIC;
- int_ack : out STD_LOGIC;
- xmem_we : out STD_LOGIC;
- xmem_re : out STD_LOGIC;
- instr_din : in unsigned (IMEM_DATA_WIDTH-1 downto 0);
- instr_addr : out unsigned (IMEM_ADDR_WIDTH-1 downto 0);
- xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_addr : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
- io_sel : out STD_LOGIC
-
- );
- END COMPONENT;
-
- COMPONENT irom
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
- END COMPONENT;
-
- constant CLK_PERIOD : time := 10 ns;
- type prom_t is array (integer range <>) of inst_t;
- type sram_t is array (integer range <>) of dmem_data_t;
- signal rst : std_logic := '1';
- signal clk : std_logic := '1';
- signal ce : std_logic := '0';
- signal int_in : std_logic := '0';
- signal int_ack : std_logic;
- signal irom_data : unsigned (IMEM_DATA_WIDTH-1 downto 0) := (others => '-');
- signal irom_addr : unsigned (IMEM_ADDR_WIDTH-1 downto 0);
- signal xmem_din : dmem_data_t := (others => '-');
- signal xmem_dout : dmem_data_t;
- signal xmem_addr : unsigned (DMEM_DATA_WIDTH-1 downto 0);
- signal xmem_we : std_logic;
- signal xmem_re : std_logic;
- signal io_sel : std_logic;
- signal sram : sram_t(0 to 2**DMEM_DATA_WIDTH-1);
-
- type reg_t is record
- revision : dmem_data_t;
- testid : dmem_data_t;
- interrupt : std_logic;
- end record;
-
- signal reg : reg_t;
-
-
-BEGIN
-
-uut: cpu
- GENERIC MAP
- (
- use_instr_register => false,
- use_ctrl_rom => true
- )
- PORT MAP(
- rst => rst,
- clk => clk,
- ce => ce,
- int_in => int_in,
- int_ack => int_ack,
- xmem_we => xmem_we,
- xmem_re => xmem_re,
- instr_din => irom_data,
- instr_addr => irom_addr,
- xmem_din => xmem_din,
- xmem_dout => xmem_dout,
- xmem_addr => xmem_addr,
- io_sel => io_sel
- );
-
-the_irom: irom
- PORT MAP(
- clk => clk,
- ce => ce,
- addr => irom_addr,
- dout => irom_data
- );
-
-CLK_GEN: process
- begin
- wait for CLK_PERIOD/2;
- clk <= not clk;
- end process;
-
-STIMULUS: process
- file RESULT: text open write_mode is "../tools/opc.list";
- variable L: line;
-
- begin
-
- for i in 0 to instr_name_array'length-1 loop
- fprint(RESULT, L,"%d %s\n", fo(i), instr_name_array(i));
- end loop;
-
- wait for 3*CLK_PERIOD;
- rst <= '0';
- wait for 2*CLK_PERIOD;
-
- wait until rising_edge(clk);
- ce <= '1';
-
- wait for 1000*CLK_PERIOD;
-
- for i in 1 to 100 loop
- wait until rising_edge(clk);
- int_in <= '1';
- wait until rising_edge(clk) and int_ack = '1';
- int_in <= '0';
- wait for 300*CLK_PERIOD;
- end loop;
-
- assert false report "Test finished" severity error;
- wait;
-
- end process;
-
-SRAM_RW: process(rst, clk)
- begin
- if (rst = '1') then
- reg.revision <= (others => '0');
- reg.testid <= (others => '0');
- elsif rising_edge(clk) then
- if xmem_we = '1' then
- if io_sel = '0' then
- sram(to_integer(xmem_addr)) <= xmem_dout;
- else
- case xmem_addr is
- when X"00" =>
- reg.revision <= xmem_dout;
- when X"01" =>
- reg.testid <= xmem_dout;
- when X"02" =>
- reg.interrupt <= xmem_dout(0);
- when others => null;
- end case;
- end if;
- else
- if io_sel = '0' then
- xmem_din <= to_01(sram(to_integer(xmem_addr)));
- else
- case xmem_addr is
- when X"00" =>
- xmem_din <= reg.revision;
- when X"01" =>
- xmem_din <= reg.testid;
- when others =>
- xmem_din <= X"BC";
- end case;
- end if;
- end if;
- end if;
- end process;
-
-END;
diff --git a/lib/CPUs/JCpu/src/tb_cpu_itest.vhd b/lib/CPUs/JCpu/src/tb_cpu_itest.vhd
deleted file mode 100644
index 243ba8f..0000000
--- a/lib/CPUs/JCpu/src/tb_cpu_itest.vhd
+++ /dev/null
@@ -1,200 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: Formal test of correct function of JCPU,
--- also writes 'opc.lst' for JASM-assembler
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-use std.textio.all; -- Imports the standard textio package.
-
-library work;
-use work.cpu_pkg.all;
-use work.PCK_FIO.all;
-
-ENTITY tb_cpu IS
-END tb_cpu;
-
-ARCHITECTURE behavior OF tb_cpu IS
-
- COMPONENT cpu
- Generic (
- use_instr_register : boolean;
- use_ctrl_rom : boolean
- );
- Port (
- rst : in STD_LOGIC;
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- int_in : in STD_LOGIC;
- int_ack : out STD_LOGIC;
- xmem_we : out STD_LOGIC;
- xmem_re : out STD_LOGIC;
- instr_din : in unsigned (IMEM_DATA_WIDTH-1 downto 0);
- instr_addr : out unsigned (IMEM_ADDR_WIDTH-1 downto 0);
- xmem_din : in unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_dout : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
- xmem_addr : out unsigned (DMEM_DATA_WIDTH-1 downto 0);
- io_sel : out STD_LOGIC
-
- );
- END COMPONENT;
-
- COMPONENT irom
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
- END COMPONENT;
-
- constant CLK_PERIOD : time := 10 ns;
- type prom_t is array (integer range <>) of inst_t;
- type sram_t is array (integer range <>) of dmem_data_t;
- signal rst : std_logic := '1';
- signal clk : std_logic := '1';
- signal ce : std_logic := '0';
- signal int_in : std_logic := '0';
- signal int_ack : std_logic;
- signal irom_data : unsigned (IMEM_DATA_WIDTH-1 downto 0) := (others => '-');
- signal irom_addr : unsigned (IMEM_ADDR_WIDTH-1 downto 0);
- signal xmem_din : dmem_data_t := (others => '-');
- signal xmem_dout : dmem_data_t;
- signal xmem_addr : unsigned (DMEM_DATA_WIDTH-1 downto 0);
- signal xmem_we : std_logic;
- signal xmem_re : std_logic;
- signal io_sel : std_logic;
- signal sram : sram_t(0 to 2**DMEM_DATA_WIDTH-1);
-
- type reg_t is record
- revision : dmem_data_t;
- testid : dmem_data_t;
- interrupt : std_logic;
- end record;
-
- signal reg : reg_t;
-
-
-BEGIN
-
- int_in <= reg.interrupt;
-uut: cpu
- GENERIC MAP
- (
- use_instr_register => false,
- use_ctrl_rom => true
- )
- PORT MAP(
- rst => rst,
- clk => clk,
- ce => ce,
- int_in => int_in,
- int_ack => int_ack,
- xmem_we => xmem_we,
- xmem_re => xmem_re,
- instr_din => irom_data,
- instr_addr => irom_addr,
- xmem_din => xmem_din,
- xmem_dout => xmem_dout,
- xmem_addr => xmem_addr,
- io_sel => io_sel
- );
-
-the_irom: irom
- PORT MAP(
- clk => clk,
- ce => ce,
- addr => irom_addr,
- dout => irom_data
- );
-
-CLK_GEN: process
- begin
- wait for CLK_PERIOD/2;
- clk <= not clk;
- end process;
-
-STIMULUS: process
- file RESULT: text open write_mode is "../tools/opc.list";
- variable L: line;
-
- begin
-
- for i in 0 to instr_name_array'length-1 loop
- fprint(RESULT, L,"%d %s\n", fo(i), instr_name_array(i));
- end loop;
-
- wait for 3*CLK_PERIOD;
- rst <= '0';
- wait for 2*CLK_PERIOD;
-
- wait until rising_edge(clk);
- ce <= '1';
-
- assert false report "Test finished" severity error;
- wait;
-
- end process;
-
-SRAM_RW: process(rst, clk)
- begin
- if (rst = '1') then
- reg.revision <= (others => '0');
- reg.testid <= (others => '0');
- reg.interrupt <= '0';
- elsif rising_edge(clk) then
- if int_ack = '1' then
--- reg.interrupt <= '0';
- end if;
- if xmem_we = '1' then
- if io_sel = '0' then
- sram(to_integer(xmem_addr)) <= xmem_dout;
- else
- case xmem_addr is
- when X"00" =>
- reg.revision <= xmem_dout;
- when X"01" =>
- reg.testid <= xmem_dout;
- when X"02" =>
- reg.interrupt <= xmem_dout(0);
- when others => null;
- end case;
- end if;
- else
- if io_sel = '0' then
- xmem_din <= to_01(sram(to_integer(xmem_addr)));
- else
- case xmem_addr is
- when X"00" =>
- xmem_din <= reg.revision;
- when X"01" =>
- xmem_din <= reg.testid;
- when others =>
- xmem_din <= X"BC";
- end case;
- end if;
- end if;
- end if;
- end process;
-
-END;
diff --git a/lib/CPUs/JCpu/syn/ise91/cpu_vhdl.prj b/lib/CPUs/JCpu/syn/ise91/cpu_vhdl.prj
deleted file mode 100644
index 18718bf..0000000
--- a/lib/CPUs/JCpu/syn/ise91/cpu_vhdl.prj
+++ /dev/null
@@ -1,10 +0,0 @@
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\cpu_pkg.vhd"
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\stack_ctrl.vhd"
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\reg_dual.vhd"
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\pc.vhd"
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\int_ctrl.vhd"
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\dpath_ctrl.vhd"
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\chipreg.vhd"
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\chipram.vhd"
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\alu.vhd"
-vhdl work "W:\vhdl\lib\CPUs\JCpu\src\core\cpu.vhd"
diff --git a/lib/CPUs/JCpu/tools/eval_scan.rb b/lib/CPUs/JCpu/tools/eval_scan.rb
deleted file mode 100644
index 0c38397..0000000
--- a/lib/CPUs/JCpu/tools/eval_scan.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env ruby
-
-str1 = %Q!lbl: dc "Hallo", ", ", 0, 1, " der","Jens"!
-
-i=0;
-
-def get_stri_lit (str)
- res = [""];
- state = "out"
-
- j = 0;
- k = 0;
- for i in (0..str.length-1)
- c = str[i];
- nstate = state
- case state
- when "out"
- if c == "\""[0]
- nstate = "in"
- end
- when "in"
- if c == "\""[0]
- nstate = "out"
- if j > 0
- k = k + 1;
- res[k] = ""
- end
- else
- res[k] = res[k] + format("%c", c);
- j = j + 1;
- end
- end
- state = nstate
- end;
- return res
-end
-
-get_stri_lit(str1).each do |word|
- puts word
-end
-
-
\ No newline at end of file
diff --git a/lib/CPUs/JCpu/tools/insrom.rb b/lib/CPUs/JCpu/tools/insrom.rb
deleted file mode 100644
index 6713f9f..0000000
--- a/lib/CPUs/JCpu/tools/insrom.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env ruby
-
-# ----------------------------------------------------------------------
-# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-# This file: Insertion of code fragments into templates
-#
-# Copyright (C) 2007 J. Ahrensfeld
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# For questions and ideas, please contact the author at jens@jayfield.org
-#
-# ---------------------------------------------------------------------
-
-arg = $*
-rom_filename = arg[0].to_s
-tpl_filename = arg[1].to_s
-
-subst_pattern = "JASM_ROM_INSERT_HERE"
-
-# --------------------------------------------------------
-# Open file
-# --------------------------------------------------------
-romfile = File.open(rom_filename, "r")
-tplfile = File.open(tpl_filename, "r")
-re = Regexp.new(subst_pattern)
-
-while (line = tplfile.gets)
- puts line
- line.scan(re).each do |word|
- romfile.each do |raw_line|
- puts raw_line
- end
- end
-end
diff --git a/lib/CPUs/JCpu/tools/irom.vhd.tpl b/lib/CPUs/JCpu/tools/irom.vhd.tpl
deleted file mode 100644
index 5f11f86..0000000
--- a/lib/CPUs/JCpu/tools/irom.vhd.tpl
+++ /dev/null
@@ -1,32 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-
diff --git a/lib/CPUs/JCpu/tools/irom_ld.vhd.tpl b/lib/CPUs/JCpu/tools/irom_ld.vhd.tpl
deleted file mode 100644
index eaa41f3..0000000
--- a/lib/CPUs/JCpu/tools/irom_ld.vhd.tpl
+++ /dev/null
@@ -1,151 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY irom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in inst_addr_t;
- dout : out inst_t
- );
-
-END irom;
-
-ARCHITECTURE loadable OF irom IS
-
- -- JASM_ROM_INSERT_HERE
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : inst_addr_t;
- signal jtag_ld_dout : inst_t;
- signal jtag_ld_din : inst_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (31 downto 0);
- constant id : unsigned (31 downto 0) := X"BABE" & X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst1 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 1 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-inst_addr_t'length+1);
- jtag_ld_din <= user_regi(inst_t'length-1 downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto inst_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= imem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- imem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= imem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/JCpu/tools/jasm.bak.rb b/lib/CPUs/JCpu/tools/jasm.bak.rb
deleted file mode 100644
index 4c9feb0..0000000
--- a/lib/CPUs/JCpu/tools/jasm.bak.rb
+++ /dev/null
@@ -1,494 +0,0 @@
-#!/usr/bin/env ruby
-
-# ----------------------------------------------------------------------
-# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-# This file: A small assembler for the JCPU
-
-# Copyright (C) 2007 J. Ahrensfeld
-
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-# For questions and ideas, please contact the author at jens@jayfield.org
-
-# ---------------------------------------------------------------------
-
-arg = $*
-MAX_SIZE_ROM = 1024
-PROJECT_NAME = arg.to_s.gsub(/\..*/, "")
-ENTITY_NAME = "rom"
-ENTITY_DATA_TYPE = "inst_t"
-ENTITY_ADDR_TYPE = "inst_addr_t"
-OPC_LIST_NAME = "/cygdrive/w/vhdl/lib/CPUs/JCpu/tools/opc.list"
-
-# --------------------------------------------------------
-# Open file
-# --------------------------------------------------------
-filename = arg.to_s
-if !File.exists?(filename)
- STDERR.puts "#{filename} does not exist"
- exit 1
-end
-
-# --------------------------------------------------------
-# Pass 1
-# --------------------------------------------------------
-lc = 0 # Line counter
-pc = 0 # Program counter
-chip_dc = [0,0,0,0] # chip data counter
-xmem_dc = 0 # xmem data counter
-curr_segment = "UNDEF";
-page = 0
-
-label_list=[[],[]]
-instr_list=[nil]
-file = File.open(filename, "r")
-file.each do |raw_line|
- lc += 1
-
- # Make all upper case
- iline = "#{raw_line}".strip.upcase
-
- # Remove comments
- iline = iline.gsub(/;.*/, "")
-
- # Split instruction at spaces
- iline_member = iline.split(" ")
-
- if iline_member[0] == nil
- next
- end
-
- mc = 0;
- label = nil
- clean_line = nil
- if (iline_member[0] =~ /\w+:/)
- mc += 1
- label = iline_member[0].delete(":")
- if label_list.rindex(label) != nil
- STDERR.puts format("Error in line %d: Duplicate label \"%s\" found", lc, label)
- exit 1
- end
- end
-
- case iline_member[mc]
- when nil
- value = format("0x%3.3X",pc)
- when "EQU"
- if 0 == (iline_member[mc+1] =~ /\d+/)
- value = format("0x%2.2X",eval(iline_member[mc+1..iline_member.nitems].to_s))
- else
- value = iline_member[mc+1]
- end
- when "ORG", "CODE"
- pc = eval(iline_member[mc+1..iline_member.nitems].to_s)
- value = format("0x%3.3X",pc)
- when "CDATA", "CMEM"
- if iline_member[mc+1] == nil
- STDERR.puts format("Error in line %d: CDATA needs argument!", lc)
- exit 1
- end
- curr_segment = "CMEM";
- page = iline_member[mc+1].to_i(16)
- when "XDATA", "XMEM"
- curr_segment = "XMEM";
- when "DC"
- len = 0;
- iline.split("DC")[1].delete("0x").scan(/[0-9A-Fa-f]+/).each do |byte|
- len += 1
- end
- if curr_segment == "CMEM"
- STDERR.puts format("Error in line %d: CDATA cannot be initialized!", lc)
- exit 1
- else
- value = format("0x%2.2X",xmem_dc)
- puts format("Found DC defining %d bytes at 0x%4.4X in %s", len, xmem_dc, curr_segment);
- xmem_dc += len
- end
- when "DB"
- len = iline_member[mc+1].to_i
- if curr_segment == "CMEM"
- value = format("0x%2.2X",chip_dc[page])
- puts format("Found DB reserving %d bytes at 0x%4.4X in %s(%d)", len, chip_dc[page], curr_segment, page);
- chip_dc[page] += len
- else
- value = format("0x%2.2X",xmem_dc)
- puts format("Found DB reserving %d bytes at 0x%4.4X in %s", len, xmem_dc, curr_segment);
- xmem_dc += len
- end
- else
- op_line = iline_member[mc+1..iline_member.nitems].to_s
- value = format("0x%3.3X",pc)
- opc = iline_member[mc]
- if iline_member[mc+1] != nil
- op1 = op_line.gsub(/,+.*$/, "")
- end
- if iline_member[mc+2] != nil
- op2 = op_line.scan(/,.+$/).to_s.delete(", ")
- end
- if instr_list[pc] == nil
- instr_list[pc] = [lc, pc, opc , op1 , op2]
- pc += 1
- else
- STDERR.puts format("Error in line %d: Overlapping sections at %3.3X", lc, pc)
- exit 1
- end
- end;
-
- # Push labels
- if label
- label_list = label_list + [label, value]
- end
-end
-file.close
-
-# --------------------------------------------------------
-def instr(opcode)
- return format("\"%6.6B\" & X\"%3.3X\"",opcode ,0)
-end
-
-def tcl_bits(pc, opcode)
- return format("%10.10B%6.6B%12.12B",pc, opcode ,0)
-end
-
-def instr_k(opcode, k)
- return format("\"%6.6B\" & X\"%3.3X\"",opcode ,k)
-end
-
-def tcl_bits_k(pc, opcode, k)
- return format("%10.10B%6.6B%12.12B",pc, opcode ,k)
-end
-
-def instr_r(opcode, r)
- return format("\"%6.6B\" & X\"%2.2X%X\"",opcode ,0, r)
-end
-
-def tcl_bits_r(pc, opcode, r)
- return format("%10.10B%6.6B%8.8B%4.4B",pc, opcode ,0,r)
-end
-
-def instr_kr(opcode, k, r)
- return format("\"%6.6B\" & X\"%2.2X%X\"",opcode,k, r)
-end
-
-def tcl_bits_kr(pc, opcode, k, r)
- return format("%10.10B%6.6B%8.8B%4.4B",pc, opcode, k, r)
-end
-
-def instr_rk(opcode, r, k)
- return format("\"%6.6B\" & X\"%2.2X%X\"",opcode,k, r)
-end
-
-def tcl_bits_rk(pc, opcode, r, k)
- return format("%10.10B%6.6B%8.8B%4.4B",pc, opcode, k, r)
-end
-
-def instr_rr(opcode, ra, rb)
- return format("\"%6.6B\" & X\"%X%X%X\"",opcode,0, rb, ra)
-end
-
-def tcl_bits_rr(pc, opcode, ra, rb)
- return format("%10.10B%6.6B%4.4B%4.4B%4.4B",pc, opcode, 0, rb, ra)
-end
-
-# --------------------------------------------------------
-# Read mnemonic set
-# --------------------------------------------------------
-filename = OPC_LIST_NAME
-if !File.exists?(filename)
- STDERR.puts "#{filename} does not exist"
- exit 1
-end
-
-mnemo_list = []
-num_opcodes = 0
-file = File.open(filename, "r")
-file.each do |raw_line|
- mnemo_list[num_opcodes] = raw_line.split(" ")[1]
- num_opcodes += 1
-end
-
-# --------------------------------------------------------
-# Pass 2
-# --------------------------------------------------------
-pc = 0
-opc_start = 2
-num_errors = 0
-vhdl_trans_list = [nil]
-vhdl_comment_list = [nil]
-vhdl_tcl_list = [nil]
-instr_list.each do |instruct|
-
- # puts instruct
- if instruct == nil
- vhdl_trans_list[pc] = format("\"%6.6B\" & X\"%3.3X\"",0 ,0)
- vhdl_comment_list[pc] = format("0x%3.3X:", pc)
- vhdl_tcl_list[pc] = tcl_bits(pc, 0)
- pc += 1
- next
- end
-
- # determine arglen of instruction
- ilen = 0
- if instruct[opc_start+1] == nil
- arglen = 0
- elsif instruct[opc_start+2] == nil
- arglen = 1
- elsif instruct[opc_start+3] == nil
- arglen = 2
- end
-
- # Symbol substitution
- error = false
- for i in (1..3)
- subst_pos = opc_start+i
- if instruct[subst_pos] == nil
- next
- end
- expr_token = ""
- expr_subst = nil
- is_direct = true;
-
-# instruct[subst_pos] = instruct[subst_pos].delete(" ")
-
- # checks R0 .. R16, Mnemonics
- instr_str = instruct[subst_pos]
- if 0 == (instr_str =~ /\(.+\)/)
- instr_str = instr_str.delete("()")
- is_direct = false;
- end
-
- expr_token = instr_str.split(/\+|\-|\*|\//)[0]
- if (0 != (expr_token =~ /R[0-9]+/)) && (0 != (expr_token =~ /\d+/))
- idx = label_list.rindex(expr_token)
- if idx != nil
- expr_subst = label_list[idx+1]
- instruct[subst_pos] = instruct[subst_pos].gsub(expr_token, expr_subst)
- else
- STDERR.puts format("Error in line %d: Symbol \"%s\" not found", instruct[0], expr_token)
- error = true
- end
- end
-
- if expr_subst != nil
- if 0 == (expr_subst =~ /\d+/)
- if is_direct == true
- instruct[subst_pos] = format("0x%2.2X", eval(instruct[subst_pos]))
- else
- instruct[subst_pos] = format("(0x%2.2X)", eval(instruct[subst_pos]))
- end
- else
- if 0 != (expr_subst =~ /R[0-9]+/)
- STDERR.puts format("Error in line %d: Invalid expression \"%s\"", instruct[0], expr_subst)
- error = true
- end
- end
- end
- end
-
- # Parse operands
- reg = [0,0]
- kk = 0
- format = instruct[opc_start]
- for i in (0..1)
- if instruct[opc_start+i+1] =~ Regexp.new("R[0-9]+")
- # Check indirect addressing
- reg[i] = instruct[opc_start+i+1].delete("R()").to_i
- format += "|R"
- if reg[i] > 15
- STDERR.puts format("Error in line %d: Invalid register \"R%d\" specified", instruct[0], reg[i])
- error = true
- end
- else
- if instruct[opc_start+i+1] =~ Regexp.new("[0-9A-F]+")
- kk = instruct[opc_start+i+1].delete("()").to_i(16)
- format += "|K"
- end
- end
- if instruct[opc_start+i+1] =~ Regexp.new("\\(.+\\)")
- format += "i";
- end
- end
-
- # Output instruction
- opcode = mnemo_list.rindex(format).to_i
- mnemo = instruct[2];
-
- case format
- when "NOP", "HALT", "RET", "RETI"
- vhdl_trans_list[pc] = instr(opcode)
- vhdl_tcl_list[pc] = tcl_bits(pc, opcode)
- minstr_comment = format("0x%3.3X: %s", pc, mnemo)
- when "MOVC|R|Ri", "MOVX|R|Ri"
- vhdl_trans_list[pc] = instr_rr(opcode, reg[0], reg[1]);
- vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[0], reg[1])
- minstr_comment = format("0x%3.3X: %s R%2.2d, (R%2.2d)", pc, mnemo, reg[0], reg[1])
- when "MOV|R|R", "SUB|R|R", "ADD|R|R", "AND|R|R", "OR|R|R", "XOR|R|R", "CMP|R|R"
- vhdl_trans_list[pc] = instr_rr(opcode, reg[0], reg[1]);
- vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[0], reg[1])
- minstr_comment = format("0x%3.3X: %s R%2.2d, R%2.2d", pc, mnemo, reg[0], reg[1])
- when "MOVC|Ri|R", "MOVX|Ri|R"
- vhdl_trans_list[pc] = instr_rr(opcode, reg[1], reg[0]);
- vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[1], reg[0])
- minstr_comment = format("0x%3.3X: %s (R%2.2d), R%2.2d", pc, mnemo, reg[1], reg[0])
- when "MOVC|Ri|K", "MOVX|Ri|K", "COUT|Ri|K", "XOUT|Ri|K"
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- minstr_comment = format("0x%3.3X: %s (R%2.2d), 0x%2.2X", pc, mnemo, reg[0], kk)
- when "MOVC|R|Ki", "MOVX|R|Ki", "CIN|R|Ki", "XIN|R|Ki"
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- minstr_comment = format("0x%3.3X: %s R%2.2d, (0x%2.2X)", pc, mnemo, reg[0], kk)
- when "MOV|R|K", "SUB|R|K", "ADD|R|K", "AND|R|K", "OR|R|K", "XOR|R|K", "CMP|R|K"
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- minstr_comment = format("0x%3.3X: %s R%2.2d, 0x%2.2X", pc, mnemo, reg[0], kk)
- when "MOVC|Ki|R", "MOVC|Ki|R", "MOVX|Ki|R", "MOVX|Ki|R", "COUT|Ki|R", "XOUT|Ki|R"
- vhdl_trans_list[pc] = instr_kr(opcode, kk, reg[1]);
- vhdl_tcl_list[pc] = tcl_bits_kr(pc, opcode, kk, reg[1])
- minstr_comment = format("0x%3.3X: %s (0x%2.2X), R%2.2d", pc, mnemo, kk, reg[1])
- when "CALL|K", "JMP|K", "JNZ|K", "JZ|K","JNC|K", "JC|K", "JLT|K", "JGT|K", "JLE|K", "JGE|K", "JEQ|K", "JNE|K"
- vhdl_trans_list[pc] = instr_k(opcode, kk)
- vhdl_tcl_list[pc] = tcl_bits_k(pc, opcode, kk)
- minstr_comment = format("0x%3.3X: %s 0x%3.3X", pc, mnemo, kk)
- when "PUSH|R", "POP|R", "SHR|R", "SHL|R", "ROR|R", "ROL|R", "RORC|R", "ROLC|R"
- vhdl_trans_list[pc] = instr_r(opcode, reg[0])
- vhdl_tcl_list[pc] = tcl_bits_r(pc, opcode, reg[0])
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- when "TST|R"
- kk = 0
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- opcode = mnemo_list.rindex("CMP|R|K").to_i
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- when "INC|R"
- kk = 1
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- opcode = mnemo_list.rindex("ADD|R|K").to_i
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- when "DEC|R"
- kk = 1
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- opcode = mnemo_list.rindex("SUB|R|K").to_i
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- else
- STDERR.puts format("Error in line %d: Not yet implemented %s", instruct[0], format)
- error = true
- end
-
- if error
- num_errors += 1
- break
- end
- vhdl_comment_list[pc] = minstr_comment
-
- puts vhdl_trans_list[pc] + " -- " + minstr_comment
-
- pc += 1
-end
-
-# --------------------------------------------------------
-# Output ROM file
-# --------------------------------------------------------
-if num_errors == 0
-
- filename = format("rom_%s.vhdl.snip", PROJECT_NAME)
- file = File.open(filename, "w")
-
- file.puts format("ENTITY %s IS\n", ENTITY_NAME)
- file.puts format("\tPort (\n")
- file.puts format("\tclk\t\t\t: in STD_LOGIC;\n")
- file.puts format("\tce\t\t\t: in STD_LOGIC;\n")
- file.puts format("\taddr\t\t: in %s;\n", ENTITY_ADDR_TYPE)
- file.puts format("\tdout\t\t: out %s\n", ENTITY_DATA_TYPE)
- file.puts format("\t);\n")
- file.puts format("END %s;\n", ENTITY_NAME)
- file.puts format("\n")
- file.puts format("ARCHITECTURE %s OF %s IS \n", PROJECT_NAME, ENTITY_NAME)
- file.puts format("\n")
- file.puts format("\ttype instruction_rom_t is array (0 to %d) of %s;\n", pc-1, ENTITY_DATA_TYPE)
- file.puts format("\n")
- file.puts format("\tconstant instruction_rom : instruction_rom_t :=\n")
- file.puts format("\t(\n");
- for i in (0..pc-2)
- file.puts "\t\t" + vhdl_trans_list[i] + ", -- " + vhdl_comment_list[i] + "\n"
- end;
- file.puts "\t\t" + vhdl_trans_list[pc-1] + " -- " + vhdl_comment_list[pc-1] + "\n"
- file.puts format("\t);\n")
- file.puts format("\n")
- file.puts format("begin")
- file.puts format("\n")
- file.puts format("PROM_READ:")
- file.puts format("\tprocess(clk, ce)\n")
- file.puts format("\tbegin\n")
- file.puts format("\t\tif rising_edge(clk) and ce = '1' then\n")
- file.puts format("\t\t\tdout <= instruction_rom(to_integer(addr));\n")
- file.puts format("\t\tend if;\n")
- file.puts format("\tend process;\n")
- file.puts format("\n")
- file.puts format("end %s;\n", PROJECT_NAME)
- puts format("ROM file written to \"%s\"\n",filename)
- file.close
-end
-if num_errors == 0
-
- filename = format("preinit_%s.vhdl.snip", PROJECT_NAME)
- file = File.open(filename, "w")
-
- file.puts format("\tsignal instruction_rom : instruction_rom_t :=\n")
- file.puts format("\t(\n");
- for i in (0..pc-2)
- file.puts "\t\t" + vhdl_trans_list[i] + ", -- " + vhdl_comment_list[i] + "\n"
- end;
- if pc < (MAX_SIZE_ROM-1)
- file.puts "\t\t" + vhdl_trans_list[pc-1] + ", -- " + vhdl_comment_list[pc-1] + "\n"
- for i in (pc..(MAX_SIZE_ROM-2))
- file.puts "\t\t" + instr(0) + ",\n"
- end;
- file.puts "\t\t" + instr(0) + "\n"
- else
- file.puts "\t\t" + vhdl_trans_list[pc-1] + " -- " + vhdl_comment_list[pc-1] + "\n"
- end
- file.puts format("\t);\n")
- puts format("PREINIT file written to \"%s\"\n",filename)
- file.close
-end
-if num_errors == 0
- filename = format("rom_%s.tcl.snip", PROJECT_NAME)
- file = File.open(filename, "w")
- for i in (0..pc-1)
- # Chipscope 8.1
-# file.puts format("jtag_shiftdr $handle -buffer \"%s\" -endstate RTI -device $devid", vhdl_tcl_list[i].reverse);
-
- # Chipscope 9.1
- file.puts format("\# %s", vhdl_comment_list[i])
- file.puts format("::chipscope::csejtag_tap shift_device_dr $handle $devid $CSEJTAG_SHIFT_READWRITE $CSEJTAG_RUN_TEST_IDLE 0 %d \"%8.8X\"\n\n", vhdl_tcl_list[i].length, vhdl_tcl_list[i].to_i(2));
- end;
- puts format("TCL snippet written to \"%s\"\n",filename)
- file.close
-end
-
-# --------------------------------------------------------
-# Output final statistics
-# --------------------------------------------------------
-if num_errors == 0
- puts "Program uses #{pc} instruction addresses"
- puts "No errors found"
- exit 0
-else
- puts "#{num_errors} errors found"
- exit 1
-end
diff --git a/lib/CPUs/JCpu/tools/jasm.rb b/lib/CPUs/JCpu/tools/jasm.rb
deleted file mode 100644
index 0959ba9..0000000
--- a/lib/CPUs/JCpu/tools/jasm.rb
+++ /dev/null
@@ -1,814 +0,0 @@
-#!/usr/bin/env ruby
-
-# ----------------------------------------------------------------------
-# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-# This file: A small assembler for the JCPU
-#
-# Copyright (C) 2007 J. Ahrensfeld
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# For questions and ideas, please contact the author at jens@jayfield.org
-#
-# ---------------------------------------------------------------------
-
-arg = $*
-FILE_SUFFIX = "jsm"
-IROM_MAX_SIZE = 1024
-IROM_ENTITY_NAME = "irom"
-IROM_DATA_TYPE = "inst_t"
-IROM_ADDR_TYPE = "inst_addr_t"
-XROM_MAX_SIZE = 256
-XROM_DATA_TYPE = "dmem_data_t"
-XROM_ADDR_TYPE = "dmem_addr_t"
-XROM_ENTITY_NAME = "xrom"
-OPC_LIST_NAME = "/cygdrive/w/vhdl/lib/CPUs/JCpu/tools/opc.list"
-
-# --------------------------------------------------------
-class Parser
- def curr_segment
- @curr_segment
- end
- def curr_segment=(arg)
- @curr_segment=arg
- end
- def add_label(labelname, addr)
- @label_list = @label_list + [labelname, addr]
- end
- def getLabelIdByName(label)
- return @label_list.rindex(label)
- end
- def getLabelNameById(id)
- return @label_list[id]
- end
- def put_instr(name, lc, opc , op1 , op2)
- if get_instr != nil
- STDERR.puts format("Error in line %d: Overlapping sections at %3.3X", lc, @pc)
- exit 1
- end
- @instr_list[@pc] = [lc, @pc, opc , op1 , op2, name]
- end
- def get_instr
- return @instr_list[@pc]
- end
- def put_xmem(value, lc)
- if get_xmem != nil
- STDERR.puts format("Error in line %d: Overlapping sections at %3.3X (%s)", lc, xmem_dc, curr_segment)
- exit 1
- end
- @xmem[xmem_dc] = value
- @xmem_dc = xmem_dc + 1
- end
- def get_xmem
- return @xmem[xmem_dc]
- end
- def xmem
- return @xmem
- end
- def put_cmem(value, lc)
- if get_cmem(page) != nil
- STDERR.puts format("Error in line %d: Overlapping sections at %3.3X (%s)", lc, cmem_dc, curr_segment)
- exit 1
- end
- @cmem[page][cmem_dc] = value
- @cmem_dc[page] = cmem_dc + 1
- end
- def get_cmem(pg)
- return @cmem[pg][cmem_dc]
- end
- def cmem(page)
- return @cmem[page]
- end
- def cmem_dc=(addr)
- @cmem_dc[page] = addr
- end
- def cmem_dc
- @cmem_dc[page]
- end
- def xmem_dc=(addr)
- @xmem_dc = addr
- end
- def xmem_dc
- @xmem_dc
- end
- def page=(page)
- @page = page;
- end
- def page
- @page;
- end
- def pc=(pc)
- @pc = pc;
- if (pc > @pc_max)
- @pc_max = pc
- end
- end
- def pc
- @pc;
- end
- def pc_max
- @pc_max;
- end
- def instr_list
- @instr_list
- end
- def label_list
- @label_list
- end
-
- def initialize()
- @pc_max = 0
- @pc = 0 # Program counter
- @cmem_dc = [0,0,0,0] # chip data counter
- @xmem_dc = 0 # xmem data counter
- @curr_segment = "UNDEF";
- @page = 0
- @label_list=[[],[]]
- @instr_list=[nil]
- @cmem = [[],[]];
- @xmem = [];
- end
- def method_missing(name, *args)
- puts "I don't know the method #{name}"
- end
-end
-
-# --------------------------------------------------------
-def parse(name, obj)
-
-lc = 0 # Line counter
-file = File.open(name, "r")
-
-file.each do |raw_line|
- lc += 1
-
- # Make all upper case
- iline = "#{raw_line}".strip
-
- # Remove comments
- iline = iline.gsub(/;.*/, "")
-
- # Split instruction at spaces
- iline_member = iline.split(" ")
-
- if iline_member[0] == nil
- next
- end
-
- mc = 0;
- label = nil
- clean_line = nil
- if (iline_member[0] =~ /\w+:/)
- mc += 1
- label = iline_member[0].delete(":")
- if obj.getLabelIdByName(label) != nil
- STDERR.puts format("Error in line %d: Duplicate label \"%s\" found", lc, label)
- exit 1
- end
- end
-
- token = iline_member[mc]
- if token
- token = token.upcase
- end
-
- case token
- when nil
- if obj.curr_segment == "CMEM"
- curr_addr = format("0x%3.3X",obj.cmem_dc)
- elsif obj.curr_segment == "XMEM"
- curr_addr = format("0x%3.3X",obj.xmem_dc)
- elsif obj.curr_segment == "CODE"
- curr_addr = format("0x%3.3X",obj.pc)
- else
- STDERR.puts format("Error in line %d: Undefined segment", lc)
- exit 1
- end
- when "INCLUDE"
- if iline_member[mc+1] == nil
- STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
- exit 1
- end
- inc_name = iline_member[mc+1].delete("\"")
- puts format("Inserting \"%s\" into \"%s\" at line %d", inc_name, name, lc);
- parse(inc_name, obj)
- when "EQU"
- if iline_member[mc+1] == nil
- STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
- exit 1
- end
- if 0 == (iline_member[mc+1] =~ /\d+/)
- curr_addr = format("0x%2.2X",eval(iline_member[mc+1..iline_member.nitems].to_s))
- else
- curr_addr = iline_member[mc+1]
- end
- when "ORG"
- if iline_member[mc+1] == nil
- STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
- exit 1
- end
- offset = eval(iline_member[mc+1..iline_member.nitems].to_s)
- case obj.curr_segment
- when "CODE"
- obj.pc = offset
- curr_addr = format("0x%3.3X",obj.pc)
- when "CMEM"
- obj.cmem_dc = offset
- when "XMEM"
- obj.xmem_dc = offset
-
- end
- when "CODE"
- curr_addr = format("0x%3.3X",obj.pc)
- obj.curr_segment = "CODE";
- when "CDATA", "CMEM"
- if iline_member[mc+1] == nil
- STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
- exit 1
- end
- obj.curr_segment = "CMEM";
- obj.page = iline_member[mc+1].to_i(16)
- when "XDATA", "XMEM"
- obj.curr_segment = "XMEM";
- when "DC"
- len = 0;
- if iline_member[mc+1] == nil
- STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
- exit 1
- end
- if obj.curr_segment == "CMEM"
- STDERR.puts format("Error in line %d: %s cannot be initialized!", lc, obj.curr_segment)
- exit 1
- elsif obj.curr_segment == "XMEM"
- curr_addr = format("0x%2.2X",obj.xmem_dc)
- dc_old = obj.xmem_dc;
- val_array = raw_line.split(/dc|DC|Dc|dC/)[1].delete("\t").gsub(/;.*/, "").split(",")
-
- # Parse string literals
- val_array.each do |item|
- if 0 == (item =~ /.*\".*\"/)
- str = item.delete("\"")
- puts item
- for nn in (0..str.length-1)
- if str[nn] > 31
- obj.put_xmem(str[nn], lc);
- puts "S: " + str[nn].to_s
- len += 1
- end
- end;
- else
- argument = item
- puts "B: " + argument
- obj.put_xmem(eval(argument), lc);
- len += 1
- end
- end
- puts format("Found DC defining %d bytes at 0x%4.4X in %s", len, dc_old, obj.curr_segment);
- else
- STDERR.puts format("Error in line %d: Invalid segment %s for \"%s\"", lc, obj.curr_segment, token)
- exit 1
- end
- when "DB"
- if iline_member[mc+1] == nil
- STDERR.puts format("Error in line %d: %s needs argument!", lc, token)
- exit 1
- end
- len = eval(iline_member[mc+1]).to_i
- if obj.curr_segment == "CMEM"
- curr_addr = format("0x%2.2X",obj.cmem_dc)
- puts format("Found DB reserving %d bytes at 0x%4.4X in %s(%d)", len, obj.cmem_dc, obj.curr_segment, obj.page);
- for nn in (1..len)
- obj.put_cmem(0, lc)
- end
- elsif obj.curr_segment == "XMEM"
- curr_addr = format("0x%2.2X",obj.xmem_dc)
- puts format("Found DB reserving %d bytes at 0x%4.4X in %s", len, obj.xmem_dc, obj.curr_segment);
- for nn in (1..len)
- obj.put_xmem(0, lc)
- end
- else
- STDERR.puts format("Error in line %d: Invalid segment %s for \"%s\"", lc, obj.curr_segment, token)
- exit 1
- end
- else
- if obj.curr_segment != "CODE"
- STDERR.puts format("Error in line %d: Invalid segment %s for \"%s\"", lc, obj.curr_segment, token)
- exit 1
- end
-
- op_line = iline_member[mc+1..iline_member.nitems].to_s
- curr_addr = format("0x%3.3X",obj.pc)
- opc = token
- if iline_member[mc+1] != nil
- op1 = op_line.gsub(/,+.*$/, "")
- end
- if iline_member[mc+2] != nil
- op2 = op_line.scan(/,.+$/).to_s.delete(", ")
- end
- obj.put_instr(name, lc, opc, op1, op2)
- obj.pc = obj.pc + 1
- end;
-
- # Push labels
- if label
- obj.add_label(label, curr_addr)
- end
-end
-file.close
-return obj
-end
-
-# --------------------------------------------------------
-# Instruction formatting
-# --------------------------------------------------------
-def instr(opcode)
- return format("\"%6.6B\" & X\"%3.3X\"",opcode ,0)
-end
-
-def tcl_bits(pc, opcode)
- return format("%12.12B%8.8B%12.12B",pc, opcode ,0)
-end
-
-def instr_k(opcode, k)
- return format("\"%6.6B\" & X\"%3.3X\"",opcode ,k)
-end
-
-def tcl_bits_k(pc, opcode, k)
- return format("%12.12B%8.8B%12.12B",pc, opcode ,k)
-end
-
-def instr_r(opcode, r)
- return format("\"%6.6B\" & X\"%2.2X%X\"",opcode ,0, r)
-end
-
-def tcl_bits_r(pc, opcode, r)
- return format("%12.12B%8.8B%8.8B%4.4B",pc, opcode ,0,r)
-end
-
-def instr_kr(opcode, k, r)
- return format("\"%6.6B\" & X\"%2.2X%X\"",opcode,k, r)
-end
-
-def tcl_bits_kr(pc, opcode, k, r)
- return format("%12.12B%8.8B%8.8B%4.4B",pc, opcode, k, r)
-end
-
-def instr_rk(opcode, r, k)
- return format("\"%6.6B\" & X\"%2.2X%X\"",opcode,k, r)
-end
-
-def tcl_bits_rk(pc, opcode, r, k)
- return format("%12.12B%8.8B%8.8B%4.4B",pc, opcode, k, r)
-end
-
-def instr_rr(opcode, ra, rb)
- return format("\"%6.6B\" & X\"%X%X%X\"",opcode,0, rb, ra)
-end
-
-def tcl_bits_rr(pc, opcode, ra, rb)
- return format("%12.12B%8.8B%4.4B%4.4B%4.4B",pc, opcode, 0, rb, ra)
-end
-
-# --------------------------------------------------------
-# Open file
-# --------------------------------------------------------
-filename = arg.to_s
-if !File.exists?(filename)
- STDERR.puts "#{filename} does not exist"
- exit 1
-end
-PROJECT_NAME = File.basename(filename, "." + FILE_SUFFIX)
-
-# --------------------------------------------------------
-# Pass 1
-# --------------------------------------------------------
-first_pass = Parser.new();
-parse(filename, first_pass)
-
-# --------------------------------------------------------
-# Read mnemonic set
-# --------------------------------------------------------
-filename = OPC_LIST_NAME
-if !File.exists?(filename)
- STDERR.puts "#{filename} does not exist"
- exit 1
-end
-
-mnemo_list = []
-num_opcodes = 0
-file = File.open(filename, "r")
-file.each do |raw_line|
- mnemo_list[num_opcodes] = raw_line.split(" ")[1]
- num_opcodes += 1
-end
-
-# --------------------------------------------------------
-# Pass 2
-# --------------------------------------------------------
-pc = 0
-opc_start = 2
-num_errors = 0
-vhdl_trans_list = [nil]
-vhdl_comment_list = [nil]
-vhdl_tcl_list = [nil]
-
-# ToDo: Use class-methods
-label_list = first_pass.label_list
-instr_list = first_pass.instr_list
-
-instr_list.each do |instruct|
-
- # puts instruct
- if instruct == nil
- vhdl_trans_list[pc] = format("\"%6.6B\" & X\"%3.3X\"",0 ,0)
- vhdl_comment_list[pc] = format("0x%3.3X:", pc)
- vhdl_tcl_list[pc] = tcl_bits(pc, 0)
- pc += 1
- next
- end
-
- # determine arglen of instruction
- ilen = 0
- if instruct[opc_start+1] == nil
- arglen = 0
- elsif instruct[opc_start+2] == nil
- arglen = 1
- elsif instruct[opc_start+3] == nil
- arglen = 2
- end
-
- # Symbol substitution
- error = false
- for i in (1..2)
- subst_pos = opc_start+i
- if instruct[subst_pos] == nil
- next
- end
- expr_token = ""
- expr_subst = nil
- is_direct = true;
-
- # checks R0 .. R16, Mnemonics
- instruct[subst_pos] = instruct[subst_pos].gsub(/'low/, "")
- if (nil != (instruct[subst_pos] =~ /'high/))
- instruct[subst_pos]= format("%s/256", instruct[subst_pos].gsub(/'high/, ""))
- end
- instr_str = instruct[subst_pos]
- if 0 == (instr_str =~ /\(.+\)/)
- instr_str = instr_str.delete("()")
- is_direct = false;
- end
-
- expr_token = instr_str.split(/\+|\-|\*|\/|\||\&/)[0]
- if (0 != (expr_token =~ /R[0-9]+/)) && (0 != (expr_token =~ /\d+/))
- idx = label_list.rindex(expr_token)
- if idx != nil
- expr_subst = label_list[idx+1]
- instruct[subst_pos] = instruct[subst_pos].gsub(expr_token, expr_subst)
- else
- STDERR.puts format("%s: Error in line %d: Symbol \"%s\" not found", instruct[5], instruct[0], expr_token)
- error = true
- end
- end
-
- if expr_subst != nil
- if 0 == (expr_subst =~ /\d+/)
- if is_direct == true
- instruct[subst_pos] = format("0x%2.2X", eval(instruct[subst_pos]))
- else
- instruct[subst_pos] = format("(0x%2.2X)", eval(instruct[subst_pos]))
- end
- else
- if 0 != (expr_subst =~ /R[0-9]+/)
- STDERR.puts format("%s: Error in line %d: Invalid expression \"%s\"", instruct[5], instruct[0], expr_subst)
- error = true
- end
- end
- end
- end
-
- # Parse operands
- reg = [0,0]
- kk = 0
- format = instruct[opc_start]
- for i in (0..1)
- if instruct[opc_start+i+1] =~ Regexp.new("R[0-9]+")
- # Check indirect addressing
- reg[i] = instruct[opc_start+i+1].delete("R()").to_i
- format += "|R"
- if reg[i] > 15
- STDERR.puts format("%s: Error in line %d: Invalid register \"R%d\" specified", instruct[5], instruct[0], reg[i])
- error = true
- end
- else
- if instruct[opc_start+i+1] =~ Regexp.new("[0-9A-F]+")
- kk = eval(instruct[opc_start+i+1].delete("()"))
- format += "|K"
- end
- end
- if instruct[opc_start+i+1] =~ Regexp.new("\\(.+\\)")
- format += "i";
- end
- end
-
- if error
- num_errors += 1
- break
- end
-
- # Output instruction
- opcode = mnemo_list.rindex(format).to_i
- mnemo = instruct[2];
-
- case format
- # Native instructions
- when "NOP", "HALT", "RET", "RETI", "SETC"
- vhdl_trans_list[pc] = instr(opcode)
- vhdl_tcl_list[pc] = tcl_bits(pc, opcode)
- minstr_comment = format("0x%3.3X: %s", pc, mnemo)
- when "MOVC|R|Ri", "MOVX|R|Ri"
- vhdl_trans_list[pc] = instr_rr(opcode, reg[0], reg[1]);
- vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[0], reg[1])
- minstr_comment = format("0x%3.3X: %s R%2.2d, (R%2.2d)", pc, mnemo, reg[0], reg[1])
- when "MOV|R|R", "SUB|R|R", "SUBC|R|R", "ADD|R|R", "ADDC|R|R", "AND|R|R", "OR|R|R", "XOR|R|R", "CMP|R|R"
- vhdl_trans_list[pc] = instr_rr(opcode, reg[0], reg[1]);
- vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[0], reg[1])
- minstr_comment = format("0x%3.3X: %s R%2.2d, R%2.2d", pc, mnemo, reg[0], reg[1])
- when "MOVC|Ri|R", "MOVX|Ri|R"
- vhdl_trans_list[pc] = instr_rr(opcode, reg[1], reg[0]);
- vhdl_tcl_list[pc] = tcl_bits_rr(pc, opcode, reg[1], reg[0])
- minstr_comment = format("0x%3.3X: %s (R%2.2d), R%2.2d", pc, mnemo, reg[1], reg[0])
- when "MOVC|Ri|K", "MOVX|Ri|K", "COUT|Ri|K", "XOUT|Ri|K"
- kk = kk % 256;
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- minstr_comment = format("0x%3.3X: %s (R%2.2d), 0x%2.2X", pc, mnemo, reg[0], kk)
- when "MOVC|R|Ki", "MOVX|R|Ki", "CIN|R|Ki", "XIN|R|Ki"
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- minstr_comment = format("0x%3.3X: %s R%2.2d, (0x%2.2X)", pc, mnemo, reg[0], kk)
- when "MOV|R|K", "SUB|R|K", "SUBC|R|K", "ADD|R|K", "ADDC|R|K", "AND|R|K", "OR|R|K", "XOR|R|K", "CMP|R|K"
- kk = kk % 256;
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- minstr_comment = format("0x%3.3X: %s R%2.2d, 0x%2.2X", pc, mnemo, reg[0], kk)
- when "SUB|K|R", "SUBC|K|R"
- kk = kk % 256;
- vhdl_trans_list[pc] = instr_kr(opcode, kk, reg[1]);
- vhdl_tcl_list[pc] = tcl_bits_kr(pc, opcode, kk, reg[1])
- minstr_comment = format("0x%3.3X: %s 0x%2.2d, R%2.2X", pc, mnemo, kk, reg[1])
- when "MOVC|Ki|R", "MOVC|Ki|R", "MOVX|Ki|R", "MOVX|Ki|R", "COUT|Ki|R", "XOUT|Ki|R"
- vhdl_trans_list[pc] = instr_kr(opcode, kk, reg[1]);
- vhdl_tcl_list[pc] = tcl_bits_kr(pc, opcode, kk, reg[1])
- minstr_comment = format("0x%3.3X: %s (0x%2.2X), R%2.2d", pc, mnemo, kk, reg[1])
- when "CALL|K", "JMP|K", "JNZ|K", "JZ|K","JNC|K", "JC|K", "JLT|K", "JGT|K", "JLE|K", "JGE|K", "JEQ|K", "JNE|K"
- vhdl_trans_list[pc] = instr_k(opcode, kk)
- vhdl_tcl_list[pc] = tcl_bits_k(pc, opcode, kk)
- minstr_comment = format("0x%3.3X: %s 0x%3.3X", pc, mnemo, kk)
- when "PUSH|R", "POP|R", "SHR|R", "SHL|R", "ROR|R", "ROL|R", "RORC|R", "ROLC|R", "SWAP|R"
- vhdl_trans_list[pc] = instr_r(opcode, reg[0])
- vhdl_tcl_list[pc] = tcl_bits_r(pc, opcode, reg[0])
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- # Synthetic instructions
- when "CLRC"
- kk = 0;
- minstr_comment = format("0x%3.3X: %s", pc, mnemo)
- opcode = mnemo_list.rindex("SUB|R|K").to_i
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- when "TST|R"
- kk = 0
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- opcode = mnemo_list.rindex("CMP|R|K").to_i
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- when "NEG|R"
- kk = 0
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- opcode = mnemo_list.rindex("SUB|K|R").to_i
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- when "NOT|R"
- kk = 0
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- opcode = mnemo_list.rindex("XOR|R|K").to_i
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- when "INC|R"
- kk = 1
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- opcode = mnemo_list.rindex("ADD|R|K").to_i
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- when "DEC|R"
- kk = 1
- minstr_comment = format("0x%3.3X: %s R%2.2d", pc, mnemo, reg[0])
- opcode = mnemo_list.rindex("SUB|R|K").to_i
- vhdl_trans_list[pc] = instr_rk(opcode, reg[0], kk);
- vhdl_tcl_list[pc] = tcl_bits_rk(pc, opcode, reg[0], kk)
- else
- STDERR.puts format("%s: Error in line %d: Not yet implemented %s", instruct[5], instruct[0], format)
- error = true
- end
-
- if error
- num_errors += 1
- break
- end
-
- vhdl_comment_list[pc] = minstr_comment
-
- puts vhdl_trans_list[pc] + " -- " + minstr_comment
-
- pc += 1
-end
-
-# --------------------------------------------------------
-# Output ROM file
-# --------------------------------------------------------
-if num_errors == 0
-
- # I-ROM VHDL-ROM
- filename = format("%s.irom.vhdl.snip", PROJECT_NAME)
- file = File.open(filename, "w")
-
- file.puts format("ENTITY %s IS\n", IROM_ENTITY_NAME)
- file.puts format("\tPort (\n")
- file.puts format("\tclk\t\t\t: in STD_LOGIC;\n")
- file.puts format("\tce\t\t\t: in STD_LOGIC;\n")
- file.puts format("\taddr\t\t: in %s;\n", IROM_ADDR_TYPE)
- file.puts format("\tdout\t\t: out %s\n", IROM_DATA_TYPE)
- file.puts format("\t);\n")
- file.puts format("END %s;\n", IROM_ENTITY_NAME)
- file.puts format("\n")
- file.puts format("ARCHITECTURE %s OF %s IS \n", PROJECT_NAME, IROM_ENTITY_NAME)
- file.puts format("\n")
- file.puts format("\ttype imem_rom_t is array (0 to %d) of %s;\n", [IROM_MAX_SIZE, pc].min-1 , IROM_DATA_TYPE)
- file.puts format("\n")
- file.puts format("\t-- Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
- file.puts format("\tconstant imem_rom : imem_rom_t :=\n")
- file.puts format("\t(\n");
- for i in (0..[IROM_MAX_SIZE, pc].min-2)
- file.puts "\t\t" + vhdl_trans_list[i] + ", -- " + vhdl_comment_list[i] + "\n"
- end;
- file.puts "\t\t" + vhdl_trans_list[pc-1] + " -- " + vhdl_comment_list[pc-1] + "\n"
- file.puts format("\t);\n")
- file.puts format("\n")
- file.puts format("begin")
- file.puts format("\n")
- file.puts format("PROM_READ:")
- file.puts format("\tprocess(clk, ce)\n")
- file.puts format("\tbegin\n")
- file.puts format("\t\tif rising_edge(clk) and ce = '1' then\n")
- file.puts format("\t\t\tdout <= imem_rom(to_integer(addr));\n")
- file.puts format("\t\tend if;\n")
- file.puts format("\tend process;\n")
- file.puts format("\n")
- file.puts format("end %s;\n", PROJECT_NAME)
- puts format("I-ROM file written to \"%s\"\n",filename)
- file.close
-
- # I-ROM VHDL-ROM (loadable)
- filename = format("%s.irom_ld.vhdl.snip", PROJECT_NAME)
- file = File.open(filename, "w")
-
- file.puts format("\n\t-- Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
- file.puts format("\ttype imem_rom_t is array (0 to %d) of %s;\n", IROM_MAX_SIZE-1, IROM_DATA_TYPE)
- file.puts format("\tsignal imem_rom : imem_rom_t :=\n")
- file.puts format("\t(\n");
- for i in (0..pc-2)
- file.puts "\t\t" + vhdl_trans_list[i] + ", -- " + vhdl_comment_list[i] + "\n"
- end;
- if pc < (IROM_MAX_SIZE-1)
- file.puts "\t\t" + vhdl_trans_list[pc-1] + ", -- " + vhdl_comment_list[pc-1] + "\n"
- for i in (pc..(IROM_MAX_SIZE-2))
- file.puts "\t\t" + instr(0) + ",\n"
- end;
- file.puts "\t\t" + instr(0) + "\n"
- else
- file.puts "\t\t" + vhdl_trans_list[pc-1] + " -- " + vhdl_comment_list[pc-1] + "\n"
- end
- file.puts format("\t);\n")
- puts format("I-ROM (loadable) file written to \"%s\"\n",filename)
- file.close
-
- # I-ROM TCL-Loader
- filename = format("%s.irom.tcl.snip", PROJECT_NAME)
- file = File.open(filename, "w")
- file.puts format("# Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
- file.puts format("# ---------------------------------------------------------------");
- file.puts format("# Shift the USER1 Instruction (b1111000010) into the Instruction Register of FPGA");
- file.puts format("# User 1")
- file.puts format("set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength \"3C2\"]\n\n")
- for i in (0..pc-1)
- # Chipscope 8.1
-# file.puts format("jtag_shiftdr $handle -buffer \"%s\" -endstate RTI -device $devid", vhdl_tcl_list[i].reverse);
-
- # Chipscope 9.1
- file.puts format("\# %s", vhdl_comment_list[i])
- file.puts format("::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 %d \"%8.8X\"\n\n", vhdl_tcl_list[i].length, vhdl_tcl_list[i].to_i(2));
- end;
- puts format("I-ROM TCL-loader written to \"%s\"\n",filename)
- file.close
-
- # X-ROM VHDL-ROM
- filename = format("%s.xrom.vhdl.snip", PROJECT_NAME)
- file = File.open(filename, "w")
-
- file.puts format("ENTITY %s IS\n", XROM_ENTITY_NAME)
- file.puts format("\tPort (\n")
- file.puts format("\tclk\t\t\t: in STD_LOGIC;\n")
- file.puts format("\tce\t\t\t: in STD_LOGIC;\n")
- file.puts format("\taddr\t\t: in %s;\n", XROM_ADDR_TYPE)
- file.puts format("\tdout\t\t: out %s\n", XROM_DATA_TYPE)
- file.puts format("\t);\n")
- file.puts format("END %s;\n", XROM_ENTITY_NAME)
- file.puts format("\n")
- file.puts format("ARCHITECTURE %s OF %s IS \n", PROJECT_NAME, XROM_ENTITY_NAME)
- file.puts format("\n")
- file.puts format("\ttype xmem_rom_t is array (0 to %d) of %s;\n", XROM_MAX_SIZE-1, XROM_DATA_TYPE)
- file.puts format("\n")
- file.puts format("\t-- Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
- file.puts format("\tconstant xmem_rom : xmem_rom_t :=\n")
- file.puts format("\t(\n");
- for i in (0..XROM_MAX_SIZE-2)
- file.puts format("\t\tX\"%2.2X\", -- 0x%2.2X\n", first_pass.xmem[i], i)
- end;
- i = XROM_MAX_SIZE-1
- file.puts format("\t\tX\"%2.2X\" -- 0x%2.2X\n", first_pass.xmem[i], i)
- file.puts format("\t);\n")
- file.puts format("\n")
- file.puts format("begin")
- file.puts format("\n")
- file.puts format("PROM_READ:")
- file.puts format("\tprocess(clk, ce)\n")
- file.puts format("\tbegin\n")
- file.puts format("\t\tif rising_edge(clk) and ce = '1' then\n")
- file.puts format("\t\t\tdout <= xmem_rom(to_integer(addr));\n")
- file.puts format("\t\tend if;\n")
- file.puts format("\tend process;\n")
- file.puts format("\n")
- file.puts format("end %s;\n", PROJECT_NAME)
- puts format("X-ROM file written to \"%s\"\n",filename)
- file.close
-
- # X-ROM VHDL-ROM (loadable)
- filename = format("%s.xrom_ld.vhdl.snip", PROJECT_NAME)
- file = File.open(filename, "w")
-
- file.puts format("\n\t-- Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
- file.puts format("\ttype xmem_rom_t is array (0 to %d) of %s;\n", XROM_MAX_SIZE-1, XROM_DATA_TYPE)
- file.puts format("\tsignal xmem_rom : xmem_rom_t :=\n")
- file.puts format("\t(\n");
- for i in (0..XROM_MAX_SIZE-2)
- file.puts format("\t\tX\"%2.2X\", -- 0x%2.2X\n", first_pass.xmem[i], i)
- end;
- i = XROM_MAX_SIZE-1
- file.puts format("\t\tX\"%2.2X\" -- 0x%2.2X\n", first_pass.xmem[i], i)
- file.puts format("\t);\n")
- puts format("X-ROM (loadable) file written to \"%s\"\n",filename)
- file.close
-
- # X-ROM JTAG-Loader
- filename = format("%s.xrom.tcl.snip", PROJECT_NAME)
- file = File.open(filename, "w")
- file.puts format("# Assembled from %s.%s", PROJECT_NAME, FILE_SUFFIX)
- file.puts format("# ---------------------------------------------------------------");
- file.puts format("# Shift the USER2 Instruction (b1111000011) into the Instruction Register of FPGA");
- file.puts format("# User 2")
- file.puts format("set result [::chipscope::csejtag_tap shift_device_ir $handle $devid $CSE_OP $CSE_ES 0 $irlength \"3C3\"]\n\n")
- for i in (0..first_pass.xmem.length-1)
- # Chipscope 8.1
-# file.puts format("jtag_shiftdr $handle -buffer \"%s\" -endstate RTI -device $devid", vhdl_tcl_list[i].reverse);
-
- # Chipscope 9.1
- file.puts format("::chipscope::csejtag_tap shift_device_dr $handle $devid $CSE_OP $CSE_ES 0 %d \"%2.2X%2.2X\"\n", 16, i, first_pass.xmem[i]);
- end;
- puts format("X-ROM TCL-loader written to \"%s\"\n",filename)
- file.close
-
-end
-
-# --------------------------------------------------------
-# Output final statistics
-# --------------------------------------------------------
-if num_errors == 0
- puts "Program uses #{first_pass.pc_max} instruction addresses"
- puts "No errors found"
- exit 0
-else
- puts "#{num_errors} errors found"
- exit 1
-end
-
diff --git a/lib/CPUs/JCpu/tools/lib/cg.inc.jsm b/lib/CPUs/JCpu/tools/lib/cg.inc.jsm
deleted file mode 100644
index 01c36c4..0000000
--- a/lib/CPUs/JCpu/tools/lib/cg.inc.jsm
+++ /dev/null
@@ -1,72 +0,0 @@
-; -------------------------------------------------
-; lcd.inc.jsm
-; -------------------------------------------------
-; needs xio-address equates for
-; reg_cg_char_addr: equ 0xXX ; RW
-; reg_cg_line_addr: equ 0xXX ; RW
-; reg_cg_data: equ 0xXX ; RW
-; reg_cg_ctrl: equ 0xXX ; WO
-
-; needs delay.inc.jsm
-
-; -------------------------------------------------
-cg_clr_line: push R0
- mov R0, 2
- xout (reg_cg_ctrl), R0
- pop R0
- ret
-
-; -------------------------------------------------
-cg_clr_screen: push R0
- mov R0, 1
- xout (reg_cg_ctrl), R0
- pop R0
- ret
-
-; -------------------------------------------------
-; R0 : char address
-; R1 : line address
-cg_set_addr: call cg_wait_rdy
- xout (reg_cg_line_addr), R1
- xout (reg_cg_char_addr), R0
- ret
-
-; -------------------------------------------------
-; R0 : character
-cg_putchar: call cg_wait_rdy
- xout (reg_cg_data), R0
- ret
-
-; -------------------------------------------------
-; R1 : ptr to string
-cg_puts: push R0
-cg_p_lp: movx R0, (R1)
- inc R1
- tst R0
- jz ex_cgp
- call cg_putchar
- jmp cg_p_lp
-ex_cgp: pop R0
- ret
-
-; -------------------------------------------------
-; R1 : ptr to string
-cg_clr_puts: call cg_clr_line
- call cg_puts
- ret
-
-; -------------------------------------------------
-; R1 : ptr to string
-cg_puts_clr: call cg_puts
- call cg_clr_line
- ret
-
-; -------------------------------------------------
-cg_wait_rdy: push R0
-cg_wr_lp: xin R0, (reg_hwstat)
- and R0, 0x02
- jz cg_wr_lp
- pop R0
- ret
-
-; -------------------------------------------------
diff --git a/lib/CPUs/JCpu/tools/lib/cregs.inc.jsm b/lib/CPUs/JCpu/tools/lib/cregs.inc.jsm
deleted file mode 100644
index 06d39d9..0000000
--- a/lib/CPUs/JCpu/tools/lib/cregs.inc.jsm
+++ /dev/null
@@ -1,7 +0,0 @@
-; JCPU On-Chip register
-cpu_revision: equ 0x00 ; RO
-cpu_control: equ 0x01 ; R/W
-cpu_status: equ 0x02 ; RO
-cpu_int_ctrl: equ 0x03 ; RW
-cpu_cmem_high: equ 0x04 ; RW
-cpu_stack_high: equ 0x05 ; RW
diff --git a/lib/CPUs/JCpu/tools/lib/delays.inc.jsm b/lib/CPUs/JCpu/tools/lib/delays.inc.jsm
deleted file mode 100644
index 6f002ee..0000000
--- a/lib/CPUs/JCpu/tools/lib/delays.inc.jsm
+++ /dev/null
@@ -1,64 +0,0 @@
-; -------------------------------------------------
-; Delays
-; -------------------------------------------------
-delay1s: push R15
- mov R15, 10
-loop1s: call delay100ms
- dec R15
- jnz loop1s
- pop R15
- ret
-
-delay100ms: push R15
- mov R15, 10
-loop100ms: call delay10ms
- dec R15
- jnz loop100ms
- pop R15
- ret
-
-delay10ms: push R15
- mov R15, 10
-loop10ms: call delay1ms
- dec R15
- jnz loop10ms
- pop R15
- ret
-
-delay1ms: push R15
- mov R15, 10
-loop1ms: call delay100us
- dec R15
- jnz loop1ms
- pop R15
- ret
-
-delay100us: push R15
- mov R15, 10
-loop100us: call delay10us
- dec R15
- jnz loop100us
- pop R15
- ret
-
-delay10us: push R15
- mov R15, 99
-loop10us: nop
- nop
- nop
- dec R15
- jnz loop10us
- pop R15
- ret
-
-delay1us: push R15
- mov R15, 9
-loop1us: nop
- nop
- nop
- dec R15
- jnz loop1us
- pop R15
- ret
-
-; -------------------------------------------------
diff --git a/lib/CPUs/JCpu/tools/lib/lcd.inc.jsm b/lib/CPUs/JCpu/tools/lib/lcd.inc.jsm
deleted file mode 100644
index d2883fa..0000000
--- a/lib/CPUs/JCpu/tools/lib/lcd.inc.jsm
+++ /dev/null
@@ -1,208 +0,0 @@
-; -------------------------------------------------
-; lcd.inc.jsm
-; -------------------------------------------------
-; needs xmem-address definition for
-; - lcd_port (LCD-Base)
-
-; needs delay.inc.jsm
-
-; -------------------------------------------------
-lcd_cmd: equ 0x00
-lcd_rd: equ 0x20
-lcd_data: equ 0x40
-lcd_enable: equ 0x80
-
-LCD_CMD_Z1: equ 0x80
-LCD_CMD_Z2: equ 0xC0
-LCD_CMD_CLEAR: equ 0x01
-
-; -------------------------------------------------
-; Init LCD
-; -------------------------------------------------
-LCD_init: mov R2, 0x00
- mov R0, 0x03
- call _write_lcd
- call delay10ms
- mov R2, 0x00
- mov R0, 0x03
- call _write_lcd
- call delay10ms
-
- mov R2, 0x00
- mov R0, 0x02
- call _write_lcd
- call delay1ms
-
- ; 1. Function set: 4-Bit mode, two display lines
- mov R0, 0x28
- call LCD_writecmd
-
- ; 2. Display on, no cursor
- mov R0, 0x0C
- call LCD_writecmd
-
- ; 3. Cursor shift during write
- mov R0, 0x06
- call LCD_writecmd
-
- ; 4. Display clear
- mov R0, 0x01
- call LCD_writecmd
-
- ret
-
-; -------------------------------------------------
-; LCD_waitbsy
-; -------------------------------------------------
-LCD_waitbsy: push R0
-bsy_loop: call LCD_readstat
- and R0, 0x80
- jz ex_bsy
- call delay1us
- jmp bsy_loop
-ex_bsy: pop R0
- ret
-
-; -------------------------------------------------
-; LCD_writecmd
-; -------------------------------------------------
-; R0 = cmd
-LCD_writeaddr:
-LCD_writecmd: push R2
- mov R2, lcd_cmd
- call LCD_write
- pop R2
- ret
-
-; -------------------------------------------------
-; LCD_putsx
-; -------------------------------------------------
-; R1 = address of null-terminated string in XMEM
-LCD_putsx: push R0
-putsx_loop: movx R0, (R1)
- inc R1
- tst R0
- jz putsx_ex
- call LCD_writechar
- jmp putsx_loop
-putsx_ex: pop R0
- ret
-
-; -------------------------------------------------
-; LCD_putsc
-; -------------------------------------------------
-; R1 = address of null-terminated string in CMEM
-LCD_putsc: push R0
-putsc_loop: movc R0, (R1)
- inc R1
- tst R0
- jz putsc_ex
- call LCD_writechar
- jmp putsc_loop
-putsc_ex: pop R0
- ret
-
-; -------------------------------------------------
-; LCD_writechar
-; -------------------------------------------------
-; R0 = char
-LCD_writedata:
-LCD_writechar: push R2
- mov R2, lcd_data
- call LCD_write
- pop R2
- ret
-
-; -------------------------------------------------
-; LCD_write
-; -------------------------------------------------
-; R0 = input
-; R2 = register
-LCD_write: call LCD_waitbsy
- push R0
- swap R0
- call _write_lcd
- pop R0
- call _write_lcd
- ret
-
-; -------------------------------------------------
-; LCD_readstat
-; -------------------------------------------------
-; R0 = status
-LCD_readstat: push R2
- mov R2, lcd_cmd
- call LCD_read
- pop R2
- ret
-
-; -------------------------------------------------
-; LCD_read
-; -------------------------------------------------
-; R0 = output
-; R2 = register
-LCD_read: call _read_lcd
- swap R0
- push R0
- call _read_lcd
- pop R2
- or R0, R2
- ret
-
-; -------------------------------------------------
-; _write
-; -------------------------------------------------
-; R0 = input
-_write_lcd: push R1
-
- and R0, 0x0F
- mov R1, R0
- or R1, R2
- xout (lcd_port), R1
- call delay1us
-
- mov R1, R0
- or R1, R2
- or R1, lcd_enable
- xout (lcd_port), R1
- call delay1us
-
- mov R1, R0
- or R1, R2
- xout (lcd_port), R1
- call delay1us
-
- or R1, lcd_rd
- xout (lcd_port), R1
-
- pop R1
- ret
-
-; -------------------------------------------------
-; _read
-; -------------------------------------------------
-; R0 = output
-_read_lcd: push R1
-
- mov R1, lcd_rd
- or R1, R2
- xout (lcd_port), R1
- call delay1us
-
- mov R1, lcd_rd
- or R1, R2
- or R1, lcd_enable
- xout (lcd_port), R1
- call delay1us
- xin R0, (lcd_port)
- and R0, 0x0F
-
- mov R1, lcd_rd
- or R1, R2
- xout (lcd_port), R1
- call delay1us
-
- pop R1
- ret
-
-
\ No newline at end of file
diff --git a/lib/CPUs/JCpu/tools/lib/mul8x8.inc.jsm b/lib/CPUs/JCpu/tools/lib/mul8x8.inc.jsm
deleted file mode 100644
index 2f66e2a..0000000
--- a/lib/CPUs/JCpu/tools/lib/mul8x8.inc.jsm
+++ /dev/null
@@ -1,42 +0,0 @@
-; -------------------------------------------------
-; mul8x8.inc.jsm
-; -------------------------------------------------
-
-; -------------------------------------------------
-; Parameter:
-; R0 : operand 1
-; R1 : operand 2
-; Return:
-; R0 : product low
-; R1 : product high
-mul8x8: push R2
- push R3
- push R4
-
- mov R4, R1
- mov R1, 0
- mov R2, 0
- mov R3, 0
-
-loop1: cmp R4, 0x01
- jeq ende1
-
- shr R4
- jnc next1
-
- add R2, R0
- addc R3, R1
-
-next1: shl R0
- rolc R1
- jmp loop1
-
-ende1: add R0, R2
- addc R1, R3
-
- pop R4
- pop R3
- pop R2
- ret
-
-; -------------------------------------------------
diff --git a/lib/CPUs/JCpu/tools/lib/uart.inc.jsm b/lib/CPUs/JCpu/tools/lib/uart.inc.jsm
deleted file mode 100644
index 1733305..0000000
--- a/lib/CPUs/JCpu/tools/lib/uart.inc.jsm
+++ /dev/null
@@ -1,32 +0,0 @@
-; -------------------------------------------------
-; uart.inc.jsm
-; -------------------------------------------------
-; needs xmem-address definition for
-; - uart_status (Status register)
-; - uart_data (Data register)
-
-; -------------------------------------------------
-; sout
-; -------------------------------------------------
-; R0 = input
-sout: push R1
-sout1: xin R1, (uart_status)
- and R1, 0x02
- jnz sout1
- xout (uart_data), R0
- pop R1
- ret
-
-; -------------------------------------------------
-; sin
-; -------------------------------------------------
-; R0 = output
-sin: push R1
-sin1: xin R1, (uart_status)
- and R1, 0x10
- jnz sin1
- xin R0, (uart_data)
- pop R1
- ret
-
-; -------------------------------------------------
diff --git a/lib/CPUs/JCpu/tools/lib/utils.inc.jsm b/lib/CPUs/JCpu/tools/lib/utils.inc.jsm
deleted file mode 100644
index f354d7c..0000000
--- a/lib/CPUs/JCpu/tools/lib/utils.inc.jsm
+++ /dev/null
@@ -1,32 +0,0 @@
-; -------------------------------------------------
-; utils.inc.jsm
-; -------------------------------------------------
-
-
-; -------------------------------------------------
-; Parameter
-; R0 : Bin value in lower nibble
-; Return
-; R0 : Hex character representing lower nibble
-nibble2hex: and R0, 0x0F
- cmp R0, 0x0A
- jlt isNum1
- add R0, 0x07
-isNum1: add R0, 0x30
- ret
-
-; -------------------------------------------------
-; Parameter
-; R0 : Bin value
-; Return
-; R0 : Hex character high
-; R1 : Hex character low
-bin2hex: push R0
- call nibble2hex
- mov R1, R0
- pop R0
- swap R0
- call nibble2hex
- ret
-
-; -------------------------------------------------
diff --git a/lib/CPUs/JCpu/tools/opc.list b/lib/CPUs/JCpu/tools/opc.list
deleted file mode 100644
index 59b3cfa..0000000
--- a/lib/CPUs/JCpu/tools/opc.list
+++ /dev/null
@@ -1,64 +0,0 @@
-0 NOP
-1 HALT
-2 MOV|R|R
-3 MOV|R|K
-4 MOVX|R|Ri
-5 MOVX|R|Ki
-6 MOVX|Ri|R
-7 MOVX|Ri|K
-8 MOVX|Ki|R
-9 MOVC|R|Ri
-10 MOVC|R|Ki
-11 MOVC|Ri|R
-12 MOVC|Ri|K
-13 MOVC|Ki|R
-14 CMP|R|R
-15 CMP|R|K
-16 ADD|R|R
-17 ADD|R|K
-18 ADDC|R|R
-19 ADDC|R|K
-20 SUB|R|R
-21 SUB|R|K
-22 SUBC|R|R
-23 SUBC|R|K
-24 AND|R|R
-25 AND|R|K
-26 OR|R|R
-27 OR|R|K
-28 XOR|R|R
-29 XOR|R|K
-30 SHL|R
-31 SHR|R
-32 ROL|R
-33 ROR|R
-34 ROLC|R
-35 RORC|R
-36 XOUT|Ki|R
-37 XOUT|Ri|K
-38 COUT|Ki|R
-39 COUT|Ri|K
-40 XIN|R|Ki
-41 CIN|R|Ki
-42 SWAP|R
-43 SETC
-44 UNDEF
-45 UNDEF
-46 SUB|K|R
-47 SUBC|K|R
-48 JMP|K
-49 JZ|K
-50 JNZ|K
-51 JC|K
-52 JNC|K
-53 JLT|K
-54 JGT|K
-55 JLE|K
-56 JGE|K
-57 JEQ|K
-58 JNE|K
-59 CALL|K
-60 PUSH|R
-61 POP|R
-62 RET
-63 RETI
diff --git a/lib/CPUs/JCpu/tools/regx.rb b/lib/CPUs/JCpu/tools/regx.rb
deleted file mode 100644
index 47775c9..0000000
--- a/lib/CPUs/JCpu/tools/regx.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env ruby
-
-st = "\033[7m"
-en = "\033[m"
-
- while TRUE
- print "str> "
- STDOUT.flush
- str = gets
- break if not str
- str.chop!
- print "pat> "
- STDOUT.flush
- re = gets
- break if not re
- re.chop!
- str.gsub! re, "#{st}\\{en}"
- print str, "\n"
-end
-print "\n"
diff --git a/lib/CPUs/JCpu/tools/rom.tcl.tpl b/lib/CPUs/JCpu/tools/rom.tcl.tpl
deleted file mode 100644
index 9f5c0dc..0000000
--- a/lib/CPUs/JCpu/tools/rom.tcl.tpl
+++ /dev/null
@@ -1,61 +0,0 @@
-# ----------------------------------------------------------------------
-# Project: JCPU, a portable 8-bit RISC CPU written in VHDL
-# This file: The ROM file for upload to target over JTAG
-#
-# Copyright (C) 2007 J. Ahrensfeld
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# For questions and ideas, please contact the author at jens@jayfield.org
-#
-# ---------------------------------------------------------------------
-
-# ---------------------------------------------------------------------
-# For Chipscope 9.1
-# ---------------------------------------------------------------------
-# Source JTAG/TCL frame work
-cd $env(CHIPSCOPE)\\bin\\nt
-source csejtag.tcl
-
-namespace import ::chipscope::*
-
-# Platform USB Cable
-set PLATFORM_USB_CABLE_ARGS [list "port=USB2" "frequency=6000000"]
-# frequency="24000000 | 12000000 | 6000000 | 3000000 | 1500000 | 750000"
-
-# Create session
-set handle [::chipscope::csejtag_session create 0]
-
-# Open JTAG and lock
-set open_result [::chipscope::csejtag_target open $handle $CSEJTAG_TARGET_PLATFORMUSB 0 $PLATFORM_USB_CABLE_ARGS]
-set lock_result [::chipscope::csejtag_target lock $handle 1000]
-
-set devlist [::chipscope::csejtag_tap autodetect_chain $handle $CSEJTAG_SCAN_DEFAULT]
-
-# Get Device ID
-set devtype "Virtex-4SX"
-set devid 2
-set irlength [::chipscope::csejtag_tap get_irlength $handle $devid]
-set idcode [::chipscope::csejtag_tap get_device_idcode $handle $devid]
-
-set CSE_OP $CSEJTAG_SHIFT_READWRITE
-set CSE_ES $CSEJTAG_RUN_TEST_IDLE
-
-# Write Program
-# JASM_ROM_INSERT_HERE
-
-::chipscope::csejtag_target unlock $handle
-::chipscope::csejtag_target close $handle
-::chipscope::csejtag_session destroy $handle
-exit
diff --git a/lib/CPUs/JCpu/tools/templates.rb b/lib/CPUs/JCpu/tools/templates.rb
deleted file mode 100644
index 632f11c..0000000
--- a/lib/CPUs/JCpu/tools/templates.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env ruby
-
-
-template = <<'END'
- -- (tv #1342) read output FIFO
- (
- cycles => 1,
- cm_i => bus_read_init(addr => ADDR_KS_OFIFO_DOUT),
- sep => msg(""),
- cm_o => bus_no_ack,
- irq => (others => '0')
- ),
-
- -- (tv #1343) wait while FIFO is read
- (
- cycles => 2,
- cm_i => bus_wait_ack,
- sep => msg(""),
- cm_o => bus_no_ack,
- irq => (others => '0')
- ),
-
- -- (tv #1343) wait for ack
- (
- cycles => 1,
- cm_i => bus_wait_ack,
- sep => msg(""),
- cm_o => bus_read_ack(dat => #{exp_data}),
- irq => (others => '0')
- ),
-
-END
-
-puts "KS-128 testvectors:\n"
-puts "\n" * 3
-
-
-0.upto(10) { |sk_no|
- 3.downto(0) { |sl_no|
- exp_data = "slice_32(TC1_SUBKEYS(#{sk_no}), #{sl_no})"
- t = template.gsub(/"/, '\\"')
- puts eval("format(\"#{t}\")")
- }
-}
diff --git a/lib/CPUs/JCpu/tools/xrom.vhd.tpl b/lib/CPUs/JCpu/tools/xrom.vhd.tpl
deleted file mode 100644
index 5f11f86..0000000
--- a/lib/CPUs/JCpu/tools/xrom.vhd.tpl
+++ /dev/null
@@ -1,32 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: The ROM file for use in your VHDL design
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library work;
-use work.cpu_pkg.all;
-
--- JASM_ROM_INSERT_HERE
-
diff --git a/lib/CPUs/JCpu/tools/xrom_ld.vhd.tpl b/lib/CPUs/JCpu/tools/xrom_ld.vhd.tpl
deleted file mode 100644
index 696487f..0000000
--- a/lib/CPUs/JCpu/tools/xrom_ld.vhd.tpl
+++ /dev/null
@@ -1,151 +0,0 @@
--------------------------------------------------------------------------
--- Project: JCPU, a portable 8-bit RISC CPU written in VHDL
--- This file: loadable ROM
---
--- Copyright (C) 2007 J. Ahrensfeld
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 3 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful,
--- but WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--- GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
---
--- For questions and ideas, please contact the author at jens@jayfield.org
---
---------------------------------------------------------------------------
-
-LIBRARY ieee;
-use IEEE.STD_LOGIC_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-library UNISIM;
-use UNISIM.VComponents.all;
-
-library work;
-use work.cpu_pkg.all;
-
-ENTITY xrom IS
- Port (
- clk : in STD_LOGIC;
- ce : in STD_LOGIC;
- addr : in dmem_addr_t;
- dout : out dmem_data_t
- );
-
-END xrom;
-
-ARCHITECTURE loadable OF xrom IS
-
- -- JASM_ROM_INSERT_HERE
-
- signal jtag_ld_clk : STD_LOGIC;
- signal jtag_ld_we : STD_LOGIC;
- signal jtag_ld_addr : dmem_addr_t;
- signal jtag_ld_dout : dmem_data_t;
- signal jtag_ld_din : dmem_data_t;
- signal bs_rst, bs_sel, bs_shift, bs_tdi, bs_tdo : std_logic;
- signal bs_capture, bs_clk0, bs_clk1, bs_update0, bs_update1 : std_logic;
- signal user_regi, user_rego : unsigned (15 downto 0);
- constant id : unsigned (15 downto 0) := X"BEEF";
-
-begin
-
---------------------------------------------------------------------------
--- Virtex-4: JTAG Loader
---------------------------------------------------------------------------
- i00_BUFG : BUFG
- port map
- (
- O => bs_clk1,
- I => bs_clk0
- );
-
- i01_BUFG : BUFG
- port map
- (
- O => bs_update1,
- I => bs_update0
- );
-
- BSCAN_VIRTEX4_inst2 : BSCAN_VIRTEX4
- generic map
- (
- JTAG_CHAIN => 2 -- Value to set BSCAN site of device. Possible values: (1,2,3 or 4)
- )
- port map
- (
- CAPTURE => bs_capture, -- CAPTURE output from TAP controller
- DRCK => bs_clk0, -- Data register output for USER functions
- RESET => bs_rst, -- Reset output from TAP controller
- SEL => bs_sel, -- USER active output
- SHIFT => bs_shift, -- SHIFT output from TAP controller
- TDI => bs_tdi, -- TDI output from TAP controller
- UPDATE => bs_update0, -- UPDATE output from TAP controller
- TDO => bs_tdo -- Data input for USER function
- );
-
- jtag_ld_addr <= user_regi(user_regi'left downto user_regi'left-dmem_data_t'length+1);
- jtag_ld_din <= user_regi(dmem_data_t'left downto 0);
- jtag_ld_clk <= bs_update1;
- jtag_ld_we <= bs_sel;
-
-sipo:
- process (bs_rst, bs_clk1, bs_tdi, bs_shift)
- begin
- if bs_rst = '1' then
- user_regi <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_regi <= bs_tdi & user_regi(user_regi'left downto 1);
- end if;
- end if;
- end process;
-
-piso:
- process (bs_rst, bs_clk1, bs_shift, user_rego)
- begin
- bs_tdo <= user_rego(0);
- if bs_rst = '1' then
- user_rego <= (others => '0');
- elsif rising_edge(bs_clk1) then
- if bs_shift = '1' then
- user_rego <= user_rego(0) & user_rego(user_rego'left downto 1);
- else
- user_rego <= (user_rego'left downto dmem_data_t'length => '0') & jtag_ld_dout;
--- user_rego <= id;
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
--- ROM Read/Write
---------------------------------------------------------------------------
-PROM_READ:
- process(clk, ce)
- begin
- if rising_edge(clk) and ce = '1' then
- dout <= xmem_rom(to_integer(addr));
- end if;
- end process;
-
-PROM_WRITE:
- process(jtag_ld_clk, jtag_ld_we)
- begin
- if rising_edge(jtag_ld_clk) then
- if jtag_ld_we = '1' then
- xmem_rom(to_integer(jtag_ld_addr)) <= jtag_ld_din;
- else
- jtag_ld_dout <= xmem_rom(to_integer(jtag_ld_addr));
- end if;
- end if;
- end process;
-
---------------------------------------------------------------------------
-end loadable;
diff --git a/lib/CPUs/MIPS/bsp/examples/.directory_history b/lib/CPUs/MIPS/bsp/examples/.directory_history
deleted file mode 100644
index b367532..0000000
--- a/lib/CPUs/MIPS/bsp/examples/.directory_history
+++ /dev/null
@@ -1,34 +0,0 @@
-VHDL/lib/CPUs/MIPS/bsp/examples/dbg.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/irq.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/irq.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/kernel.S
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/mips_gfx.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/mips_gfx.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/mips_ps2.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/mips_ps2.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/mipsdis.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/mipsdis.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/regdef.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/startup.S
-
-VHDL/lib/CPUs/MIPS/bsp/examples/xcpt.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/xcpt.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/xcpt_asm.h
-
diff --git a/lib/CPUs/MIPS/bsp/examples/Bessel.c b/lib/CPUs/MIPS/bsp/examples/Bessel.c
deleted file mode 100644
index 080fe17..0000000
--- a/lib/CPUs/MIPS/bsp/examples/Bessel.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/************************************************************************/
-/* Ein Programm zur Berechnung der Bessel-Koeffizienten Jn
-/* Dateiname : Bessel.cpp
-/* Autoren : T. Burr, J. Ahrensfeld
-/* Datum : 28.10.1999
-/* letzte Änderung : 28.01.2000
-/* Version : 1.0
-/************************************************************************/
-
-#include "stdio.h"
-#include "math.h"
-#include "stdlib.h"
-
-
-#define MAX_SUM 25
-#define VERSION "1.0"
-
-/************************************************************************/
-/* Funktionsdeklarationen */
-/************************************************************************/
-// Fakultätsberechnung
-double fak (int N)
-{
- int index;
- double erg=1;
-
- for (index = 1; index <= N; index++)
- erg = erg * index;
-
- return erg;
-}
-
-// Bessel()
-// Berechnung von Jn von mfm
-double bessel(int n, double mfm)
-{
- int m;
- double Jn=0;
-
- for (m=0; m < MAX_SUM; m++)
- {
- Jn = Jn + (pow(-1.0,m)/(fak(m)*fak(m+n))*pow(mfm/2.0,(2*m+n)));
- }
- return Jn;
-}
-
-
-/************************************************************************/
-/* Das Hauptprogramm
-/************************************************************************/
-void main()
-{
-
- int N, Nmax;
- double erg;
- float mfm;
-
- printf("\n\t Besselfunktion Version %s",VERSION);
- printf("\n\t ~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
- printf("\n\tCopyright by J. Ahrensfeld & T. Burr\n\n");
-
-// ---------------------------------------------------------------------------------
- // Benutzereingaben
- printf("\nBerechnungen fuer J = 0...");
- if(scanf("%d",&Nmax)==0)
- exit (-1);
-
- printf("Bitte Modulationsindex eingeben : ");
- if(scanf("%f",&mfm)==0)
- exit(-1);
-
- printf("\n");
-
-// ---------------------------------------------------------------------------------
- // Berechnung
- for (N=0; N <= Nmax; N++)
- {
- erg = bessel(N,(double)mfm);
- printf("J(%d) = %10.8f\n",N,erg);
- }
-
- printf("FERTIG.\n");
-
- }
-
-/************************************************************************/
-
diff --git a/lib/CPUs/MIPS/bsp/examples/Makefile b/lib/CPUs/MIPS/bsp/examples/Makefile
deleted file mode 100644
index 71d95b0..0000000
--- a/lib/CPUs/MIPS/bsp/examples/Makefile
+++ /dev/null
@@ -1,333 +0,0 @@
-ENDIAN='big'
-
-ifeq ($(ENDIAN), 'big')
- ENDIAN_FLAGS=-EB
- CFLAGS=$(ENDIAN_FLAGS) -specs=specs/eb/specs -msoft-float -O2 -march=r3000 -I. -Ilibsys -Wl,-M
-else
- ENDIAN_FLAGS=-EL
- CFLAGS=$(ENDIAN_FLAGS) -specs=specs/specs -msoft-float -O2 -march=r3000 -I. -Ilibsys -Wl,-M
-endif
-
-LIBS=-lm -lsys
-
-AS=mipsel-elf-as
-AR=mipsel-elf-ar
-CC=mipsel-elf-gcc
-LD=mipsel-elf-ld
-OBJDUMP=mipsel-elf-objdump
-OBJCOPY=mipsel-elf-objcopy
-FLASHGEN=flashgen
-
-PROG = hello.elf testbench.elf test_irq.elf dhry.elf queens.elf stanford.elf paranoia.elf rmd160_test.elf Bessel.elf whet.elf phrasen.elf dttl.elf richards_benchmark.elf test_exception.elf life.elf r3.elf gunzip.elf basic_math.elf jman_patches.elf jman_patchmeshes.elf jman_polys.elf test_hpi.elf test_vga.elf
-
-all: $(PROG)
-
-libsys.a:
- $(MAKE) -C libsys
-
-hello.elf: hello.c libsys.a
- $(CC) $(CFLAGS) -o $@ -Os hello.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-testbench.elf: testbench.c libsys.a
- $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 -DNOSIGNAL -DBATCHMODE -DNOMAIN -Os -g testbench.c paranoia.c delay_mips.c bogomips.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-test_irq.elf: test_irq.c libsys.a
- $(CC) $(CFLAGS) -o $@ test_irq.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-dhry.elf: dhry_1.c dhry_2.c dhry.h libsys.a
- $(CC) $(CFLAGS) -o $@ -DHZ=1000 dhry_1.c dhry_2.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-queens.elf: queens.c libsys.a
- $(CC) $(CFLAGS) -o $@ -DUNIX_Old -DHZ=1000 queens.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-stanford.elf: stanford.c libsys.a
- $(CC) $(CFLAGS) -O3 -o $@ -DHZ=1000 stanford.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-paranoia.elf: paranoia.c libsys.a
- $(CC) $(CFLAGS) -O3 -o $@ -DNOSIGNAL -DBATCHMODE paranoia.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-rmd160_test.elf: rmd160_test.c rmd160.c rmd160.h libsys.a
- $(CC) $(CFLAGS) -O3 -o $@ rmd160_test.c rmd160.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-hashtest.elf: hashtest.c rmd160.c rmd160.h libsys.a
- $(CC) $(CFLAGS) -O3 -o $@ hashtest.c rmd160.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-Bessel.elf: Bessel.c libsys.a
- $(CC) $(CFLAGS) -o $@ Bessel.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-whet.elf: whet.c libsys.a
- $(CC) $(CFLAGS) -o $@ whet.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-phrasen.elf: phrasen.c libsys.a
- $(CC) $(CFLAGS) -o $@ phrasen.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-dttl.elf: dttl.c random.c libsys.a
- $(CC) $(CFLAGS) -o $@ dttl.c random.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-richards_benchmark.elf: richards_benchmark.c libsys.a
- $(CC) $(CFLAGS) -o $@ richards_benchmark.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-test_exception.elf: test_exception.c libsys.a
- $(CC) $(CFLAGS) -o $@ -O1 test_exception.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-life.elf: life.c libsys.a
- $(CC) $(CFLAGS) -o $@ -g life.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-r3.elf: r3.c libsys.a
- $(CC) $(CFLAGS) -O3 -o $@ -DJMIPS_VGA -O2 r3.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-gunzip.elf: gunzip.c inflate.c crc32.c libsys.a
- $(CC) $(CFLAGS) -o $@ -o $@ gunzip.c inflate.c crc32.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-basic_math.elf: basicmath_small.c rad2deg.c cubic.c isqrt.c libsys.a
- $(CC) $(CFLAGS) -o $@ -o $@ basicmath_small.c rad2deg.c cubic.c isqrt.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-JMAN_SRC= \
- jman/bintree.c \
- jman/camset.c \
- jman/engine.c \
- jman/graph_state.c \
- jman/grid.c \
- jman/imageio.c \
- jman/linklist.c \
- jman/matrix.c \
- jman/object.c \
- jman/render.c \
- jman/ri.c \
- jman/ribgen.c \
- jman/stack.c \
- jman/vars.c
-
-jman_patches.elf: $(JMAN_SRC) jman/main_patches.c libsys.a
- $(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_patches.c $(JMAN_SRC) $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-jman_patchmeshes.elf: $(JMAN_SRC) jman/main_patchmeshes.c jman/patches2.c libsys.a
- $(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_patchmeshes.c jman/patches2.c $(JMAN_SRC) $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-jman_polys.elf: $(JMAN_SRC) jman/main_polypin.c jman/polys.c libsys.a
- $(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_polypin.c jman/polys.c $(JMAN_SRC) $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-serdump.elf: serdump.c libsys.a
- $(CC) $(CFLAGS) -O3 -o $@ -O2 serdump.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-pppi.elf: pppissue/test1.c pppissue/utils.c pppissue/pppd.h libsys.a
- $(CC) $(CFLAGS) -O2 -o $@ -O2 pppissue/test1.c pppissue/utils.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-lwl.elf: lwl.c libsys.a
- $(CC) $(CFLAGS) -O2 -o $@ lwl.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-ucb.elf: ucb.c libsys.a
- $(CC) $(CFLAGS) -O2 -o $@ ucb.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-test_hpi.elf: hpi.c test_hpi.c cfiflash.c libsys.a
- $(CC) $(CFLAGS) -o $@ -g hpi.c test_hpi.c cfiflash.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin
- cat $@.srec | packhex > $@.pack
-
-test_vga.elf: test_vga.c libsys.a
- $(CC) $(CFLAGS) -o $@ test_vga.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-barcode.elf: barcode.c libsys.a
- $(CC) $(CFLAGS) -o $@ barcode.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-lua.elf: lua_init.c libsys.a
- $(CC) $(CFLAGS) -I./lua-5.1.4/etc -I./lua-5.1.4/src -o $@ lua_init.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-mandelbrot.elf: mandelbrot.c libsys.a
- $(CC) $(CFLAGS) -o $@ mandelbrot.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-bogomips.elf: bogomips.c delay_mips.c libsys.a
- $(CC) $(CFLAGS) -DHZ=1000 -o $@ bogomips.c delay_mips.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-test_asm.elf: test_asm.S libsys.a
- $(CC) $(CFLAGS) -DHZ=1000 -o $@ test_asm.S $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-test_ac97.elf: test_ac97.c libsys.a
- $(CC) $(CFLAGS) -o $@ test_ac97.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-test_dcache.elf: test_dcache.c libsys.a
- $(CC) $(CFLAGS) -O0 -o $@ test_dcache.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-aes256_1.elf: aes256_1.c aes256.c aes256.h libsys.a
- $(CC) $(CFLAGS) -O3 -o $@ aes256_1.c aes256.c $(LIBS) >$@.map
- $(OBJDUMP) -d $@ > $@.dis
- $(OBJCOPY) $@ -O binary $@.bin
- $(OBJCOPY) -O srec $@ $@.srec
- $(FLASHGEN) $@.bin $(ENDIAN_FLAGS)
- cat $@.srec | packhex > $@.pack
-
-clean:
- rm -rf *.a *.o *.bin *.map *.dis *.srec *.pack *.elf $(PROG) > /dev/null
diff --git a/lib/CPUs/MIPS/bsp/examples/aes256.c b/lib/CPUs/MIPS/bsp/examples/aes256.c
deleted file mode 100644
index 97a5136..0000000
--- a/lib/CPUs/MIPS/bsp/examples/aes256.c
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
-* Byte-oriented AES-256 implementation.
-* All lookup tables replaced with 'on the fly' calculations.
-*
-* Copyright (c) 2007-2009 Ilya O. Levin, http://www.literatecode.com
-* Other contributors: Hal Finney
-*
-* Permission to use, copy, modify, and distribute this software for any
-* purpose with or without fee is hereby granted, provided that the above
-* copyright notice and this permission notice appear in all copies.
-*
-* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
-#include "aes256.h"
-
-#define F(x) (((x)<<1) ^ ((((x)>>7) & 1) * 0x1b))
-#define FD(x) (((x) >> 1) ^ (((x) & 1) ? 0x8d : 0))
-
-#define BACK_TO_TABLES
-#ifdef BACK_TO_TABLES
-
-const uint8_t sbox[256] = {
- 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
- 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
- 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
- 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
- 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc,
- 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
- 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a,
- 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
- 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0,
- 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
- 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b,
- 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
- 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85,
- 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
- 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5,
- 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
- 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17,
- 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
- 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88,
- 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
- 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c,
- 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
- 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9,
- 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
- 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6,
- 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
- 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e,
- 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
- 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94,
- 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
- 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68,
- 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
-};
-const uint8_t sboxinv[256] = {
- 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38,
- 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
- 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87,
- 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
- 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d,
- 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
- 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2,
- 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
- 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16,
- 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
- 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda,
- 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
- 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a,
- 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
- 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02,
- 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
- 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea,
- 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
- 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85,
- 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
- 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89,
- 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
- 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20,
- 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
- 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31,
- 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
- 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d,
- 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
- 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0,
- 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
- 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26,
- 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
-};
-
-#define rj_sbox(x) sbox[(x)]
-#define rj_sbox_inv(x) sboxinv[(x)]
-
-#else /* tableless subroutines */
-
-/* -------------------------------------------------------------------------- */
-uint8_t gf_alog(uint8_t x) // calculate anti-logarithm gen 3
-{
- uint8_t atb = 1, z;
-
- while (x--) {z = atb; atb <<= 1; if (z & 0x80) atb^= 0x1b; atb ^= z;}
-
- return atb;
-} /* gf_alog */
-
-/* -------------------------------------------------------------------------- */
-uint8_t gf_log(uint8_t x) // calculate logarithm gen 3
-{
- uint8_t atb = 1, i = 0, z;
-
- do {
- if (atb == x) break;
- z = atb; atb <<= 1; if (z & 0x80) atb^= 0x1b; atb ^= z;
- } while (++i > 0);
-
- return i;
-} /* gf_log */
-
-
-/* -------------------------------------------------------------------------- */
-uint8_t gf_mulinv(uint8_t x) // calculate multiplicative inverse
-{
- return (x) ? gf_alog(255 - gf_log(x)) : 0;
-} /* gf_mulinv */
-
-/* -------------------------------------------------------------------------- */
-uint8_t rj_sbox(uint8_t x)
-{
- uint8_t y, sb;
-
- sb = y = gf_mulinv(x);
- y = (y<<1)|(y>>7); sb ^= y; y = (y<<1)|(y>>7); sb ^= y;
- y = (y<<1)|(y>>7); sb ^= y; y = (y<<1)|(y>>7); sb ^= y;
-
- return (sb ^ 0x63);
-} /* rj_sbox */
-
-/* -------------------------------------------------------------------------- */
-uint8_t rj_sbox_inv(uint8_t x)
-{
- uint8_t y, sb;
-
- y = x ^ 0x63;
- sb = y = (y<<1)|(y>>7);
- y = (y<<2)|(y>>6); sb ^= y; y = (y<<3)|(y>>5); sb ^= y;
-
- return gf_mulinv(sb);
-} /* rj_sbox_inv */
-
-#endif
-
-/* -------------------------------------------------------------------------- */
-uint8_t rj_xtime(uint8_t x)
-{
- return (x & 0x80) ? ((x << 1) ^ 0x1b) : (x << 1);
-} /* rj_xtime */
-
-/* -------------------------------------------------------------------------- */
-void aes_subBytes(uint8_t *buf)
-{
- register uint8_t i = 16;
-
- while (i--) buf[i] = rj_sbox(buf[i]);
-} /* aes_subBytes */
-
-/* -------------------------------------------------------------------------- */
-void aes_subBytes_inv(uint8_t *buf)
-{
- register uint8_t i = 16;
-
- while (i--) buf[i] = rj_sbox_inv(buf[i]);
-} /* aes_subBytes_inv */
-
-/* -------------------------------------------------------------------------- */
-void aes_addRoundKey(uint8_t *buf, uint8_t *key)
-{
- register uint8_t i = 16;
-
- while (i--) buf[i] ^= key[i];
-} /* aes_addRoundKey */
-
-/* -------------------------------------------------------------------------- */
-void aes_addRoundKey_cpy(uint8_t *buf, uint8_t *key, uint8_t *cpk)
-{
- register uint8_t i = 16;
-
- while (i--) buf[i] ^= (cpk[i] = key[i]), cpk[16+i] = key[16 + i];
-} /* aes_addRoundKey_cpy */
-
-
-/* -------------------------------------------------------------------------- */
-void aes_shiftRows(uint8_t *buf)
-{
- register uint8_t i, j; /* to make it potentially parallelable :) */
-
- i = buf[1]; buf[1] = buf[5]; buf[5] = buf[9]; buf[9] = buf[13]; buf[13] = i;
- i = buf[10]; buf[10] = buf[2]; buf[2] = i;
- j = buf[3]; buf[3] = buf[15]; buf[15] = buf[11]; buf[11] = buf[7]; buf[7] = j;
- j = buf[14]; buf[14] = buf[6]; buf[6] = j;
-
-} /* aes_shiftRows */
-
-/* -------------------------------------------------------------------------- */
-void aes_shiftRows_inv(uint8_t *buf)
-{
- register uint8_t i, j; /* same as above :) */
-
- i = buf[1]; buf[1] = buf[13]; buf[13] = buf[9]; buf[9] = buf[5]; buf[5] = i;
- i = buf[2]; buf[2] = buf[10]; buf[10] = i;
- j = buf[3]; buf[3] = buf[7]; buf[7] = buf[11]; buf[11] = buf[15]; buf[15] = j;
- j = buf[6]; buf[6] = buf[14]; buf[14] = j;
-
-} /* aes_shiftRows_inv */
-
-/* -------------------------------------------------------------------------- */
-void aes_mixColumns(uint8_t *buf)
-{
- register uint8_t i, a, b, c, d, e;
-
- for (i = 0; i < 16; i += 4)
- {
- a = buf[i]; b = buf[i + 1]; c = buf[i + 2]; d = buf[i + 3];
- e = a ^ b ^ c ^ d;
- buf[i] ^= e ^ rj_xtime(a^b); buf[i+1] ^= e ^ rj_xtime(b^c);
- buf[i+2] ^= e ^ rj_xtime(c^d); buf[i+3] ^= e ^ rj_xtime(d^a);
- }
-} /* aes_mixColumns */
-
-/* -------------------------------------------------------------------------- */
-void aes_mixColumns_inv(uint8_t *buf)
-{
- register uint8_t i, a, b, c, d, e, x, y, z;
-
- for (i = 0; i < 16; i += 4)
- {
- a = buf[i]; b = buf[i + 1]; c = buf[i + 2]; d = buf[i + 3];
- e = a ^ b ^ c ^ d;
- z = rj_xtime(e);
- x = e ^ rj_xtime(rj_xtime(z^a^c)); y = e ^ rj_xtime(rj_xtime(z^b^d));
- buf[i] ^= x ^ rj_xtime(a^b); buf[i+1] ^= y ^ rj_xtime(b^c);
- buf[i+2] ^= x ^ rj_xtime(c^d); buf[i+3] ^= y ^ rj_xtime(d^a);
- }
-} /* aes_mixColumns_inv */
-
-/* -------------------------------------------------------------------------- */
-void aes_expandEncKey(uint8_t *k, uint8_t *rc)
-{
- register uint8_t i;
-
- k[0] ^= rj_sbox(k[29]) ^ (*rc);
- k[1] ^= rj_sbox(k[30]);
- k[2] ^= rj_sbox(k[31]);
- k[3] ^= rj_sbox(k[28]);
- *rc = F( *rc);
-
- for(i = 4; i < 16; i += 4) k[i] ^= k[i-4], k[i+1] ^= k[i-3],
- k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];
- k[16] ^= rj_sbox(k[12]);
- k[17] ^= rj_sbox(k[13]);
- k[18] ^= rj_sbox(k[14]);
- k[19] ^= rj_sbox(k[15]);
-
- for(i = 20; i < 32; i += 4) k[i] ^= k[i-4], k[i+1] ^= k[i-3],
- k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];
-
-} /* aes_expandEncKey */
-
-/* -------------------------------------------------------------------------- */
-void aes_expandDecKey(uint8_t *k, uint8_t *rc)
-{
- uint8_t i;
-
- for(i = 28; i > 16; i -= 4) k[i+0] ^= k[i-4], k[i+1] ^= k[i-3],
- k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];
-
- k[16] ^= rj_sbox(k[12]);
- k[17] ^= rj_sbox(k[13]);
- k[18] ^= rj_sbox(k[14]);
- k[19] ^= rj_sbox(k[15]);
-
- for(i = 12; i > 0; i -= 4) k[i+0] ^= k[i-4], k[i+1] ^= k[i-3],
- k[i+2] ^= k[i-2], k[i+3] ^= k[i-1];
-
- *rc = FD(*rc);
- k[0] ^= rj_sbox(k[29]) ^ (*rc);
- k[1] ^= rj_sbox(k[30]);
- k[2] ^= rj_sbox(k[31]);
- k[3] ^= rj_sbox(k[28]);
-} /* aes_expandDecKey */
-
-
-/* -------------------------------------------------------------------------- */
-void aes256_init(aes256_context *ctx, uint8_t *k)
-{
- uint8_t rcon = 1;
- register uint8_t i;
-
- for (i = 0; i < sizeof(ctx->key); i++) ctx->enckey[i] = ctx->deckey[i] = k[i];
- for (i = 8;--i;) aes_expandEncKey(ctx->deckey, &rcon);
-} /* aes256_init */
-
-/* -------------------------------------------------------------------------- */
-void aes256_done(aes256_context *ctx)
-{
- register uint8_t i;
-
- for (i = 0; i < sizeof(ctx->key); i++)
- ctx->key[i] = ctx->enckey[i] = ctx->deckey[i] = 0;
-} /* aes256_done */
-
-/* -------------------------------------------------------------------------- */
-void aes256_encrypt_ecb(aes256_context *ctx, uint8_t *buf)
-{
- uint8_t i, rcon;
-
- aes_addRoundKey_cpy(buf, ctx->enckey, ctx->key);
- for(i = 1, rcon = 1; i < 14; ++i)
- {
- aes_subBytes(buf);
- aes_shiftRows(buf);
- aes_mixColumns(buf);
- if( i & 1 ) aes_addRoundKey( buf, &ctx->key[16]);
- else aes_expandEncKey(ctx->key, &rcon), aes_addRoundKey(buf, ctx->key);
- }
- aes_subBytes(buf);
- aes_shiftRows(buf);
- aes_expandEncKey(ctx->key, &rcon);
- aes_addRoundKey(buf, ctx->key);
-} /* aes256_encrypt */
-
-/* -------------------------------------------------------------------------- */
-void aes256_decrypt_ecb(aes256_context *ctx, uint8_t *buf)
-{
- uint8_t i, rcon;
-
- aes_addRoundKey_cpy(buf, ctx->deckey, ctx->key);
- aes_shiftRows_inv(buf);
- aes_subBytes_inv(buf);
-
- for (i = 14, rcon = 0x80; --i;)
- {
- if( ( i & 1 ) )
- {
- aes_expandDecKey(ctx->key, &rcon);
- aes_addRoundKey(buf, &ctx->key[16]);
- }
- else aes_addRoundKey(buf, ctx->key);
- aes_mixColumns_inv(buf);
- aes_shiftRows_inv(buf);
- aes_subBytes_inv(buf);
- }
- aes_addRoundKey( buf, ctx->key);
-} /* aes256_decrypt */
diff --git a/lib/CPUs/MIPS/bsp/examples/aes256.h b/lib/CPUs/MIPS/bsp/examples/aes256.h
deleted file mode 100644
index c5a22ba..0000000
--- a/lib/CPUs/MIPS/bsp/examples/aes256.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-* Byte-oriented AES-256 implementation.
-* All lookup tables replaced with 'on the fly' calculations.
-*
-* Copyright (c) 2007-2009 Ilya O. Levin, http://www.literatecode.com
-* Other contributors: Hal Finney
-*
-* Permission to use, copy, modify, and distribute this software for any
-* purpose with or without fee is hereby granted, provided that the above
-* copyright notice and this permission notice appear in all copies.
-*
-* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
-#ifndef uint8_t
-#define uint8_t unsigned char
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- typedef struct {
- uint8_t key[32];
- uint8_t enckey[32];
- uint8_t deckey[32];
- } aes256_context;
-
-
- void aes256_init(aes256_context *, uint8_t * /* key */);
- void aes256_done(aes256_context *);
- void aes256_encrypt_ecb(aes256_context *, uint8_t * /* plaintext */);
- void aes256_decrypt_ecb(aes256_context *, uint8_t * /* cipertext */);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/lib/CPUs/MIPS/bsp/examples/aes256_1.c b/lib/CPUs/MIPS/bsp/examples/aes256_1.c
deleted file mode 100644
index 8a987b8..0000000
--- a/lib/CPUs/MIPS/bsp/examples/aes256_1.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-* Byte-oriented AES-256 implementation.
-* All lookup tables replaced with 'on the fly' calculations.
-*
-* Copyright (c) 2007 Ilya O. Levin, http://www.literatecode.com
-*
-* Permission to use, copy, modify, and distribute this software for any
-* purpose with or without fee is hereby granted, provided that the above
-* copyright notice and this permission notice appear in all copies.
-*
-* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
-#include
-#include
-#include
-#include
-#include
-#include "aes256.h"
-
-#ifndef NUM_BLOCKS
-#define NUM_BLOCKS 10000
-#endif
-
-#define DUMP(s, i, buf, sz) {printf(s); \
- for (i = 0; i < (sz);i++) \
- printf("%02x ", buf[i]); \
- printf("\n");}
-
-
-int main (int argc, char *argv[])
-{
- aes256_context ctx;
- uint8_t key[32];
- uint8_t buf[16], i;
- long start, end, j;
-
- /* put a test vector */
- for (i = 0; i < sizeof(buf);i++) buf[i] = i * 16 + i;
- for (i = 0; i < sizeof(key);i++) key[i] = i;
-
- DUMP("txt: ", i, buf, sizeof(buf));
- DUMP("key: ", i, key, sizeof(key));
- printf("---\n");
-
- aes256_init(&ctx, key);
- start = clock();
- for (j=0; j < NUM_BLOCKS; j++)
- {
- aes256_encrypt_ecb(&ctx, buf);
- }
- end = clock();
- DUMP("enc: ", i, buf, sizeof(buf));
-
- printf("Speed %f blocks/s\n", (float)j/((float)(end-start)/CLOCKS_PER_SEC));
-
- aes256_init(&ctx, key);
- start = clock();
- for (j=0; j < NUM_BLOCKS; j++)
- {
- aes256_decrypt_ecb(&ctx, buf);
- }
- end = clock();
- DUMP("dec: ", i, buf, sizeof(buf));
-
- printf("Speed %f blocks/s\n", (float)j/((float)(end-start)/CLOCKS_PER_SEC));
-
- aes256_done(&ctx);
-
- return 0;
-} /* main */
diff --git a/lib/CPUs/MIPS/bsp/examples/barcode.c b/lib/CPUs/MIPS/bsp/examples/barcode.c
deleted file mode 100644
index e1dc1bc..0000000
--- a/lib/CPUs/MIPS/bsp/examples/barcode.c
+++ /dev/null
@@ -1,358 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define CPU_FREQ_HZ 100000000
-#include "libsys.h"
-#include "irq.h"
-
-UINT32 buffer[16384];
-
-#define T_SAMPLE 5000
-#define TIMEOUT 1000
-
-typedef struct _bar_t
-{
- UINT32 T;
- UINT32 black;
-} bar_t;
-
-enum
-{
- state_idle = 0,
- state_sample,
- state_finish
-};
-
-typedef struct _sbar_cand_t
-{
- UINT32 T;
- UINT32 is_primitive;
-} bar_cand_t;
-
-bar_t bars[1024];
-
-void bsort(float *pData, UINT32 len)
-{
- float t;
- int i, j;
-
- for(i=len-1; i>=0; i--)
- {
- for(j=1; j pData[j])
- {
- t = pData[j-1];
- pData[j-1] = pData[j];
- pData[j] = t;
- }
- }
- }
-}
-
-typedef struct _smedian_t
-{
- UINT32 N;
- UINT32 is_dirty;
- float *pBuf, *pSorted;
- UINT32 w;
- float median;
-} median_t;
-
-void Median_init(median_t *pObj, UINT32 N, float init_val)
-{
- int i;
- pObj->pBuf = (float*)malloc(N*sizeof(float));
- pObj->pSorted = (float*)malloc(N*sizeof(float));
- for (i=0; i < N; i++)
- pObj->pBuf[0] = init_val;
- pObj->median = init_val;
- pObj->is_dirty = 0;
- pObj->w = 0;
- pObj->N = N;
-}
-
-void Median_free(median_t *pObj)
-{
- if (pObj->pBuf)
- free(pObj->pBuf);
-
- if (pObj->pSorted)
- free(pObj->pSorted);
-
- pObj->pBuf = NULL;
- pObj->pSorted = NULL;
-
-}
-
-void Median_value_add(median_t *pObj, float value)
-{
- pObj->is_dirty = 1;
- pObj->pBuf[pObj->w++] = value;
-
- if (pObj->w == pObj->N)
- pObj->w = 0;
-
-}
-
-float Median_get(median_t *pObj)
-{
- if (!pObj->is_dirty)
- return pObj->median;
-
- memcpy(pObj->pSorted, pObj->pBuf, pObj->N*sizeof(float));
-
- bsort(pObj->pSorted, pObj->N);
-
- if (pObj->N&1)
- {
- pObj->median = pObj->pSorted[(pObj->N-1)/2];
- }
- else
- {
- pObj->median = 0.5f*(pObj->pSorted[pObj->N/2] + pObj->pSorted[pObj->N/2+1]);
- }
-
- pObj->is_dirty = 0;
-
- return pObj->median;
-}
-
-// -------------------------------------------------------------
-UINT32 detect_module(UINT32 T, UINT32 T0)
-{
- UINT32 m, best_M;
- float err, kc, best_err;
-
- best_err = 4.f;
- best_M = 0;
-
- for (m=1; m < 5; m++)
- {
- kc = (float)T/(m*T0);
- err = fabs(kc - 1);
-
- if (err < best_err)
- {
- best_M = m;
- best_err = err;
- }
- }
-
- return best_M;
-}
-
-void handler7(void)
-{
- UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
- UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
- UINT32 volatile *pPS20_stat = (UINT32*)SYS_PS2_0_STAT;
- UINT32 volatile *pPS21_stat = (UINT32*)SYS_PS2_1_STAT;
- static UINT32 state, bar_count;
- static UINT32 timeout_count, timeout_reload;
- static UINT32 white, pin_last, skip, start;
- static UINT32 module_cnt_w, module_cnt_b, Tmod0_w, Tmod0_b, M, T0;
- float ratio, error, kc;
- UINT32 i;
- static median_t med_b, med_w;
- static bar_cand_t bc_b, bc_w;
- static median_t speed_b, speed_w;
-
- if (*pTim_stat & 1)
- {
- *pTim_stat = 1;
- white = ((*pPS20_stat & SYS_PS2_BIT_PIN_DATA) == 0);
-
- switch (state)
- {
- case state_idle:
- timeout_reload = TIMEOUT;
- if (white != pin_last)
- {
- if (white)
- break;
-
- state = state_sample;
- module_cnt_b = 0;
- module_cnt_w = 0;
- Tmod0_w = 0xFFFFFFFF;
- Tmod0_b = 0xFFFFFFFF;
- bar_count = 0;
- Median_init(&med_b, 3, 0);
- Median_init(&med_w, 3, 0);
- Median_init(&speed_b, 3, 1);
- Median_init(&speed_w, 3, 1);
- }
- break;
-
- case state_sample:
- if (!timeout_count)
- {
- state = state_finish;
- break;
- }
-
- if (white)
- {
- module_cnt_w++;
- }
- else
- {
- module_cnt_b++;
- }
- if (white != pin_last)
- {
- if (pin_last)
- {
- if (bar_count < 10)
- {
- if (1.5*module_cnt_w < Tmod0_w)
- {
- Tmod0_w = module_cnt_w;
- }
- }
- Median_value_add(&med_w, Tmod0_w);
-
- timeout_reload = 10*Tmod0_w;
- bars[bar_count].T = module_cnt_w;
- bars[bar_count].black = 0;
- module_cnt_w = 0;
-
- }
- else
- {
- if (bar_count < 10)
- {
- if (1.5*module_cnt_b < Tmod0_b)
- {
- Tmod0_b = module_cnt_b;
- }
- }
- Median_value_add(&med_b, Tmod0_b);
-
- timeout_reload = 10*Tmod0_b;
- bars[bar_count].T = module_cnt_b;
- bars[bar_count].black = 1;
- module_cnt_b = 0;
- }
- bar_count++;
-
- }
- break;
-
- case state_finish:
- printf("------------------------------------------------\n");
- printf(" Black White \n");
- skip = 0;
- start = 1;
- Tmod0_w = Median_get(&med_w);
- Tmod0_b = Median_get(&med_b);
- for (i=0; i < bar_count; i++)
- {
- if (bars[i].black)
- {
- T0 = Median_get(&med_b);
- ratio = (float)bars[i].T/T0;
- if (start)
- {
- if (ratio > 4)
- {
- skip = 1;
- continue;
- }
- }
- start = 0;
- skip = 0;
- M = detect_module(bars[i].T, T0);
- kc = (float)bars[i].T/(M*T0);
- error = kc - 1;
-
-// printf("M=%d, R=%2.2f, E=%+2.2f [%04d]", M, ratio, error, T0);
-// if (M == 1)
- Median_value_add(&med_b, (UINT32)(T0*kc));
- Median_value_add(&speed_b, (float)bars[i].T/(M*Tmod0_b));
-
- printf("%06d %2.6f ", bars[i].T, Median_get(&speed_b));
-
- }
- else
- {
- if (skip)
- continue;
-
- T0 = Median_get(&med_w);
- ratio = (float)bars[i].T/T0;
- if (ratio > 9)
- {
- start = 1;
-// printf("\n");
-// printf("------------------------------------------------\n");
-// printf(" Black White \n");
- continue;
- }
-
-
- M = detect_module(bars[i].T, T0);
- kc = (float)bars[i].T/(M*T0);
- error = kc - 1;
-
-// printf(" M=%d, R=%2.2f, E=%+2.2f [%04d]", M, ratio, error, T0);
-// if (M == 1)
- Median_value_add(&med_w, (UINT32)(T0*kc));
- Median_value_add(&speed_w, (float)bars[i].T/(M*Tmod0_w));
-
- printf("%06d %2.6f ", bars[i].T, Median_get(&speed_w));
- printf("\n");
- }
- }
- Median_free(&med_b);
- Median_free(&med_w);
- Median_free(&speed_b);
- Median_free(&speed_w);
- if (bar_count)
- printf("\n");
-
- state = state_idle;
- break;
-
- }
- if (white != pin_last)
- timeout_count = timeout_reload;
-
- pin_last = white;
- if (timeout_count)
- timeout_count--;
-
- }
-}
-
-int main(void)
-{
-
- int i;
- UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
- UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
- UINT32 volatile *pTim0_cnt = (UINT32*)SYS_ITIM0_CNT;
- UINT32 volatile *pTim0_cmp = (UINT32*)SYS_ITIM0_CMP;
-
- *pTim0_cnt = 0;
- *pTim0_cmp = (UINT32)T_SAMPLE;
- *pTim_stat = 1;
- *pTim_ctrl = 3;
-
- interrupt_register(7, (void*)handler7);
-
- printf("Jenners BarCoder\n");
-
- interrupt_enable(7);
-
- while(1)
- {
- }
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/barcode.new.c b/lib/CPUs/MIPS/bsp/examples/barcode.new.c
deleted file mode 100644
index 06f1152..0000000
--- a/lib/CPUs/MIPS/bsp/examples/barcode.new.c
+++ /dev/null
@@ -1,322 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define CPU_FREQ_HZ 100000000
-#include "libsys.h"
-#include "irq.h"
-
-UINT32 buffer[16384];
-
-#define T_SAMPLE 5000
-#define TIMEOUT 1000
-
-typedef struct _bar_t
-{
- UINT32 T;
- UINT32 black;
-} bar_t;
-
-enum
-{
- state_idle = 0,
- state_sample,
- state_finish
-};
-
-bar_t bars[1024];
-
-void bsort(float *pData, UINT32 len)
-{
- float t;
- int i, j;
-
- for(i=len-1; i>=0; i--)
- {
- for(j=1; j pData[j])
- {
- t = pData[j-1];
- pData[j-1] = pData[j];
- pData[j] = t;
- }
- }
- }
-}
-
-typedef struct _smedian_t
-{
- UINT32 N;
- UINT32 is_dirty;
- float *pBuf, *pSorted;
- UINT32 w;
- float median;
-} median_t;
-
-void Median_init(median_t *pObj, UINT32 N, float init_val)
-{
- int i;
- pObj->pBuf = (float*)malloc(N*sizeof(float));
- pObj->pSorted = (float*)malloc(N*sizeof(float));
- for (i=0; i < N; i++)
- pObj->pBuf[0] = init_val;
- pObj->median = init_val;
- pObj->is_dirty = 0;
- pObj->w = 0;
- pObj->N = N;
-}
-
-void Median_free(median_t *pObj)
-{
- if (pObj->pBuf)
- free(pObj->pBuf);
-
- if (pObj->pSorted)
- free(pObj->pSorted);
-
- pObj->pBuf = NULL;
- pObj->pSorted = NULL;
-
-}
-
-void Median_value_add(median_t *pObj, float value)
-{
- pObj->is_dirty = 1;
- pObj->pBuf[pObj->w++] = value;
-
- if (pObj->w == pObj->N)
- pObj->w = 0;
-
-}
-
-float Median_get(median_t *pObj)
-{
- if (!pObj->is_dirty)
- return pObj->median;
-
- memcpy(pObj->pSorted, pObj->pBuf, pObj->N*sizeof(float));
-
- bsort(pObj->pSorted, pObj->N);
-
- if (pObj->N&1)
- {
- pObj->median = pObj->pSorted[(pObj->N-1)/2];
- }
- else
- {
- pObj->median = 0.5f*(pObj->pSorted[pObj->N/2] + pObj->pSorted[pObj->N/2+1]);
- }
-
- pObj->is_dirty = 0;
-
- return pObj->median;
-}
-
-// -------------------------------------------------------------
-UINT32 detect_module(UINT32 T, UINT32 *pBC)
-{
- UINT32 m, best_M;
- float err, kc, best_err;
-
- best_err = 4.f;
- best_M = 0;
-
- for (m=0; m < 4; m++)
- {
- kc = (float)T/pBC[m];
- err = fabs(kc - 1);
-
- if (err < best_err)
- {
- best_M = m+1;
- best_err = err;
- }
- }
-
- return best_M;
-}
-
-void handler7(void)
-{
- UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
- UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
- UINT32 volatile *pPS20_stat = (UINT32*)SYS_PS2_0_STAT;
- UINT32 volatile *pPS21_stat = (UINT32*)SYS_PS2_1_STAT;
- static UINT32 state, bar_count;
- static UINT32 timeout_count, timeout_reload;
- static UINT32 white, pin_last, skip, start;
- static UINT32 module_cnt_w, module_cnt_b, Tmod0_w, Tmod0_b, M, T0;
- float ratio, error, kc;
- UINT32 i, j;
- static median_t med_b, med_w;
- static UINT32 bc_b[4], bc_w[4];
-
- if (*pTim_stat & 1)
- {
- *pTim_stat = 1;
- white = ((*pPS20_stat & SYS_PS2_BIT_PIN_DATA) == 0);
-
- switch (state)
- {
- case state_idle:
- timeout_reload = TIMEOUT;
- if (white != pin_last)
- {
- if (white)
- break;
-
- state = state_sample;
- module_cnt_b = 0;
- module_cnt_w = 0;
- Tmod0_w = 0xFFFFFFFF;
- Tmod0_b = 0xFFFFFFFF;
- bar_count = 0;
- Median_init(&med_b, 3, 1);
- Median_init(&med_w, 3, 1);
- }
- break;
-
- case state_sample:
- if (!timeout_count)
- {
- state = state_finish;
- break;
- }
-
- if (white)
- {
- module_cnt_w++;
- }
- else
- {
- module_cnt_b++;
- }
- if (white != pin_last)
- {
- if (pin_last)
- {
- if (bar_count < 10)
- {
- if (1.5*module_cnt_w < Tmod0_w)
- {
- Tmod0_w = module_cnt_w;
- }
- }
- timeout_reload = 10*Tmod0_w;
- bars[bar_count].T = module_cnt_w;
- bars[bar_count].black = 0;
- module_cnt_w = 0;
-
- }
- else
- {
- if (bar_count < 10)
- {
- if (1.5*module_cnt_b < Tmod0_b)
- {
- Tmod0_b = module_cnt_b;
- }
- }
- timeout_reload = 10*Tmod0_b;
- bars[bar_count].T = module_cnt_b;
- bars[bar_count].black = 1;
- module_cnt_b = 0;
- }
- bar_count++;
-
- }
- break;
-
- case state_finish:
- printf("------------------------------------------------\n");
- printf(" Black White \n");
- skip = 0;
- start = 1;
- for (i=0; i < 4; i++)
- {
- bc_b[i] = (i+1)*Tmod0_b;
- bc_w[i] = (i+1)*Tmod0_w;
- }
- for (i=0; i < bar_count; i++)
- {
- if (bars[i].black)
- {
- M = detect_module(bars[i].T, bc_b);
- if (M)
- {
- kc = (float)bars[i].T/bc_b[M-1];
- error = kc - 1;
- Median_value_add(&med_b, kc);
- printf("M=%d, R=%2.2f, E=%+2.2f [%04d]", M, kc, error, bc_b[M-1]);
- kc = Median_get(&med_b);
- bc_b[M-1] = (UINT32)(kc*bc_b[M-1]);
- }
-// printf("%d", M);
-
- }
- else
- {
- M = detect_module(bars[i].T, bc_w);
- if (M)
- {
- kc = (float)bars[i].T/bc_w[M-1];
- error = kc - 1;
- Median_value_add(&med_w, kc);
- printf(" M=%d, R=%2.2f, E=%+2.2f [%04d]", M, kc, error, bc_w[M-1]);
- kc = Median_get(&med_w);
- bc_w[M-1] = (UINT32)(kc*bc_w[M-1]);
-
- }
-// printf("%d", M);
- printf("\n");
- }
- }
- Median_free(&med_b);
- Median_free(&med_w);
- if (bar_count)
- printf("\n");
-
- state = state_idle;
- break;
-
- }
- if (white != pin_last)
- timeout_count = timeout_reload;
-
- pin_last = white;
- if (timeout_count)
- timeout_count--;
-
- }
-}
-
-int main(void)
-{
-
- int i;
- UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
- UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
- UINT32 volatile *pTim0_cnt = (UINT32*)SYS_ITIM0_CNT;
- UINT32 volatile *pTim0_cmp = (UINT32*)SYS_ITIM0_CMP;
-
- *pTim0_cnt = 0;
- *pTim0_cmp = (UINT32)T_SAMPLE;
- *pTim_stat = 1;
- *pTim_ctrl = 3;
-
- interrupt_register(7, (void*)handler7);
-
- printf("Jenners BarCoder\n");
-
- interrupt_enable(7);
-
- while(1)
- {
- }
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/basicmath_small.c b/lib/CPUs/MIPS/bsp/examples/basicmath_small.c
deleted file mode 100644
index 049fea2..0000000
--- a/lib/CPUs/MIPS/bsp/examples/basicmath_small.c
+++ /dev/null
@@ -1,84 +0,0 @@
-#include "snipmath.h"
-#include
-
-/* The printf's may be removed to isolate just the math calculations */
-
-int main(void)
-{
- double a1 = 1.0, b1 = -10.5, c1 = 32.0, d1 = -30.0;
- double a2 = 1.0, b2 = -4.5, c2 = 17.0, d2 = -30.0;
- double a3 = 1.0, b3 = -3.5, c3 = 22.0, d3 = -31.0;
- double a4 = 1.0, b4 = -13.7, c4 = 1.0, d4 = -35.0;
- double x[3];
- double X;
- int solutions;
- int i;
- unsigned long l = 0x3fed0169L;
- struct int_sqrt q;
- long n = 0;
-
- /* solve soem cubic functions */
- printf("********* CUBIC FUNCTIONS ***********\n");
- /* should get 3 solutions: 2, 6 & 2.5 */
- SolveCubic(a1, b1, c1, d1, &solutions, x);
- printf("Solutions:");
- for(i=0;i0;b1--) {
- for(c1=5;c1<15;c1+=0.5) {
- for(d1=-1;d1>-11;d1--) {
- SolveCubic(a1, b1, c1, d1, &solutions, x);
- printf("Solutions:");
- for(i=0;i
-#include
-
-/* this should be approx 2 Bo*oMips to start (note initial shift), and will
- * still work even if initially too large, it will just take slightly longer */
-unsigned long loops_per_jiffy = (1<<12);
-
-/* This is the number of bits of precision for the loops_per_jiffy. Each
- * bit takes on average 1.5/HZ seconds. This (like the original) is a little
- * better than 1% */
-#define LPS_PREC 8
-
-extern void delay(unsigned int loops);
-
-//plagiarized straight from the 2.4 sources.
-#ifdef NOMAIN
-int calibrate_delay(void)
-#else
-int main(void)
-#endif
-{
- unsigned long ticks, loopbit;
- int lps_precision = LPS_PREC;
-
- loops_per_jiffy = (1<<12);
-
- printf("Calibrating delay loop... ");
- while (loops_per_jiffy <<= 1) {
- /* wait for "start of" clock tick */
- ticks = clock();
- while (ticks == clock())
- /* nothing */;
- /* Go .. */
- ticks = clock();
- delay(loops_per_jiffy);
- ticks = clock() - ticks;
- if (ticks)
- break;
- }
-
-/* Do a binary approximation to get loops_per_jiffy set to equal one clock
- (up to lps_precision bits) */
-
- loops_per_jiffy >>= 1;
- loopbit = loops_per_jiffy;
- while ( lps_precision-- && (loopbit >>= 1) ) {
- loops_per_jiffy |= loopbit;
- ticks = clock();
- while (ticks == clock());
- ticks = clock();
- delay(loops_per_jiffy);
- if (clock() != ticks) /* longer than 1 tick */
- loops_per_jiffy &= ~loopbit;
- }
-
-
-/* Round the value and print it */
- printf("%lu.%02lu BogoMIPS\n",
- loops_per_jiffy/(500000/HZ),
- (loops_per_jiffy/(5000/HZ)) % 100);
-
-
- return loops_per_jiffy;
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/Makefile b/lib/CPUs/MIPS/bsp/examples/bootloader/Makefile
deleted file mode 100644
index 513a332..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/Makefile
+++ /dev/null
@@ -1,47 +0,0 @@
-ENDIAN='big'
-
-ifeq ($(ENDIAN), 'big')
- ENDIAN_FLAGS=-EB
- LIB_DIRS=-L $(MIPS_TOOLS_PREFIX)/mipsel-elf/lib/eb -L $(MIPS_TOOLS_PREFIX)/lib/gcc/mipsel-elf/$(MIPS_GCC_VER)/eb
-else
- ENDIAN_FLAGS=-EL
- LIB_DIRS=-L $(MIPS_TOOLS_PREFIX)/mipsel-elf/lib -L $(MIPS_TOOLS_PREFIX)/lib/gcc/mipsel-elf/$(MIPS_GCC_VER)
-endif
-
-CFLAGS=$(ENDIAN_FLAGS) -Os -I. -I../ -I../libsys -msoft-float -march=r3000
-LFLAGS=$(ENDIAN_FLAGS) -M -T bootloader.ld
-
-LIBS=-lc -lgcc
-
-CC=mipsel-elf-gcc
-LD=mipsel-elf-ld
-OBJDUMP=mipsel-elf-objdump
-OBJCOPY=mipsel-elf-objcopy
-
-all: bootloader_flash
-
-libsys: startup_boot.S init_boot.S kernel_boot.S libsys_boot.c
- $(CC) $(CFLAGS) -c startup_boot.S -o startup.o
- $(CC) $(CFLAGS) -c init_boot.S -o init.o
- $(CC) $(CFLAGS) -c kernel_boot.S -o kernel.o
- $(CC) $(CFLAGS) -c libsys_boot.c -o libsys.o
-
-bootloader: libsys bootloader.c
- $(CC) $(CFLAGS) -g -c bootloader.c
- $(LD) $(LFLAGS) $(LIB_DIRS) startup.o init.o kernel.o libsys.o bootloader.o -o bootloader.elf $(LIBS) >bootloader.map
- $(OBJDUMP) -d bootloader.elf > bootloader.dis
- $(OBJCOPY) bootloader.elf -O binary bootloader.ROM.bin
- $(OBJCOPY) -O srec bootloader.elf bootloader.srec
- romgen bootloader.ROM.bin 10 $(ENDIAN_FLAGS)
-
-bootloader_flash: libsys bootloader_with_flash.c
- $(CC) $(CFLAGS) -g -c bootloader_with_flash.c
- $(CC) $(CFLAGS) -g -c ../cfiflash.c
- $(LD) $(LFLAGS) $(LIB_DIRS) startup.o init.o kernel.o libsys.o cfiflash.o bootloader_with_flash.o -o bootloader.elf $(LIBS) >bootloader.map
- $(OBJDUMP) -d bootloader.elf > bootloader.dis
- $(OBJCOPY) bootloader.elf -O binary bootloader.ROM.bin
- $(OBJCOPY) -O srec bootloader.elf bootloader.srec
- romgen bootloader.ROM.bin 11 $(ENDIAN_FLAGS)
-
-clean:
- rm -rf *.o *.bin *.map *.dis *.srec *.elf *.vhd* *.tcl bootloader > /dev/null
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader.c b/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader.c
deleted file mode 100644
index 7ade222..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader.c
+++ /dev/null
@@ -1,247 +0,0 @@
-#include "libsys_boot.h"
-
-typedef struct _ssrec_t
-{
- UINT32 addr;
- UINT32 size;
- UINT32 type;
- UINT8 *data;
-
-} srec_t;
-
-enum srec_type
-{
- srec_err, srec_sob, srec_data, srec_rec, srec_eob
-};
-
-UINT8 h2i(UINT8 *c)
-{
- int i;
- UINT8 t, b = 0;
-
- for (i=0; i < 2; i++)
- {
- t = c[i];
- if (t >= 'A')
- t = t - 'A' + 10;
- else
- t -= '0';
-
- b = (b << 4) | t;
- }
- return b;
-}
-
-int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
-{
- UINT8 chksum, byte;
- int alen, i;
-
- if (!buflen)
- return srec_err;
-
- pRec->type = srec_rec;
- alen = 0;
- if ((pBuf[1] > '0') && (pBuf[1] < '4'))
- {
- alen = pBuf[1] - '0' + 1;
- pRec->type = srec_data;
- }
- else if ((pBuf[1] >= '7') && (pBuf[1] <= '9'))
- {
- alen = 11 - (pBuf[1] - '0');
- pRec->type = srec_eob;
- }
- else if (pBuf[1] == '0')
- {
- alen = 2;
- pRec->type = srec_sob;
- }
-
- byte = h2i(&pBuf[2]);
- pRec->size = byte;
- chksum = byte;
-
- pRec->addr = 0;
- for (i=0; i < alen; i++)
- {
- byte = h2i(&pBuf[4+2*i]);
- pRec->addr = pRec->addr << 8 | byte;
- chksum += byte;
- }
- pRec->size -= (alen+1);
-
- pRec->data = (UINT8*) &pBuf[4 + 2*alen];
- for (i=0; i < (int)pRec->size; i++)
- {
- byte = h2i(&pRec->data[2*i]);
- pRec->data[i] = byte;
- chksum += byte;
- }
- chksum = ~chksum;
- byte = h2i(&pRec->data[2*i]);
- if (chksum != byte)
- return 0;
-
- return pRec->type;
-}
-
-int srec_getline(UINT8 *pLine)
-{
- char c;
- int i = 0;
-
- do
- {
- c = readchar();
-
- } while ((c != 's') && (c != 'S'));
-
- while(((c != 0x0D) && (c != 0x0A)))
- {
- pLine[i++] = c;
- c = readchar();
- };
-
- return i;
-}
-
-void Jump_to(void *pEntry)
-{
- __asm
- (
- ".set noreorder\n"
- );
- __asm
- (
- "jr %[pEntry]\n" // jump entry
- :
- : [pEntry] "r" (pEntry)
- );
- __asm
- (
- "nop\n"
- );
- __asm
- (
- ".set reorder\n"
- );
-}
-
-void Exec_at(void *pEntry)
-{
- __asm
- (
- ".set noreorder\n"
- );
-
- __asm
- (
- "mfc0 $26, $12\n" // change exception vector
- "li $27, 0xFFBFFFFF\n"
- "and $26, $27\n"
- "mtc0 $26, $12\n"
- );
-
- __asm
- (
- "lw $v0, 16($sp)\n"
- "nop\n"
- "jr $v0\n" // jump entry
- "rfe\n"
- );
-
- __asm
- (
- ".set reorder\n"
- );
-}
-void PrintCPUinfo(void)
-{
- int result, rev_id;
-
- char *cpu_type_str[7] = {"invalid", "R2000", "R3000", "R6000", "R4000", "reserved", "R6000A"};
-
- // Print Status register
- result = CP0_SR_read();
-
- sputs("Status : ");
- print_word(result);
- sputs("\n");
-
- // Print Revision
- result = CP0_PRID_read();
- rev_id = (result >> 8) & 0xFF;
- sputs("CPU type: ");
- if ((rev_id > 0) && (rev_id < 0x07))
- {
- sputs(cpu_type_str[rev_id]);
- sputs(" Rev.");
- rev_id = result & 0xFF;
- print_byte((char)rev_id);
- }
- else
- sputs("Unknown");
-
- sputs("\n");
-
-}
-
-#define MAX_IMG_SIZE (1024*1024) // bytes
-
-int main(int argc, char *argv[])
-{
- UINT8 buf[256];
- srec_t srec;
- int result, srec_state, i;
- UINT32 haddr;
- volatile UINT8 *pMem;
- haddr = 0;
-
- // ----------------------------------------------------------
- sputs("\n\n");
- PrintCPUinfo();
- sputs("Booting from UART..");
-
- while(1)
- {
- sputs(".");
- while(1)
- {
- result = srec_getline(buf);
- srec_state = decode_srec(&srec, buf, result);
- switch (srec_state)
- {
- case srec_data:
- if ((srec.addr + srec.size) > haddr)
- haddr = srec.addr + srec.size;
-
- pMem = (UINT8*)srec.addr;
- for (i=0; i < srec.size; i++)
- *pMem++ = srec.data[i];
-
- break;
-
- case srec_eob:
- sputs("done\n\n");
- sputs("Execute program at ");
- print_word(srec.addr);
- sputs("\n\n");
-
- Exec_at((void*)srec.addr);
- break;
-
- default:
- result = -1;
- break;
- }
- if (result < 0)
- {
- break;
- }
-
- };
- }
- return 0;
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader.ld b/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader.ld
deleted file mode 100644
index c3cd35e..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader.ld
+++ /dev/null
@@ -1,53 +0,0 @@
-MEMORY
-{
- rom : ORIGIN = 0xBFC00000, LENGTH = 0x00002000 /* 8K */
- ram : ORIGIN = 0x40000000, LENGTH = 0x00002000 /* 8K */
-}
-
-OUTPUT_ARCH(mips)
-SEARCH_DIR(".");
-SEARCH_DIR("/usr/local/mipsel-elf/lib:/usr/local/mipsel-elf/lib/eb");
-SEARCH_DIR("/usr/local/lib/gcc/mipsel-elf/4.3.3:/usr/local/lib/gcc/mipsel-elf/4.3.3/eb");
-
-stack_ptr = 0x7FFFEFF0;
-baudrate = 0x0D;
-sys_led_port = 0xA0000000;
-sys_uart_data = 0xA0010000;
-sys_uart_stat = 0xA0010004;
-sys_uart_baud = 0xA0010008;
-sys_timer_usec = 0xA000008;
-sys_timer_sec = 0xA000000C;
-
-
-SECTIONS
-{
- .init ORIGIN(rom) :
- {
- start = ALIGN(4);
- entry = ALIGN(4);
- _entry = ALIGN(4);
- __entry = ALIGN(4);
- *(.stext)
- } > rom
-
- .ktext ORIGIN(rom) + 0x180 :
- {
- *(.ktext)
- } > rom
-
- .text . :
- {
- *(.text)
- } > rom
-
- .rodata . :
- {
- *(.rodata*)
- } > rom
-
- .data ORIGIN(ram) :
- {
- *(.*data) *(.*bss) *(.*common)
- } > ram
-
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader_with_flash.c b/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader_with_flash.c
deleted file mode 100644
index 197ab44..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/bootloader_with_flash.c
+++ /dev/null
@@ -1,383 +0,0 @@
-#include "libsys_boot.h"
-#include "cfiflash.h"
-
-#define MAGIC_EB 0x4A464931 // "JFI1" in big-endian;
-#define MAGIC_EL 0x3149464A // "JFI1" in little-endian;
-
-typedef struct _ssrec_t
-{
- UINT32 addr;
- UINT32 size;
- UINT32 type;
- UINT8 *data;
-
-} srec_t;
-typedef struct _sflash_alloc_tbl_t
-{
- UINT32 images[16];
-
-} flash_alloc_tbl_t;
-
-typedef struct _sflash_img_hdr_t
-{
- UINT32 magic;
- UINT32 target_base;
- UINT32 img_base;
- UINT32 img_size;
- UINT32 hdr_next;
- UINT8 img_name[128];
- UINT8 res[108];
-
-} flash_img_hdr_t;
-
-enum srec_type
-{
- srec_err, srec_sob, srec_data, srec_rec, srec_eob
-};
-
-UINT8 h2i(UINT8 *c)
-{
- int i;
- UINT8 t, b = 0;
-
- for (i=0; i < 2; i++)
- {
- t = c[i];
- if (t >= 'A')
- t = t - 'A' + 10;
- else
- t -= '0';
-
- b = (b << 4) | t;
- }
- return b;
-}
-
-int decode_srec(srec_t *pRec, UINT8 *pBuf, int buflen)
-{
- UINT8 chksum, byte;
- int alen, i;
-
- if (!buflen)
- return srec_err;
-
- pRec->type = srec_rec;
- alen = 0;
- if ((pBuf[1] > '0') && (pBuf[1] < '4'))
- {
- alen = pBuf[1] - '0' + 1;
- pRec->type = srec_data;
- }
- else if ((pBuf[1] >= '7') && (pBuf[1] <= '9'))
- {
- alen = 11 - (pBuf[1] - '0');
- pRec->type = srec_eob;
- }
- else if (pBuf[1] == '0')
- {
- alen = 2;
- pRec->type = srec_sob;
- }
-
- byte = h2i(&pBuf[2]);
- pRec->size = byte;
- chksum = byte;
-
- pRec->addr = 0;
- for (i=0; i < alen; i++)
- {
- byte = h2i(&pBuf[4+2*i]);
- pRec->addr = pRec->addr << 8 | byte;
- chksum += byte;
- }
- pRec->size -= (alen+1);
-
- pRec->data = (UINT8*) &pBuf[4 + 2*alen];
- for (i=0; i < (int)pRec->size; i++)
- {
- byte = h2i(&pRec->data[2*i]);
- pRec->data[i] = byte;
- chksum += byte;
- }
- chksum = ~chksum;
- byte = h2i(&pRec->data[2*i]);
- if (chksum != byte)
- return 0;
-
- return pRec->type;
-}
-
-int srec_getline(UINT8 *pLine)
-{
- char c;
- int i = 0;
-
- do
- {
- c = readchar();
-
- } while ((c != 's') && (c != 'S'));
-
- while(((c != 0x0D) && (c != 0x0A)))
- {
- pLine[i++] = c;
- c = readchar();
- };
-
- return i;
-}
-
-void Jump_to(void *pEntry)
-{
- __asm
- (
- ".set noreorder\n"
- );
- __asm
- (
- "jr %[pEntry]\n" // jump entry
- :
- : [pEntry] "r" (pEntry)
- );
- __asm
- (
- "nop\n"
- );
- __asm
- (
- ".set reorder\n"
- );
-}
-
-void Exec_at(void *pEntry)
-{
- __asm
- (
- ".set noreorder\n"
- );
-
- __asm
- (
- "li $26, 0x10000000\n"
- "mtc0 $26, $12\n"
- );
-
- __asm
- (
- "jr %[pEntry]\n" // jump entry
- :
- : [pEntry] "r" (pEntry)
- );
-
- __asm
- (
- "rfe\n"
- );
-
- __asm
- (
- ".set reorder\n"
- );
-}
-
-void Exec_RE_at(void *pEntry)
-{
- __asm
- (
- ".set noreorder\n"
- );
-
- __asm
- (
- "mfc0 $26, $12\n" // change exception vector
- "li $27, 0xFFBFFFFF\n"
- "and $26, $27\n"
- "li $27, 0x02000000\n" // Reverse Endianess
- "or $26, $27\n"
- "mtc0 $26, $12\n"
- );
-
- __asm
- (
- "jr %[pEntry]\n" // jump entry
- :
- : [pEntry] "r" (pEntry)
- );
-
- __asm
- (
- "rfe\n"
- );
-
- __asm
- (
- ".set reorder\n"
- );
-}
-
-#define MAX_IMG_SIZE (1024*1024) // bytes
-#define SDRAM_BASE 0x40000000
-#define FLASH_USE_BLOCK 1
-
-int main(int argc, char *argv[])
-{
- UINT8 buf[256];
- srec_t srec;
- int srec_state, i;
- UINT32 haddr, result;
- flash_t flash;
- flash_img_hdr_t img_hdr = {0};
- flash_img_hdr_t *pImg_hdr;
- UINT32 img_size, block_sel;
-
- volatile UINT32 *pLED = (UINT32*)SYS_LED_PORT;
- volatile UINT32 *pBtn = (UINT32*)SYS_GPIO0;
- volatile UINT32 *pDip = (UINT32*)SYS_GPIO1;
- volatile UINT8 *pMem;
- volatile UINT32 *pFlashIO = (UINT32*)SYS_FLASH_IO; // Flash in uncached area
- volatile UINT32 *pFlashMem = (UINT32*)SYS_FLASH_MEM; // Flash in cached area
- volatile UINT32 *ram32 = (UINT32*)SDRAM_BASE;
- UINT32 flash_offset;
-
- *pLED = 0;
- haddr = 0;
- block_sel = 0x7F & (UINT32)*pDip;
-
- // ----------------------------------------------------------
- if (IS_ERROR(flash_find(&flash, SYS_FLASH_IO)))
- {
- sputs("Cannot find flash device. Exit now!\n\n");
- return 1;
- }
-
- // Get flash offset by value of DIP-switch
- flash_offset = flash_get_offset_by_blocknum(&flash, block_sel);
-
- ram32 = (UINT32*)(SDRAM_BASE);
- pFlashIO = (UINT32*)(SYS_FLASH_IO + flash_offset);
-
- if (!(*pBtn & 8))
- {
- sputs("\n\n");
- pImg_hdr = (flash_img_hdr_t*)pFlashIO;
- if ((pImg_hdr->magic != MAGIC_EL) && (pImg_hdr->magic != MAGIC_EB))
- {
- sputs("\n\n");
- sputs("Invalid image found at ");print_word(flash_offset); sputs(". Abort.\n");
- return 1;
- }
-
- sputs("Booting application from flash (");print_word(flash_offset);sputs(")...");
-
- ram32 = (UINT32*)pImg_hdr->target_base;
- img_size = pImg_hdr->img_size;
-
- // It's safe to use cached Flash,
- // because D-Cache was invalidated during execution of start code
- pFlashMem = (UINT32*)(SYS_FLASH_MEM + pImg_hdr->img_base);
-
- for (i=0; i < img_size/4; i++)
- ram32[i] = pFlashMem[i];
-
- sputs("done\n");
-
- sputs("Execute at ");print_word(pImg_hdr->target_base); sputs("\n\n");
- Exec_at((void*)ram32);
- }
- else
- {
-
- sputs("\n\n");
-
- sputs("Reading HEX-Record from UART..");
-
- // Erase SDRAM
- for (i=0; i < MAX_IMG_SIZE/4; i++)
- ram32[i] = 0;
-
-
- while(1)
- {
- sputs(".");
- while(1)
- {
- result = srec_getline(buf);
- srec_state = decode_srec(&srec, buf, result);
- *pLED = 0;
- switch (srec_state)
- {
- case srec_data:
- if ((srec.addr + srec.size) > haddr)
- haddr = srec.addr + srec.size;
-
- pMem = (UINT8*)srec.addr;
- for (i=0; i < srec.size; i++)
- *pMem++ = srec.data[i];
-
- break;
-
- case srec_eob:
- sputs("done\n\n");
- img_hdr.magic = MAGIC_EB;
- img_hdr.target_base = srec.addr;
- img_hdr.img_size = haddr - srec.addr;
- img_hdr.img_base = flash_offset + sizeof(flash_img_hdr_t);
- img_hdr.hdr_next = flash_get_offset_blockaligned(&flash, img_hdr.img_base + img_hdr.img_size);
- sputs("Size of application : ");print_word(img_hdr.img_size); sputs("\n");
- sputs("Programming flash at : ");print_word(flash_offset); sputs("\n");
- sputs("Next free flash offset : ");print_word(img_hdr.hdr_next); sputs("\n");
-
- sputs("Flash erase...");
- result = flash_erase(&flash, flash_offset, img_hdr.img_size + sizeof(flash_img_hdr_t));
- if (IS_ERROR(result))
- {
- sputs("failed (");print_word(result);sputs(")\n");
- break;
- }
- sputs("done\n");
-
- sputs("Flash write...");
- result = flash_program(&flash, flash_offset, (UINT8*)&img_hdr, sizeof(flash_img_hdr_t));
- if (IS_ERROR(result))
- {
- sputs("failed (");print_word(result);sputs(")\n");
- break;
- }
- result = flash_program(&flash, img_hdr.img_base, (UINT8*)img_hdr.target_base, img_hdr.img_size);
- if (IS_ERROR(result))
- {
- sputs("failed (");print_word(result);sputs(")\n");
- break;
- }
- sputs("done\n");
-
- sputs("Flash verify...");
- result = flash_verify(&flash, img_hdr.img_base, (UINT8*)img_hdr.target_base, img_hdr.img_size);
- if (IS_ERROR(result))
- {
- sputs("failed (");print_word(result);sputs(")\n");
- break;
- }
- sputs("passed\n");
-
- // Jump to reset vector
- Jump_to((void*)0xBFC00000);
-
- break;
-
- default:
- result = -1;
- break;
- }
- if (IS_ERROR(result))
- {
- *pLED = 0x40000000;
- break;
- }
-
- };
- }
- }
- return 0;
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/init_boot.S b/lib/CPUs/MIPS/bsp/examples/bootloader/init_boot.S
deleted file mode 100644
index 84a8d9d..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/init_boot.S
+++ /dev/null
@@ -1,19 +0,0 @@
- .file "init.S"
-
- .text
- .section .init,"ax"
- .align 2
- .globl _init
- .extern end
-
-_init:
- .set noreorder
-
- # set uart
- la $26, sys_uart_baud
- addiu $27, $0, baudrate
- sw $27, 0($26)
-
- jr $ra
-
- .set reorder
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/jtag_upd.bat b/lib/CPUs/MIPS/bsp/examples/bootloader/jtag_upd.bat
deleted file mode 100644
index 33bc43a..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/jtag_upd.bat
+++ /dev/null
@@ -1,13 +0,0 @@
-@rem
-@rem Setup Chipscope's TCL JTAG path
-@rem
-@rem Usage: cs_xtclsh.bat args...
-@rem
-@date /T > date.tmp
-@date 15.03.2009
-@set CS_PATH=%XILINX%\ChipScope\bin\nt
-@echo %CS_PATH%
-
-@call %CS_PATH%\cs_xtclsh bootloader.ROM.tcl
-@type date.tmp | date >nul
-@del date.tmp
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/kernel_boot.S b/lib/CPUs/MIPS/bsp/examples/bootloader/kernel_boot.S
deleted file mode 100644
index b4a8694..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/kernel_boot.S
+++ /dev/null
@@ -1,46 +0,0 @@
- .file "kernel.S"
-
- .section .ktext,"ax"
- .align 2
-
- .macro kpush reg
- addiu $sp, 4
- sw \reg, 0($sp)
- .endm
-
- .macro kpop reg
- lw \reg, 0($sp)
- addiu $sp, -4
- .endm
-
-_exc_handler:
-
- .set noreorder
-
- # Set Error LED and ExcCode LEDs
- # Get Cause
- mfc0 $26, $13
- li $27, 0xC0000000
- srl $26, 2
- andi $26, 0x000F
- or $26, $27
- la $27, sys_led_port
- sw $26, 0($27)
-
- # wait for all interrupts = 0
-$w4x: mfc0 $26, $13
- nop
- srl $26, 8
- andi $26, 0xFF
- bnez $26, $w4x
- nop
-
- # Get return address
- mfc0 $26, $14
-
- # Return
- nop
- jr $26
- rfe
- .set reorder
-
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.c b/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.c
deleted file mode 100644
index 0f39d80..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.c
+++ /dev/null
@@ -1,214 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include "libsys_boot.h"
-
-// ---------------------------------------------------------------------------------
-// MIPS specific
-UINT32 CP0_SR_read(void)
-{
- UINT32 result;
-
- __asm
- (
- "mfc0 %[val], $12\n"
- : [val] "=r" (result)
- );
-
- return result;
-}
-
-void CP0_SR_write(UINT32 val)
-{
- __asm
- (
- "mtc0 %[val], $12\n"
- : /* no output */
- : [val] "r" (val)
- );
-}
-
-UINT32 CP0_CR_read(void)
-{
- UINT32 result;
-
- __asm
- (
- "mfc0 %[val], $13\n"
- : [val] "=r" (result)
- );
-
- return result;
-}
-
-void CP0_CR_write(UINT32 val)
-{
- __asm
- (
- "mtc0 %[val], $13\n"
- :
- : [val] "r" (val)
- );
-}
-
-UINT32 CP0_PRID_read(void)
-{
- UINT32 result;
-
- __asm
- (
- "mfc0 %[val], $15\n"
- : [val] "=r" (result)
- );
-
- return result;
-}
-
-// ---------------------------------------------------------------------------------
-char readchar(void)
-{
- volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
- volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA;
-
- while(!(0x10 & *pUART_stat));
-
- return (char)*pUART_data;
-}
-
-void writechar(char c)
-{
- volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
- volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA;
-
- while((0x02 & *pUART_stat) != 0);
-
- *pUART_data = (UINT32)c;
-}
-
-void _putchar(char c)
-{
- if (c == 0x0A)
- {
- writechar(0x0D);
- }
- writechar(c);
-}
-
-int sputs(char *pStr)
-{
- char *start;
- start = pStr;
-
- while(*pStr)
- _putchar(*(pStr++));
-
- return pStr - start;
-}
-
-void print_byte(char byte)
-{
- int i;
- unsigned char c, nibble;
-
- for (i=0; i < 2; i++)
- {
- nibble = (char)((byte >> 4) & 0xF);
- byte <<= 4;
-
- if (nibble < 10)
- c = nibble + '0';
- else
- c = nibble + 'A' - 10;
-
- _putchar(c);
- }
-}
-
-void print_word(int word)
-{
- int i;
- unsigned char c, nibble;
-
- for (i=0; i < 4; i++)
- {
- c = (char) (word >> 24);
- print_byte(c);
- word <<= 8;
- }
-}
-
-// ---------------------------------------------------------------------------------
-// PrintBuffer8()
-// Prints byte buffer as hex and ascii interpretation
-// ---------------------------------------------------------------------------------
-// _Parameters :
-// pBuf: : IN: Buffer to display
-// nbpr : Number of bytes per row to display
-// len : Length of input buffer
-// _Return: none
-//
-// ---------------------------------------------------------------------------
-void PrintBuffer8(UINT8 *pBuf, int nbpr, int len)
-{
- memdump(pBuf, 1, nbpr, len);
-}
-
-void memdump(UINT8 *pBuf, int print_offset_only, int num_bytes_per_row, int len)
-{
- int i, j, cnt_hex, cnt_asc, base;
- unsigned char c;
-
- i = j = 0;
- cnt_hex = len;
- cnt_asc = len;
- base = 0;
- if (!print_offset_only)
- base = (int)pBuf;
-
- do
- {
- print_word(base + i);
- sputs(": ");
- for (j=0; j < num_bytes_per_row; j++)
- {
- if (cnt_hex)
- {
- print_byte(pBuf[i+j]);
- sputs(" ");
- cnt_hex--;
- }
- else
- {
- sputs(" ");
- break;
- }
-
- }
-
- sputs(" ");
- for (j=0; j < num_bytes_per_row; j++)
- {
- if (cnt_asc)
- {
- c = pBuf[i+j];
- if((c < 0x20) || (c > 0x7F))
- c = '.';
-
- _putchar(c);
- cnt_asc--;
- }
- else
- {
- sputs(" ");
- break;
- }
- }
- sputs("\n");
- i += num_bytes_per_row;
-
- } while (cnt_hex);
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.h b/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.h
deleted file mode 100644
index 3bf4ecc..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/libsys_boot.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef LIBSYS_H
-#define LIBSYS_H
-
-// ---------------------------------------------------------
-// Types
-// ---------------------------------------------------------
-#define INT8 char
-#define INT16 short
-#define INT32 long
-#define UINT8 unsigned char
-#define UINT16 unsigned short
-#define UINT32 unsigned long
-#define INT int
-#define UINT unsigned int
-#define FLOAT32 float
-#define FLOAT64 double
-
-#define IS_ERROR(e) ((e & 0x80000000) == 0x80000000)
-
-#define SYS_GPIO0 0xA0000000
-#define SYS_GPIO1 0xA0000004
-#define SYS_LED_PORT SYS_GPIO0
-#define SYS_USB_CTRL SYS_GPIO1
-#define SYS_TIMER_USEC 0xA0000008
-#define SYS_TIMER_SEC 0xA000000C
-#define SYS_UART_DATA 0xA0010000
-#define SYS_UART_STAT 0xA0010004
-#define SYS_UART_BAUD 0xA0010008
-#define SYS_USB_DATA 0xA0020000
-#define SYS_USB_MBX 0xA0020004
-#define SYS_USB_ADDR 0xA0020008
-#define SYS_USB_STATUS 0xA002000C
-#define SYS_FLASH_IO 0xA4000000
-#define SYS_FLASH_MEM 0x00000000
-
-// MIPS specific
-UINT32 CP0_SR_read(void);
-void CP0_SR_write(UINT32 val);
-UINT32 CP0_CR_read(void);
-void CP0_CR_write(UINT32 val);
-UINT32 CP0_PRID_read(void);
-
-// General
-char readchar(void);
-void writechar(char c);
-int write(int file, char *ptr, int len);
-int sputs(char *pStr);
-void print_byte(char byte);
-void print_word(int word);
-void PrintBuffer8(UINT8 *pBuf, int nbpr, int len);
-void memdump(UINT8 *pBuf, int print_offset_only, int num_bytes_per_row, int len);
-
-#endif // LIBSYS_H
-
diff --git a/lib/CPUs/MIPS/bsp/examples/bootloader/startup_boot.S b/lib/CPUs/MIPS/bsp/examples/bootloader/startup_boot.S
deleted file mode 100644
index 8da9ee0..0000000
--- a/lib/CPUs/MIPS/bsp/examples/bootloader/startup_boot.S
+++ /dev/null
@@ -1,43 +0,0 @@
- .file "startup.S"
-
- .text
- .section .init,"ax"
- .extern _init
- .align 2
-
-_start:
- .set noreorder
-
- # set stack pointer
- la $sp, stack_ptr
-
- # Set Kernel mode
- li $26, 0x1040000C
- mtc0 $26, $12
- li $26, 0x00000000
- mtc0 $26, $13
-
- mfc0 $26, $15
- nop
- mtc0 $26, $31
-
- # Invalidate I-Cache
- cop0 32
-
- # Invalidate D-Cache
- cop0 34
-
- # jump init
- la $26, _init
- jalr $26
- nop
-
- la $26, main
- jalr $26
- nop
-_terminate:
- nop
- j _terminate
- nop
-
- .set reorder
diff --git a/lib/CPUs/MIPS/bsp/examples/cfiflash.c b/lib/CPUs/MIPS/bsp/examples/cfiflash.c
deleted file mode 100644
index bbfbe43..0000000
--- a/lib/CPUs/MIPS/bsp/examples/cfiflash.c
+++ /dev/null
@@ -1,415 +0,0 @@
-#include
-#include
-#include "libsys.h"
-#include "cfiflash.h"
-
-UINT32 cfi_get_status(flash_t *pObj)
-{
- volatile UINT32 *pF;
- UINT32 status;
-
- pF = (UINT32*)pObj->pBase;
-
- *pF = 0x00700070;
-
- status = *pF;
-
- *pF = 0x00FF00FF;
-
- return status;
-
-}
-
-void cfi_init(flash_t *pObj, UINT32 base_addr)
-{
- int i;
- UINT8 *pInfo;
- UINT32 endian;
- UINT8 *pEndian;
-
- pObj->pBase = (void*)base_addr;
-
- pInfo = (UINT8*)&pObj->info;
- for (i=0; i < sizeof(flash_info_t); i++)
- {
- pInfo[i] = 0;
- }
- pObj->eb = 0;
- endian = 0x12345678;
- pEndian = (UINT8*)&endian;
- if (*pEndian == 0x12)
- {
- pObj->eb = 1;
- }
-
-}
-
-UINT32 cfi_find(flash_t *pObj)
-{
- int i;
- volatile UINT32 *pF;
- volatile UINT16 *pF16;
-// UINT8 qry_ref[12] = {0x51, 0x00, 0x51, 0x00, 0x52, 0x00, 0x52, 0x00, 0x59, 0x00, 0x59, 0x00};
- UINT32 size;
-
- pF = (UINT32*)pObj->pBase;
- pF16 = (UINT16*)pObj->pBase;
-
- // Look for flash
- *pF = 0x00980098;
-// for (i=0; i < sizeof(qry_ref); i++)
-// if (((UINT8*)(&pF[0x10]))[i] != qry_ref[i])
-// return (UINT32)-1;
-
- *pF = 0x00FF00FF;
- *pF = 0x00900090;
-
-/*
- printf("ManID : %8.8X\n", (UINT32)pF[0]);
- printf("Device code : %8.8X\n", (UINT32)pF[1]);
- printf("Block info : %8.8X\n", (UINT32)pF[2]);
-
- printf("VCC(min) : %8.8X\n", (UINT32)pF[0x1B]);
- printf("VCC(max) : %8.8X\n", (UINT32)pF[0x1C]);
- printf("VPP(min) : %8.8X\n", (UINT32)pF[0x1D]);
- printf("VPP(max) : %8.8X\n", (UINT32)pF[0x1E]);
- printf("Device Layout : %8.8X\n", (UINT32)pF[0x27]);
- printf("Interface type : %8.8X %8.8X\n", (UINT32)pF[0x28], (UINT32)pF[0x29]);
- printf("Write buffer size : %8.8X %8.8X\n", (UINT32)pF[0x2A], (UINT32)pF[0x2B]);
- printf("Num. erase blocks : %8.8X\n", (UINT32)pF[0x2C]);
- printf("Erase block info : %8.8X %8.8X %8.8X %8.8X\n", (UINT32)pF[0x2D], (UINT32)pF[0x2E], (UINT32)pF[0x2F], (UINT32)pF[0x30]);
-*/
- pObj->info.num_flash = 2;
- pObj->info.if_width = 32;
- size = (UINT32)pF16[2*0x27];
- pObj->info.flashsize = pObj->info.num_flash;
- for (i=0; i < size; i++)
- pObj->info.flashsize *= 2;
-
- size = (UINT32)(pF16[2*0x2B] << 8 | pF16[2*0x2A]);
- pObj->info.wbuf_size = pObj->info.num_flash;
- for (i=0; i < size; i++)
- pObj->info.wbuf_size *= 2;
-
- pObj->info.nblocks = (UINT32)(pF16[2*0x2E] << 8 | pF16[2*0x2D]) + 1;
- pObj->info.blocksize = pObj->info.num_flash * ((UINT32)(pF16[2*0x30] << 8 | pF16[2*0x2F]) * 256);
-
- *pF = 0x00FF00FF;
-
- return 0;
-}
-
-UINT32 cfi_block_is_locked(flash_t *pObj, UINT32 word_index)
-{
- volatile UINT32 *pF;
- UINT32 status, block_index, block_mask;
- UINT32 error;
-
- pF = (UINT32*)pObj->pBase;
-
- if (word_index >= (pObj->info.flashsize/4))
- return CFI_ERR_INVPARAM;
-
- block_mask = ((pObj->info.nblocks-1) << 16);
- block_index = word_index & block_mask;
-
- *pF = 0x00900090;
-
- error = ((UINT32)pF[block_index+2] & 0x00010001) != 0;
- *pF = 0x00FF00FF;
-
- return error;
-}
-
-UINT32 cfi_block_erase(flash_t *pObj, UINT32 word_index)
-{
- volatile UINT32 *pF;
- UINT32 status, block_index, block_mask;
- UINT32 error;
-
- pF = (UINT32*)pObj->pBase;
-
- if (word_index >= (pObj->info.flashsize/4))
- return CFI_ERR_INVPARAM;
-
- block_mask = ((pObj->info.nblocks-1) << 16);
- block_index = word_index & block_mask;
-
- pF[block_index] = 0x00200020;
- pF[block_index] = 0x00D000D0;
-
- error = 0;
- do
- {
- status = pF[block_index];
-
- } while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
-
- if (status & (SR_BIT_ECLBS | SR_BIT_VPENS | SR_BIT_DPS))
- {
- error = CFI_ERR_DEV_FAIL | status;
- }
-
- pF[block_index] = 0x00FF00FF;
-
- return error;
-}
-
-UINT32 cfi_block_lock(flash_t *pObj, UINT32 word_index)
-{
- volatile UINT32 *pF;
- UINT32 status, block_index, block_mask;
- UINT32 error;
-
- pF = (UINT32*)pObj->pBase;
-
- if (word_index >= (pObj->info.flashsize/4))
- return CFI_ERR_INVPARAM;
-
- block_mask = ((pObj->info.nblocks-1) << 16);
- block_index = word_index & block_mask;
-
- pF[block_index] = 0x00600060;
- pF[block_index] = 0x00010001;
-
- error = 0;
- do
- {
- status = pF[block_index];
-
- } while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
-
- if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_ECLBS))
- {
- error = CFI_ERR_DEV_FAIL | status;
- }
-
- pF[block_index] = 0x00FF00FF;
-
- return error;
-}
-
-UINT32 cfi_block_unlock(flash_t *pObj, UINT32 word_index)
-{
- volatile UINT32 *pF;
- UINT32 status, block_index, block_mask;
- UINT32 error;
-
- pF = (UINT32*)pObj->pBase;
-
- if (word_index >= (pObj->info.flashsize/4))
- return CFI_ERR_INVPARAM;
-
- block_mask = ((pObj->info.nblocks-1) << 16);
- block_index = word_index & block_mask;
-
- pF[block_index] = 0x00600060;
- pF[block_index] = 0x00D000D0;
-
- error = 0;
- do
- {
- status = pF[block_index];
-
- } while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
-
- if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_ECLBS))
- {
- error = CFI_ERR_DEV_FAIL | status;
- }
-
- pF[block_index] = 0x00FF00FF;
-
- return error;
-}
-
-UINT32 cfi_program_single(flash_t *pObj, UINT32 word_index, UINT32 word)
-{
- volatile UINT32 *pF;
- UINT32 status, error;
-
- pF = (UINT32*)pObj->pBase;
-
- if (word_index >= (pObj->info.flashsize/4))
- return CFI_ERR_INVPARAM;
-
- pF[word_index] = 0x00400040;
- pF[word_index] = word;
-
- error = 0;
- do
- {
- status = pF[word_index];
-
- } while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
-
- if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_DPS))
- {
- error = CFI_ERR_DEV_FAIL | status;
- }
-
- pF[word_index] = 0x00FF00FF;
-
- return error;
-
-}
-
-UINT32 cfi_program_multi(flash_t *pObj, UINT32 word_index, UINT32 *pWords, UINT32 num_words)
-{
- int i, j, k;
- volatile UINT32 *pF;
- UINT32 status, bcurr, bnext, block_mask, nblock_write, nbuf_write;
- UINT32 error;
-
- pF = (UINT32*)pObj->pBase;
-
- if (word_index >= (pObj->info.flashsize/4))
- return CFI_ERR_INVPARAM;
-
- block_mask = ((pObj->info.nblocks-1) << 16);
-
- k = 0;
- while(num_words)
- {
-
- bcurr = word_index & block_mask;
- bnext = bcurr + (1 << 16);
- nblock_write = bnext - word_index;
- if (nblock_write > num_words)
- nblock_write = num_words;
-
- while(nblock_write)
- {
- error = 0;
- pF[bcurr] = 0x00E800E8;
- do
- {
- status = pF[bcurr];
-
- } while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
- if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_DPS))
- {
- error = CFI_ERR_DEV_FAIL | status;
- break;
- }
-
- nbuf_write = nblock_write;
- if (nblock_write > pObj->info.wbuf_size/4)
- nbuf_write = pObj->info.wbuf_size/4;
-
- pF[bcurr] = (nbuf_write-1) << 16 | (nbuf_write-1);
-
- for (j=0; j < nbuf_write; j++)
- pF[word_index+j] = pWords[k++];
-
- word_index += j;
- nblock_write -= j;
- num_words -= j;
-
- error = 0;
- pF[bcurr] = 0x00D000D0;
- do
- {
- status = pF[bcurr];
-
- } while((status & SR_BIT_ISMS) != SR_BIT_ISMS);
- if (status & (SR_BIT_PSLBS | SR_BIT_VPENS | SR_BIT_DPS))
- {
- error = CFI_ERR_DEV_FAIL | status;
- break;
- }
-
- pF[bcurr] = 0x00FF00FF;
- }
-
- if (IS_ERROR(error))
- {
- pF[bcurr] = 0x00FF00FF;
- break;
- }
- bcurr = bnext;
- }
-
- return error;
-
-}
-
-UINT32 flash_find(flash_t *pObj, UINT32 base_addr)
-{
- cfi_init(pObj, base_addr);
- return cfi_find(pObj);
-}
-
-UINT32 flash_erase(flash_t *pObj, UINT32 offset, UINT32 size)
-{
- int i;
- UINT32 offset_end, error;
-
- if (size % 4)
- size = 4*(size/4 + 1);
-
- offset_end = offset + size;
-
- for (i=offset; i < offset_end; i += pObj->info.blocksize)
- {
- if (cfi_block_is_locked(pObj, i/4))
- {
- error = cfi_block_unlock(pObj, i/4);
- if (IS_ERROR(error))
- break;
- }
- error = cfi_block_erase(pObj, i/4);
- if (IS_ERROR(error))
- break;
- }
-
- return error;
-
-}
-
-UINT32 flash_program(flash_t *pObj, UINT32 offset, UINT8 *pData, UINT32 size)
-{
- if (size % 4)
- size = 4*(size/4 + 1);
-
- return cfi_program_multi(pObj, offset/4, (UINT32*)pData, size/4);
-}
-
-UINT32 flash_verify(flash_t *pObj, UINT32 offset, UINT8 *pData, UINT32 size)
-{
- int i;
- UINT8 *pF;
-
- pF = (UINT8*)(pObj->pBase + offset);
-
- for (i=0; i < size; i++)
- if (pF[i] != pData[i])
- return CFI_ERR_VFY_FAIL;
-
- return 0;
-}
-
-UINT32 flash_get_blocknum_by_offset(flash_t *pObj, UINT32 offset)
-{
- UINT32 blocknum;
-
- blocknum = offset/pObj->info.blocksize;
- if (offset%pObj->info.blocksize)
- blocknum++;
-
- return blocknum;
-}
-
-UINT32 flash_get_offset_by_blocknum(flash_t *pObj, UINT32 blocknum)
-{
- if (blocknum >= pObj->info.nblocks)
- blocknum = pObj->info.nblocks - 1;
-
- return blocknum*pObj->info.blocksize;
-}
-
-UINT32 flash_get_offset_blockaligned(flash_t *pObj, UINT32 offset)
-{
- return flash_get_blocknum_by_offset(pObj, offset) * pObj->info.blocksize;
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/cfiflash.h b/lib/CPUs/MIPS/bsp/examples/cfiflash.h
deleted file mode 100644
index 1233642..0000000
--- a/lib/CPUs/MIPS/bsp/examples/cfiflash.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/************************************************************************/
-#ifndef CFIFLASH_H
-#define CFIFLASH_H
-
-#include "libsys.h"
-
-#define SR_BIT_DPS 0x00020002
-#define SR_BIT_PSS 0x00040004
-#define SR_BIT_VPENS 0x00080008
-#define SR_BIT_PSLBS 0x00100010
-#define SR_BIT_ECLBS 0x00200020
-#define SR_BIT_ESS 0x00400040
-#define SR_BIT_ISMS 0x00800080
-
-#define CFI_ERR_BASE (LSYS_ERR_BASE + 0x00100000)
-#define CFI_ERR_GENERAL (CFI_ERR_BASE + 0)
-#define CFI_ERR_NOTFOUND (CFI_ERR_BASE + 1)
-#define CFI_ERR_INVPARAM (CFI_ERR_BASE + 2)
-#define CFI_ERR_VFY_FAIL (CFI_ERR_BASE + 3)
-#define CFI_ERR_DEV_FAIL (CFI_ERR_BASE + 0x10000000)
-
-typedef struct _sflash_info_t
-{
- UINT32 flashsize;
- UINT32 blocksize;
- UINT32 nblocks;
- UINT32 wbuf_size;
- UINT32 if_width;
- UINT32 num_flash;
-
-} flash_info_t;
-
-typedef struct _sflash_t
-{
- void *pBase;
- UINT32 eb;
- flash_info_t info;
-
-} flash_t;
-
-void cfi_init(flash_t *pObj, UINT32 base_addr);
-UINT32 cfi_find(flash_t *pObj);
-UINT32 cfi_block_is_locked(flash_t *pObj, UINT32 word_index);
-UINT32 cfi_block_erase(flash_t *pObj, UINT32 word_index);
-UINT32 cfi_block_lock(flash_t *pObj, UINT32 word_index);
-UINT32 cfi_block_unlock(flash_t *pObj, UINT32 word_index);
-UINT32 cfi_program_single(flash_t *pObj, UINT32 word_index, UINT32 word);
-UINT32 cfi_program_multi(flash_t *pObj, UINT32 word_index, UINT32 *pWords, UINT32 num_words);
-
-UINT32 flash_get_offset_by_blocknum(flash_t *pObj, UINT32 blocknum);
-UINT32 flash_get_blocknum_by_offset(flash_t *pObj, UINT32 offset);
-UINT32 flash_get_offset_blockaligned(flash_t *pObj, UINT32 offset);
-UINT32 flash_find(flash_t *pObj, UINT32 base_addr);
-UINT32 flash_erase(flash_t *pObj, UINT32 offset, UINT32 size);
-UINT32 flash_program(flash_t *pObj, UINT32 offset, UINT8 *pData, UINT32 size);
-UINT32 flash_verify(flash_t *pObj, UINT32 offset, UINT8 *pData, UINT32 size);
-
-#endif // CFIFLASH_H
diff --git a/lib/CPUs/MIPS/bsp/examples/crc32.c b/lib/CPUs/MIPS/bsp/examples/crc32.c
deleted file mode 100644
index 6f63429..0000000
--- a/lib/CPUs/MIPS/bsp/examples/crc32.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include
-
-unsigned long MakeCRC32(char *data, unsigned int len, unsigned int CRC)
-{
- /* ========================================================================
- * Table of CRC-32's of all single-byte values (made by makecrc.c)
- */
- unsigned long crc_32_tab[] = {
- 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L,
- 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, 0x90bf1d91L,
- 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L,
- 0x136c9856L, 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, 0xfa0f3d63L, 0x8d080df5L,
- 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
- 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L,
- 0x26d930acL, 0x51de003aL, 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, 0xb8bda50fL,
- 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL,
- 0x76dc4190L, 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, 0x9fbfe4a5L, 0xe8b8d433L,
- 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
- 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L,
- 0x65b0d9c6L, 0x12b7e950L, 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, 0xfbd44c65L,
- 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL,
- 0x4369e96aL, 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, 0xaa0a4c5fL, 0xdd0d7cc9L,
- 0x5005713cL, 0x270241aaL, 0xbe0b1010L, 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
- 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL,
- 0xedb88320L, 0x9abfb3b6L, 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, 0x73dc1683L,
- 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L,
- 0xf00f9344L, 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, 0x196c3671L, 0x6e6b06e7L,
- 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
- 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL,
- 0xd80d2bdaL, 0xaf0a1b4cL, 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, 0x4669be79L,
- 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL,
- 0xc5ba3bbeL, 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, 0x2cd99e8bL, 0x5bdeae1dL,
- 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
- 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L,
- 0x86d3d2d4L, 0xf1d4e242L, 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, 0x18b74777L,
- 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L,
- 0xa00ae278L, 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, 0x4969474dL, 0x3e6e77dbL,
- 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
- 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, 0xcdd70693L, 0x54de5729L, 0x23d967bfL,
- 0xb3667a2eL, 0xc4614ab8L, 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, 0x2d02ef8dL
- };
-
- if (data == NULL)
- return 0;
-
- CRC = ~CRC;
- while (len --)
- {
- CRC = crc_32_tab[((unsigned char) CRC ^ *data) & 0xFF] ^ (CRC >> 8);
- data ++;
- }
-
- return ~CRC;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/crc32.h b/lib/CPUs/MIPS/bsp/examples/crc32.h
deleted file mode 100644
index 04687b0..0000000
--- a/lib/CPUs/MIPS/bsp/examples/crc32.h
+++ /dev/null
@@ -1,13 +0,0 @@
-// CRC32 function
-// To create a CRC from a new buffer, use this:
-// crc = MakeCRC32(mydata, data_len, 0);
-// If you need to continue the CRC (e.g. your data is in multiple buffers),
-// continue like this:
-// crc = MakeCRC32(moredata, more_len, crc);
-//
-// Your desired CRC should be the complement of the CRC generated by
-// MakeCRC32:
-// desired = crc
-// desired - crc = 0
-
-unsigned long MakeCRC32(char *data, unsigned int len, unsigned long CRC);
diff --git a/lib/CPUs/MIPS/bsp/examples/cubic.c b/lib/CPUs/MIPS/bsp/examples/cubic.c
deleted file mode 100644
index 7740eb2..0000000
--- a/lib/CPUs/MIPS/bsp/examples/cubic.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* +++Date last modified: 05-Jul-1997 */
-
-/*
-** CUBIC.C - Solve a cubic polynomial
-** public domain by Ross Cottrell
-*/
-
-#include
-#include
-#include "snipmath.h"
-
-void SolveCubic(double a,
- double b,
- double c,
- double d,
- int *solutions,
- double *x)
-{
- long double a1 = b/a, a2 = c/a, a3 = d/a;
- long double Q = (a1*a1 - 3.0*a2)/9.0;
- long double R = (2.0*a1*a1*a1 - 9.0*a1*a2 + 27.0*a3)/54.0;
- double R2_Q3 = R*R - Q*Q*Q;
-
- double theta;
-
- if (R2_Q3 <= 0)
- {
- *solutions = 3;
- theta = acos(R/sqrt(Q*Q*Q));
- x[0] = -2.0*sqrt(Q)*cos(theta/3.0) - a1/3.0;
- x[1] = -2.0*sqrt(Q)*cos((theta+2.0*PI)/3.0) - a1/3.0;
- x[2] = -2.0*sqrt(Q)*cos((theta+4.0*PI)/3.0) - a1/3.0;
- }
- else
- {
- *solutions = 1;
- x[0] = pow(sqrt(R2_Q3)+fabs(R), 1/3.0);
- x[0] += Q/x[0];
- x[0] *= (R < 0.0) ? 1 : -1;
- x[0] -= a1/3.0;
- }
-}
-
-#ifdef TEST
-
-int main(void)
-{
- double a1 = 1.0, b1 = -10.5, c1 = 32.0, d1 = -30.0;
- double a2 = 1.0, b2 = -4.5, c2 = 17.0, d2 = -30.0;
- double x[3];
- int solutions;
-
- SolveCubic(a1, b1, c1, d1, &solutions, x);
-
- /* should get 3 solutions: 2, 6 & 2.5 */
-
- SolveCubic(a2, b2, c2, d2, &solutions, x);
-
- /* should get 1 solution: 2.5 */
-
- return 0;
-}
-
-#endif /* TEST */
diff --git a/lib/CPUs/MIPS/bsp/examples/dbg.c b/lib/CPUs/MIPS/bsp/examples/dbg.c
deleted file mode 100644
index fc5a429..0000000
--- a/lib/CPUs/MIPS/bsp/examples/dbg.c
+++ /dev/null
@@ -1,375 +0,0 @@
-#include
-#include
-#include
-#include "irq.h"
-#include "libsys.h"
-#include "mips_dis.h"
-
-#define MAX_USER_BP 16
-#define BP_MASK_ID 0x00FFF
-#define BP_MASK_TYPE 0xFF000
-
-#define BP_GET_ID(bp) ((bp >> 6) & 0xFFF)
-
-#define BP_USER_BASE 0x10000
-#define BP_USER(id) (((BP_USER_BASE + id) << 6) | 0x0D)
-
-#define BP_MGMT_BASE_SS 0x20000
-#define BP_MGMT_SS(id) (((BP_MGMT_BASE_SS + id) << 6) | 0x0D)
-
-#define BP_MGMT_BASE_RU 0x30000
-#define BP_MGMT_RU(id) (((BP_MGMT_BASE_RU + id) << 6) | 0x0D)
-
-static char g_buf[80];
-
-typedef struct _sbp_t
-{
- UINT32 *pAddr;
- UINT32 instr;
-} bp_t;
-
-static EXCEPTION_CONTEXT xcp_last;
-static bp_t user_bp[MAX_USER_BP];
-static bp_t mgmt_bp_ss[2];
-static bp_t mgmt_bp_ru[2];
-static int g_is_ss;
-static int g_bp_index;
-
-int IsBreak(UINT32 instr)
-{
- return ((instr & 0xFC00003F) == 0x0000000D);
-}
-
-UINT32 BreakGetType(UINT32 instr)
-{
- return (instr >> 6) & BP_MASK_TYPE;
-}
-
-char* reg_changed(UINT32 reg1, UINT32 reg2)
-{
- static char chg_str[2] = {0};
-
- if (reg1 != reg2)
- chg_str[0] = '*';
- else
- chg_str[0] = ' ';
-
- return chg_str;
-}
-
-void dbg_handler(struct xcptcontext * xcp)
-{
-
- UINT32 bp_addr, bp_index = 0, branch_addr, reg, result, bp_type;
- int junk, i, leave_isr, is_branch_shadow, is_user_bp;
- UINT32 volatile *pBtn = (UINT32*)SYS_GPIO0;
- UINT32 *pInstr, *pAddr_curr, *pAddr_prev, *pAddr_next;
-
- sputs("\n");
- PRINT_REG_CHG(" Status : ", xcp->sr, reg_changed(xcp->sr, xcp_last.sr));
- PRINT_REG_CHG(" Cause : ", xcp->cr, reg_changed(xcp->cr, xcp_last.cr));
- PRINT_REG_CHG(" EPC : ", xcp->epc, reg_changed(xcp->epc, xcp_last.epc));
- PRINT_REG_CHG("BadAddr : ", xcp->baddr, reg_changed(xcp->baddr, xcp_last.baddr));
- sputs("\n");
- PRINT_REG_CHG(" MDLO : ", xcp->mdlo, reg_changed(xcp->mdlo, xcp_last.mdlo));
- PRINT_REG_CHG(" MDHI : ", xcp->mdhi, reg_changed(xcp->mdhi, xcp_last.mdhi));
-
- sputs("\n");
-
- sputs("Registers:\n");
- PRINT_REG_CHG(" 0 (ze) : ", xcp->regs[0], reg_changed(xcp->regs[0], xcp_last.regs[0]));
- PRINT_REG_CHG(" 1 (at) : ", xcp->regs[1], reg_changed(xcp->regs[1], xcp_last.regs[1]));
- PRINT_REG_CHG(" 2 (v0) : ", xcp->regs[2], reg_changed(xcp->regs[2], xcp_last.regs[2]));
- PRINT_REG_CHG(" 3 (v1) : ", xcp->regs[3], reg_changed(xcp->regs[3], xcp_last.regs[3]));
- sputs("\n");
- PRINT_REG_CHG(" 4 (a0) : ", xcp->regs[4], reg_changed(xcp->regs[4], xcp_last.regs[4]));
- PRINT_REG_CHG(" 5 (a1) : ", xcp->regs[5], reg_changed(xcp->regs[5], xcp_last.regs[5]));
- PRINT_REG_CHG(" 6 (a2) : ", xcp->regs[6], reg_changed(xcp->regs[6], xcp_last.regs[6]));
- PRINT_REG_CHG(" 7 (a3) : ", xcp->regs[7], reg_changed(xcp->regs[7], xcp_last.regs[7]));
- sputs("\n");
- PRINT_REG_CHG(" 8 (t0) : ", xcp->regs[8], reg_changed(xcp->regs[8], xcp_last.regs[8]));
- PRINT_REG_CHG(" 9 (t1) : ", xcp->regs[9], reg_changed(xcp->regs[9], xcp_last.regs[9]));
- PRINT_REG_CHG("10 (t2) : ", xcp->regs[10], reg_changed(xcp->regs[10], xcp_last.regs[10]));
- PRINT_REG_CHG("11 (t3) : ", xcp->regs[11], reg_changed(xcp->regs[11], xcp_last.regs[11]));
- sputs("\n");
- PRINT_REG_CHG("12 (t4) : ", xcp->regs[12], reg_changed(xcp->regs[12], xcp_last.regs[12]));
- PRINT_REG_CHG("13 (t5) : ", xcp->regs[13], reg_changed(xcp->regs[13], xcp_last.regs[13]));
- PRINT_REG_CHG("14 (t6) : ", xcp->regs[14], reg_changed(xcp->regs[14], xcp_last.regs[14]));
- PRINT_REG_CHG("15 (t7) : ", xcp->regs[15], reg_changed(xcp->regs[15], xcp_last.regs[15]));
- sputs("\n");
- PRINT_REG_CHG("16 (s0) : ", xcp->regs[16], reg_changed(xcp->regs[16], xcp_last.regs[16]));
- PRINT_REG_CHG("17 (s1) : ", xcp->regs[17], reg_changed(xcp->regs[17], xcp_last.regs[17]));
- PRINT_REG_CHG("18 (s2) : ", xcp->regs[18], reg_changed(xcp->regs[18], xcp_last.regs[18]));
- PRINT_REG_CHG("19 (s3) : ", xcp->regs[19], reg_changed(xcp->regs[19], xcp_last.regs[19]));
- sputs("\n");
- PRINT_REG_CHG("20 (s4) : ", xcp->regs[20], reg_changed(xcp->regs[20], xcp_last.regs[20]));
- PRINT_REG_CHG("21 (s5) : ", xcp->regs[21], reg_changed(xcp->regs[21], xcp_last.regs[21]));
- PRINT_REG_CHG("22 (s6) : ", xcp->regs[22], reg_changed(xcp->regs[22], xcp_last.regs[22]));
- PRINT_REG_CHG("23 (s7) : ", xcp->regs[23], reg_changed(xcp->regs[23], xcp_last.regs[23]));
- sputs("\n");
- PRINT_REG_CHG("24 (s8) : ", xcp->regs[24], reg_changed(xcp->regs[24], xcp_last.regs[24]));
- PRINT_REG_CHG("25 (s9) : ", xcp->regs[25], reg_changed(xcp->regs[25], xcp_last.regs[25]));
- PRINT_REG_CHG("26 (k0) : ", xcp->regs[26], reg_changed(xcp->regs[26], xcp_last.regs[26]));
- PRINT_REG_CHG("27 (k1) : ", xcp->regs[27], reg_changed(xcp->regs[27], xcp_last.regs[27]));
- sputs("\n");
- PRINT_REG_CHG("28 (gp) : ", xcp->regs[28], reg_changed(xcp->regs[28], xcp_last.regs[28]));
- PRINT_REG_CHG("29 (sp) : ", xcp->regs[29], reg_changed(xcp->regs[29], xcp_last.regs[29]));
- PRINT_REG_CHG("30 (fp) : ", xcp->regs[30], reg_changed(xcp->regs[30], xcp_last.regs[30]));
- PRINT_REG_CHG("31 (ra) : ", xcp->regs[31], reg_changed(xcp->regs[31], xcp_last.regs[31]));
- sputs("\n");
- sputs("\n");
-
- memcpy(&xcp_last, xcp, sizeof(EXCEPTION_CONTEXT));
-
- is_user_bp = 0;
- pAddr_curr = (UINT32*)xcp->epc;
- is_branch_shadow = ((xcp->cr & 0x80000000) == 0x80000000);
- if (is_branch_shadow)
- pAddr_curr++;
-
- pAddr_prev = pAddr_curr - 1;
- pAddr_next = pAddr_curr + 1;
-
- if (IsBreak(*pAddr_curr))
- {
- bp_type = BreakGetType(*pAddr_curr);
-
- switch (bp_type)
- {
- case BP_MGMT_BASE_SS:
-
- // Restore original instructions after single-step
-// sputs("1. Restore after single-step at ");print_word((long)mgmt_bp_ss[0].pAddr);sputs("\n");
- *(mgmt_bp_ss[0].pAddr) = mgmt_bp_ss[0].instr;
- ICACHE_invalidate_at(mgmt_bp_ss[0].pAddr);
- if (mgmt_bp_ss[1].pAddr)
- {
-// sputs("2. Restore after single-step at ");print_word((long)mgmt_bp_ss[1].pAddr);sputs("\n");
- *(mgmt_bp_ss[1].pAddr) = mgmt_bp_ss[1].instr;
- ICACHE_invalidate_at(mgmt_bp_ss[1].pAddr);
- }
-
- break;
-
- case BP_MGMT_BASE_RU:
-
- bp_index = BP_GET_ID(*pAddr_curr);
-// sputs("Restore user break at ");print_word((long)user_bp[bp_index].pAddr);sputs("\n");
-
- *(user_bp[bp_index].pAddr) = BP_USER(bp_index);
- ICACHE_invalidate_at(user_bp[bp_index].pAddr);
-
- *(mgmt_bp_ru[0].pAddr) = mgmt_bp_ru[0].instr;
- ICACHE_invalidate_at(mgmt_bp_ru[0].pAddr);
-// sputs("1. Restore after RU at ");print_word((long)mgmt_bp_ru[0].pAddr);sputs("\n");
- if (mgmt_bp_ru[1].pAddr)
- {
- *(mgmt_bp_ru[1].pAddr) = mgmt_bp_ru[1].instr;
- ICACHE_invalidate_at(mgmt_bp_ru[1].pAddr);
-// sputs("2. Restore after RU at ");print_word((long)mgmt_bp_ru[1].pAddr);sputs("\n");
- }
- if (!g_is_ss)
- return;
-
- break;
-
- case BP_USER_BASE:
-
- is_user_bp = 1;
- bp_index = BP_GET_ID(*pAddr_curr);
-// sputs("Restore instruction at ");print_word((long)user_bp[bp_index].pAddr);sputs("\n");
- *(user_bp[bp_index].pAddr) = user_bp[bp_index].instr;
- ICACHE_invalidate_at(user_bp[bp_index].pAddr);
- break;
-
- default:
-// sputs("Found ordinary break at ");print_word((long)pAddr_curr);sputs("\n");
- break;
-
- }
- }
-
- pInstr = pAddr_prev;
- // Disassemble instructions
- for (i=0; i < 3; i++)
- {
- print_word((long)pInstr);
- if (IsBreak(*pInstr) && (BreakGetType(*pInstr) == BP_USER_BASE))
- {
- tdisasm(g_buf, (long)user_bp[BP_GET_ID(*pInstr)].pAddr, user_bp[BP_GET_ID(*pInstr)].instr, 0, &junk, &junk, &junk);
- sputs(": b ");
- }
- else
- {
- tdisasm(g_buf, (long)pInstr, *pInstr, 0, &junk, &junk, &junk);
- if (pInstr == pAddr_curr)
- if (is_user_bp == 1)
- sputs(": b-> ");
- else
- sputs(": -> ");
- else
- sputs(": ");
- }
- sputs(g_buf);
- sputs("\n");
- pInstr++;
- }
-
- if (is_user_bp)
- {
- // Save original instruction
- mgmt_bp_ru[0].pAddr = pAddr_next;
- mgmt_bp_ru[0].instr = *(mgmt_bp_ru[0].pAddr);
- // Replace instruction with managment breakpoint
- *(mgmt_bp_ru[0].pAddr) = BP_MGMT_RU(bp_index);
- ICACHE_invalidate_at(mgmt_bp_ru[0].pAddr);
- mgmt_bp_ru[1].pAddr = NULL;
- mgmt_bp_ru[1].pAddr = 0;
-// sputs("1. Insert RU-break at ");print_word((long)mgmt_bp_ru[0].pAddr);sputs("\n");
-
- // We have two possible management breaks, if previous instruction was branch or jump
- if (is_branch_shadow)
- {
- result = tdisasm(g_buf, (long)pAddr_prev, *pAddr_prev, 0, &junk, &branch_addr, ®);
- // Is jump target stored in register
- if (result == 3)
- {
- branch_addr = xcp->regs[reg&0x1F];
- }
- // Save original instruction
- mgmt_bp_ru[1].pAddr = (UINT32*)branch_addr;
- mgmt_bp_ru[1].instr = *(mgmt_bp_ru[1].pAddr);
- // Replace instruction with managment breakpoint
- *(mgmt_bp_ru[1].pAddr) = BP_MGMT_RU(bp_index);
- ICACHE_invalidate_at(mgmt_bp_ru[1].pAddr);
-// sputs("2. Insert RU-break at ");print_word((long)mgmt_bp_ru[1].pAddr);sputs("\n");
- }
- }
-
- do
- {
- leave_isr = 0;
- switch(_getchar())
- {
- case 'g':
- leave_isr = 1;
- g_is_ss = 0;
- if (IsBreak(*pAddr_curr))
- {
- if (BreakGetType(*pAddr_curr) != BP_USER_BASE)
- {
- xcp->epc += 4; // Skip ordinary program breaks
- }
- }
- break;
-
- case 'b':
- printf("Enter breakpoint: ");
- scanf("%x", &bp_addr);
- printf("Insert breakpoint at %.8X\n", bp_addr);
- user_bp[g_bp_index].pAddr = (UINT32*)bp_addr;
- user_bp[g_bp_index].instr = *(user_bp[g_bp_index].pAddr);
- *(user_bp[g_bp_index].pAddr) = BP_USER(g_bp_index);
-
- tdisasm(g_buf, (long)user_bp[g_bp_index].pAddr, user_bp[g_bp_index].instr, 0, &junk, &junk, &junk);
- print_word((long)user_bp[g_bp_index].pAddr);sputs(": b ");sputs(g_buf);sputs("\n");
- ICACHE_invalidate_at(user_bp[g_bp_index].pAddr);
- g_bp_index++;
- break;
-
- case 's':
- g_is_ss = 1;
- leave_isr = 1;
- // Don't overwrite RU breaks
-// printf("is_user_bp = %d, IsBreak = %d, pAddr_curr = %08X, *pAddr_curr = %08X\n", is_user_bp, IsBreak(*pAddr_curr), pAddr_curr, *pAddr_curr);
-
- if (is_user_bp)
- break;
-
- // Don't overwrite user breaks
- if (IsBreak(*pAddr_curr))
- {
- if (BreakGetType(*pAddr_curr) == BP_USER_BASE)
- {
- break;
- }
- else
- {
- xcp->epc += 4; // Skip ordinary program breaks
- }
- }
- // Save original instruction
- mgmt_bp_ss[0].pAddr = pAddr_next;
- mgmt_bp_ss[0].instr = *(mgmt_bp_ss[0].pAddr);
- // Replace instruction with managment breakpoint
- *(mgmt_bp_ss[0].pAddr) = BP_MGMT_SS(1);
- ICACHE_invalidate_at(mgmt_bp_ss[0].pAddr);
- mgmt_bp_ss[1].pAddr = NULL;
- mgmt_bp_ss[1].pAddr = 0;
- // We have two possible management breaks, if previous instruction was branch or jump
- if (is_branch_shadow)
- {
- result = tdisasm(g_buf, (long)pAddr_prev, *pAddr_prev, 0, &junk, &branch_addr, ®);
- // Is jump target stored in register
- if (result == 3)
- {
- branch_addr = xcp->regs[reg&0x1F];
- }
- // Save original instruction
- mgmt_bp_ss[1].pAddr = (UINT32*)branch_addr;
- mgmt_bp_ss[1].instr = *(mgmt_bp_ss[1].pAddr);
- // Replace instruction with managment breakpoint
- *(mgmt_bp_ss[1].pAddr) = BP_MGMT_SS(2);
- ICACHE_invalidate_at(mgmt_bp_ss[1].pAddr);
- }
- break;
-
- case 'P':
- g_is_ss = 1;
- leave_isr = 1;
- // Don't overwrite RU breaks
- if (is_user_bp)
- break;
- // Don't overwrite user breaks
- if (IsBreak(*pAddr_curr) && (BreakGetType(*pAddr_curr) == BP_USER_BASE))
- break;
-
- // Save original instruction
- mgmt_bp_ss[0].pAddr = (UINT32*)xcp->regs[0x1F];
- mgmt_bp_ss[0].instr = *(mgmt_bp_ss[0].pAddr);
- // Replace instruction with managment breakpoint
- *(mgmt_bp_ss[0].pAddr) = BP_MGMT_SS(1);
- ICACHE_invalidate_at(mgmt_bp_ss[0].pAddr);
- mgmt_bp_ss[1].pAddr = NULL;
- mgmt_bp_ss[1].pAddr = 0;
- break;
-
- default:
- break;
- }
- } while (!leave_isr);
-
-}
-
-void debug_int(struct xcptcontext * xcp)
-{
- dbg_handler(xcp);
-
-}
-
-int debug_break(struct xcptcontext * xcp)
-{
- dbg_handler(xcp);
- return 0;
-
-}
-
-void dbg_init(void)
-{
- memset(&xcp_last, 0, sizeof(EXCEPTION_CONTEXT));
- interrupt_register(2, debug_int);
- interrupt_enable(2);
-
- xcpt_register(Bp, debug_break);
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/delay_mips.c b/lib/CPUs/MIPS/bsp/examples/delay_mips.c
deleted file mode 100644
index 133a176..0000000
--- a/lib/CPUs/MIPS/bsp/examples/delay_mips.c
+++ /dev/null
@@ -1,15 +0,0 @@
-// MIPS delay.
-
-void __inline__ delay(int loops)
-{
- __asm
- (
- ".set noreorder\n"
- "1:bnez %[loops], 1b\n"
- "addiu %[loops], -1\n"
- ".set reorder\n"
- :
- : [loops] "r" (loops)
- );
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/demo.c b/lib/CPUs/MIPS/bsp/examples/demo.c
deleted file mode 100644
index e3fc38a..0000000
--- a/lib/CPUs/MIPS/bsp/examples/demo.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-* Byte-oriented AES-256 implementation.
-* All lookup tables replaced with 'on the fly' calculations.
-*
-* Copyright (c) 2007 Ilya O. Levin, http://www.literatecode.com
-*
-* Permission to use, copy, modify, and distribute this software for any
-* purpose with or without fee is hereby granted, provided that the above
-* copyright notice and this permission notice appear in all copies.
-*
-* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
-#include
-#include
-#include
-#include
-#include
-#include "aes256.h"
-
-#define DUMP(s, i, buf, sz) {printf(s); \
- for (i = 0; i < (sz);i++) \
- printf("%02x ", buf[i]); \
- printf("\n");}
-
-
-int main (int argc, char *argv[])
-{
- aes256_context ctx;
- uint8_t key[32];
- uint8_t buf[16], i;
- long start, end, j;
-
- /* put a test vector */
- for (i = 0; i < sizeof(buf);i++) buf[i] = i * 16 + i;
- for (i = 0; i < sizeof(key);i++) key[i] = i;
-
- DUMP("txt: ", i, buf, sizeof(buf));
- DUMP("key: ", i, key, sizeof(key));
- printf("---\n");
-
- aes256_init(&ctx, key);
- start = clock();
- for (j=0; j < 1000; j++)
- {
- aes256_encrypt_ecb(&ctx, buf);
- }
- end = clock();
-
- printf("Speed %f blocks/s\n", (float)j/((float)(end-start)/CLOCKS_PER_SEC));
-
- DUMP("enc: ", i, buf, sizeof(buf));
- printf("tst: 8e a2 b7 ca 51 67 45 bf ea fc 49 90 4b 49 60 89\n");
-
- aes256_init(&ctx, key);
- aes256_decrypt_ecb(&ctx, buf);
- DUMP("dec: ", i, buf, sizeof(buf));
-
- aes256_done(&ctx);
-
- return 0;
-} /* main */
diff --git a/lib/CPUs/MIPS/bsp/examples/dhry.h b/lib/CPUs/MIPS/bsp/examples/dhry.h
deleted file mode 100644
index c8d8f0a..0000000
--- a/lib/CPUs/MIPS/bsp/examples/dhry.h
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- ****************************************************************************
- *
- * "DHRYSTONE" Benchmark Program
- * -----------------------------
- *
- * Version: C, Version 2.1
- *
- * File: dhry.h (part 1 of 3)
- *
- * Date: May 25, 1988
- *
- * Author: Reinhold P. Weicker
- * Siemens AG, E STE 35
- * Postfach 3240
- * 8520 Erlangen
- * Germany (West)
- * Phone: [xxx-49]-9131-7-20330
- * (8-17 Central European Time)
- * Usenet: ..!mcvax!unido!estevax!weicker
- *
- * Original Version (in Ada) published in
- * "Communications of the ACM" vol. 27., no. 10 (Oct. 1984),
- * pp. 1013 - 1030, together with the statistics
- * on which the distribution of statements etc. is based.
- *
- * In this C version, the following C library functions are used:
- * - strcpy, strcmp (inside the measurement loop)
- * - printf, scanf (outside the measurement loop)
- * In addition, Berkeley UNIX system calls "times ()" or "time ()"
- * are used for execution time measurement. For measurements
- * on other systems, these calls have to be changed.
- *
- * Collection of Results:
- * Reinhold Weicker (address see above) and
- *
- * Rick Richardson
- * PC Research. Inc.
- * 94 Apple Orchard Drive
- * Tinton Falls, NJ 07724
- * Phone: (201) 389-8963 (9-17 EST)
- * Usenet: ...!uunet!pcrat!rick
- *
- * Please send results to Rick Richardson and/or Reinhold Weicker.
- * Complete information should be given on hardware and software used.
- * Hardware information includes: Machine type, CPU, type and size
- * of caches; for microprocessors: clock frequency, memory speed
- * (number of wait states).
- * Software information includes: Compiler (and runtime library)
- * manufacturer and version, compilation switches, OS version.
- * The Operating System version may give an indication about the
- * compiler; Dhrystone itself performs no OS calls in the measurement loop.
- *
- * The complete output generated by the program should be mailed
- * such that at least some checks for correctness can be made.
- *
- ***************************************************************************
- *
- * History: This version C/2.1 has been made for two reasons:
- *
- * 1) There is an obvious need for a common C version of
- * Dhrystone, since C is at present the most popular system
- * programming language for the class of processors
- * (microcomputers, minicomputers) where Dhrystone is used most.
- * There should be, as far as possible, only one C version of
- * Dhrystone such that results can be compared without
- * restrictions. In the past, the C versions distributed
- * by Rick Richardson (Version 1.1) and by Reinhold Weicker
- * had small (though not significant) differences.
- *
- * 2) As far as it is possible without changes to the Dhrystone
- * statistics, optimizing compilers should be prevented from
- * removing significant statements.
- *
- * This C version has been developed in cooperation with
- * Rick Richardson (Tinton Falls, NJ), it incorporates many
- * ideas from the "Version 1.1" distributed previously by
- * him over the UNIX network Usenet.
- * I also thank Chaim Benedelac (National Semiconductor),
- * David Ditzel (SUN), Earl Killian and John Mashey (MIPS),
- * Alan Smith and Rafael Saavedra-Barrera (UC at Berkeley)
- * for their help with comments on earlier versions of the
- * benchmark.
- *
- * Changes: In the initialization part, this version follows mostly
- * Rick Richardson's version distributed via Usenet, not the
- * version distributed earlier via floppy disk by Reinhold Weicker.
- * As a concession to older compilers, names have been made
- * unique within the first 8 characters.
- * Inside the measurement loop, this version follows the
- * version previously distributed by Reinhold Weicker.
- *
- * At several places in the benchmark, code has been added,
- * but within the measurement loop only in branches that
- * are not executed. The intention is that optimizing compilers
- * should be prevented from moving code out of the measurement
- * loop, or from removing code altogether. Since the statements
- * that are executed within the measurement loop have NOT been
- * changed, the numbers defining the "Dhrystone distribution"
- * (distribution of statements, operand types and locality)
- * still hold. Except for sophisticated optimizing compilers,
- * execution times for this version should be the same as
- * for previous versions.
- *
- * Since it has proven difficult to subtract the time for the
- * measurement loop overhead in a correct way, the loop check
- * has been made a part of the benchmark. This does have
- * an impact - though a very minor one - on the distribution
- * statistics which have been updated for this version.
- *
- * All changes within the measurement loop are described
- * and discussed in the companion paper "Rationale for
- * Dhrystone version 2".
- *
- * Because of the self-imposed limitation that the order and
- * distribution of the executed statements should not be
- * changed, there are still cases where optimizing compilers
- * may not generate code for some statements. To a certain
- * degree, this is unavoidable for small synthetic benchmarks.
- * Users of the benchmark are advised to check code listings
- * whether code is generated for all statements of Dhrystone.
- *
- * Version 2.1 is identical to version 2.0 distributed via
- * the UNIX network Usenet in March 1988 except that it corrects
- * some minor deficiencies that were found by users of version 2.0.
- * The only change within the measurement loop is that a
- * non-executed "else" part was added to the "if" statement in
- * Func_3, and a non-executed "else" part removed from Proc_3.
- *
- ***************************************************************************
- *
- * Defines: The following "Defines" are possible:
- * -DREG=register (default: Not defined)
- * As an approximation to what an average C programmer
- * might do, the "register" storage class is applied
- * (if enabled by -DREG=register)
- * - for local variables, if they are used (dynamically)
- * five or more times
- * - for parameters if they are used (dynamically)
- * six or more times
- * Note that an optimal "register" strategy is
- * compiler-dependent, and that "register" declarations
- * do not necessarily lead to faster execution.
- * -DNOSTRUCTASSIGN (default: Not defined)
- * Define if the C compiler does not support
- * assignment of structures.
- * -DNOENUMS (default: Not defined)
- * Define if the C compiler does not support
- * enumeration types.
- * -DTIMES (default)
- * -DTIME
- * The "times" function of UNIX (returning process times)
- * or the "time" function (returning wallclock time)
- * is used for measurement.
- * For single user machines, "time ()" is adequate. For
- * multi-user machines where you cannot get single-user
- * access, use the "times ()" function. If you have
- * neither, use a stopwatch in the dead of night.
- * "printf"s are provided marking the points "Start Timer"
- * and "Stop Timer". DO NOT use the UNIX "time(1)"
- * command, as this will measure the total time to
- * run this program, which will (erroneously) include
- * the time to allocate storage (malloc) and to perform
- * the initialization.
- * -DHZ=nnn
- * In Berkeley UNIX, the function "times" returns process
- * time in 1/HZ seconds, with HZ = 60 for most systems.
- * CHECK YOUR SYSTEM DESCRIPTION BEFORE YOU JUST APPLY
- * A VALUE.
- *
- ***************************************************************************
- *
- * Compilation model and measurement (IMPORTANT):
- *
- * This C version of Dhrystone consists of three files:
- * - dhry.h (this file, containing global definitions and comments)
- * - dhry_1.c (containing the code corresponding to Ada package Pack_1)
- * - dhry_2.c (containing the code corresponding to Ada package Pack_2)
- *
- * The following "ground rules" apply for measurements:
- * - Separate compilation
- * - No procedure merging
- * - Otherwise, compiler optimizations are allowed but should be indicated
- * - Default results are those without register declarations
- * See the companion paper "Rationale for Dhrystone Version 2" for a more
- * detailed discussion of these ground rules.
- *
- * For 16-Bit processors (e.g. 80186, 80286), times for all compilation
- * models ("small", "medium", "large" etc.) should be given if possible,
- * together with a definition of these models for the compiler system used.
- *
- **************************************************************************
- *
- * Dhrystone (C version) statistics:
- *
- * [Comment from the first distribution, updated for version 2.
- * Note that because of language differences, the numbers are slightly
- * different from the Ada version.]
- *
- * The following program contains statements of a high level programming
- * language (here: C) in a distribution considered representative:
- *
- * assignments 52 (51.0 %)
- * control statements 33 (32.4 %)
- * procedure, function calls 17 (16.7 %)
- *
- * 103 statements are dynamically executed. The program is balanced with
- * respect to the three aspects:
- *
- * - statement type
- * - operand type
- * - operand locality
- * operand global, local, parameter, or constant.
- *
- * The combination of these three aspects is balanced only approximately.
- *
- * 1. Statement Type:
- * ----------------- number
- *
- * V1 = V2 9
- * (incl. V1 = F(..)
- * V = Constant 12
- * Assignment, 7
- * with array element
- * Assignment, 6
- * with record component
- * --
- * 34 34
- *
- * X = Y +|-|"&&"|"|" Z 5
- * X = Y +|-|"==" Constant 6
- * X = X +|- 1 3
- * X = Y *|/ Z 2
- * X = Expression, 1
- * two operators
- * X = Expression, 1
- * three operators
- * --
- * 18 18
- *
- * if .... 14
- * with "else" 7
- * without "else" 7
- * executed 3
- * not executed 4
- * for ... 7 | counted every time
- * while ... 4 | the loop condition
- * do ... while 1 | is evaluated
- * switch ... 1
- * break 1
- * declaration with 1
- * initialization
- * --
- * 34 34
- *
- * P (...) procedure call 11
- * user procedure 10
- * library procedure 1
- * X = F (...)
- * function call 6
- * user function 5
- * library function 1
- * --
- * 17 17
- * ---
- * 103
- *
- * The average number of parameters in procedure or function calls
- * is 1.82 (not counting the function values aX *
- *
- * 2. Operators
- * ------------
- * number approximate
- * percentage
- *
- * Arithmetic 32 50.8
- *
- * + 21 33.3
- * - 7 11.1
- * * 3 4.8
- * / (int div) 1 1.6
- *
- * Comparison 27 42.8
- *
- * == 9 14.3
- * /= 4 6.3
- * > 1 1.6
- * < 3 4.8
- * >= 1 1.6
- * <= 9 14.3
- *
- * Logic 4 6.3
- *
- * && (AND-THEN) 1 1.6
- * | (OR) 1 1.6
- * ! (NOT) 2 3.2
- *
- * -- -----
- * 63 100.1
- *
- *
- * 3. Operand Type (counted once per operand reference):
- * ---------------
- * number approximate
- * percentage
- *
- * Integer 175 72.3 %
- * Character 45 18.6 %
- * Pointer 12 5.0 %
- * String30 6 2.5 %
- * Array 2 0.8 %
- * Record 2 0.8 %
- * --- -------
- * 242 100.0 %
- *
- * When there is an access path leading to the final operand (e.g. a record
- * component), only the final data type on the access path is counted.
- *
- *
- * 4. Operand Locality:
- * -------------------
- * number approximate
- * percentage
- *
- * local variable 114 47.1 %
- * global variable 22 9.1 %
- * parameter 45 18.6 %
- * value 23 9.5 %
- * reference 22 9.1 %
- * function result 6 2.5 %
- * constant 55 22.7 %
- * --- -------
- * 242 100.0 %
- *
- *
- * The program does not compute anything meaningful, but it is syntactically
- * and semantically correct. All variables have a value assigned to them
- * before they are used as a source operand.
- *
- * There has been no explicit effort to account for the effects of a
- * cache, or to balance the use of long or short displacements for code or
- * data.
- *
- ***************************************************************************
- */
-
-/* Compiler and system dependent definitions: */
-
-#ifndef TIME
-#undef TIMES
-#define TIMES
-#endif
- /* Use times(2) time function unless */
- /* explicitly defined otherwise */
-#ifdef MSC_CLOCK
-#undef HZ
-#undef TIMES
-#include
-#define HZ CLK_TCK
-#endif
- /* Use Microsoft C hi-res clock */
-
-#ifdef TIMES
-#include
-#include
- /* for "times" */
-#endif
-
-#define Mic_secs_Per_Second 1000000.0
- /* Berkeley UNIX C returns process times in seconds/HZ */
-
-#ifdef NOSTRUCTASSIGN
-#define structassign(d, s) memcpy(&(d), &(s), sizeof(d))
-#else
-#define structassign(d, s) d = s
-#endif
-
-#ifdef NOENUM
-#define Ident_1 0
-#define Ident_2 1
-#define Ident_3 2
-#define Ident_4 3
-#define Ident_5 4
- typedef int Enumeration;
-#else
- typedef enum {Ident_1, Ident_2, Ident_3, Ident_4, Ident_5}
- Enumeration;
-#endif
- /* for boolean and enumeration types in Ada, Pascal */
-
-/* General definitions: */
-
-#include
- /* for strcpy, strcmp */
-
-#define Null 0
- /* Value of a Null pointer */
-#define true 1
-#define false 0
-
-typedef int One_Thirty;
-typedef int One_Fifty;
-typedef char Capital_Letter;
-typedef int Boolean;
-typedef char Str_30 [31];
-typedef int Arr_1_Dim [50];
-typedef int Arr_2_Dim [50] [50];
-
-typedef struct record
- {
- struct record *Ptr_Comp;
- Enumeration Discr;
- union {
- struct {
- Enumeration Enum_Comp;
- int Int_Comp;
- char Str_Comp [31];
- } var_1;
- struct {
- Enumeration E_Comp_2;
- char Str_2_Comp [31];
- } var_2;
- struct {
- char Ch_1_Comp;
- char Ch_2_Comp;
- } var_3;
- } variant;
- } Rec_Type, *Rec_Pointer;
-
-
diff --git a/lib/CPUs/MIPS/bsp/examples/dhry_1.c b/lib/CPUs/MIPS/bsp/examples/dhry_1.c
deleted file mode 100644
index f7b8373..0000000
--- a/lib/CPUs/MIPS/bsp/examples/dhry_1.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- ****************************************************************************
- *
- * "DHRYSTONE" Benchmark Program
- * -----------------------------
- *
- * Version: C, Version 2.1
- *
- * File: dhry_1.c (part 2 of 3)
- *
- * Date: May 25, 1988
- *
- * Author: Reinhold P. Weicker
- *
- ****************************************************************************
- */
-
-#include "dhry.h"
-
-/* Global Variables: */
-
-Rec_Pointer Ptr_Glob,
- Next_Ptr_Glob;
-int Int_Glob;
-Boolean Bool_Glob;
-char Ch_1_Glob,
- Ch_2_Glob;
-int Arr_1_Glob [50];
-int Arr_2_Glob [50] [50];
-
-extern char *malloc ();
-Enumeration Func_1 ();
- /* forward declaration necessary since Enumeration may not simply be int */
-
-#ifndef REG
- Boolean Reg = false;
-#define REG
- /* REG becomes defined as empty */
- /* i.e. no register variables */
-#else
- Boolean Reg = true;
-#endif
-
-/* variables for time measurement: */
-
-#ifdef TIMES
-struct tms time_info;
- /* see library function "times" */
-#define Too_Small_Time (2*HZ)
- /* Measurements should last at least about 2 seconds */
-#endif
-#ifdef TIME
-extern long time();
- /* see library function "time" */
-#define Too_Small_Time 2
- /* Measurements should last at least 2 seconds */
-#endif
-#ifdef MSC_CLOCK
-extern clock_t clock();
-#define Too_Small_Time (2*HZ)
-#endif
-
-long Begin_Time,
- End_Time,
- User_Time;
-float Microseconds,
- Dhrystones_Per_Second;
-
-/* end of variables for time measurement */
-
-
-main ()
-/*****/
-
- /* main program, corresponds to procedures */
- /* Main and Proc_0 in the Ada version */
-{
- One_Fifty Int_1_Loc;
- REG One_Fifty Int_2_Loc;
- One_Fifty Int_3_Loc;
- REG char Ch_Index;
- Enumeration Enum_Loc;
- Str_30 Str_1_Loc;
- Str_30 Str_2_Loc;
- REG int Run_Index;
- REG int Number_Of_Runs;
-
- /* Initializations */
-
- Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
- Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
-
- Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
- Ptr_Glob->Discr = Ident_1;
- Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
- Ptr_Glob->variant.var_1.Int_Comp = 40;
- strcpy (Ptr_Glob->variant.var_1.Str_Comp,
- "DHRYSTONE PROGRAM, SOME STRING");
- strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
-
- Arr_2_Glob [8][7] = 10;
- /* Was missing in published program. Without this statement, */
- /* Arr_2_Glob [8][7] would have an undefined value. */
- /* Warning: With 16-Bit processors and Number_Of_Runs > 32000, */
- /* overflow may occur for this array element. */
-
- /*
- printf ("\n");
- printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
- printf ("\n");
- if (Reg)
- {
- printf ("Program compiled with 'register' attribute\n");
- printf ("\n");
- }
- else
- {
- printf ("Program compiled without 'register' attribute\n");
- printf ("\n");
- }
- printf ("Please give the number of runs through the benchmark: ");
- {
- int n;
- scanf ("%d", &n);
- Number_Of_Runs = n;
- }
- printf ("\n");
- */
-#ifdef NRUNS
- Number_Of_Runs = NRUNS;
-#else
- Number_Of_Runs = 2000000;
-#endif
- printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
-
- /***************/
- /* Start timer */
- /***************/
-
-#ifdef TIMES
- times (&time_info);
- Begin_Time = (long) time_info.tms_utime;
-#endif
-#ifdef TIME
- Begin_Time = time ( (long *) 0);
-#endif
-#ifdef MSC_CLOCK
- Begin_Time = clock();
-#endif
-
- for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
- {
-
- Proc_5();
- Proc_4();
- /* Ch_1_Glob == 'A', Ch_2_Glob == 'B', Bool_Glob == true */
- Int_1_Loc = 2;
- Int_2_Loc = 3;
- strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
- Enum_Loc = Ident_2;
- Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
- /* Bool_Glob == 1 */
- while (Int_1_Loc < Int_2_Loc) /* loop body executed once */
- {
- Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
- /* Int_3_Loc == 7 */
- Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
- /* Int_3_Loc == 7 */
- Int_1_Loc += 1;
- } /* while */
- /* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
- Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
- /* Int_Glob == 5 */
- Proc_1 (Ptr_Glob);
- for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
- /* loop body executed twice */
- {
- if (Enum_Loc == Func_1 (Ch_Index, 'C'))
- /* then, not executed */
- {
- Proc_6 (Ident_1, &Enum_Loc);
- strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
- Int_2_Loc = Run_Index;
- Int_Glob = Run_Index;
- }
- }
- /* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
- Int_2_Loc = Int_2_Loc * Int_1_Loc;
- Int_1_Loc = Int_2_Loc / Int_3_Loc;
- Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
- /* Int_1_Loc == 1, Int_2_Loc == 13, Int_3_Loc == 7 */
- Proc_2 (&Int_1_Loc);
- /* Int_1_Loc == 5 */
-
- } /* loop "for Run_Index" */
-
- /**************/
- /* Stop timer */
- /**************/
-
-#ifdef TIMES
- times (&time_info);
- End_Time = (long) time_info.tms_utime;
-#endif
-#ifdef TIME
- End_Time = time ( (long *) 0);
-#endif
-#ifdef MSC_CLOCK
- End_Time = clock();
-#endif
- /*
- printf ("Execution ends\n");
- printf ("\n");
- printf ("Final values of the variables used in the benchmark:\n");
- printf ("\n");
- printf ("Int_Glob: %d\n", Int_Glob);
- printf (" should be: %d\n", 5);
- printf ("Bool_Glob: %d\n", Bool_Glob);
- printf (" should be: %d\n", 1);
- printf ("Ch_1_Glob: %c\n", Ch_1_Glob);
- printf (" should be: %c\n", 'A');
- printf ("Ch_2_Glob: %c\n", Ch_2_Glob);
- printf (" should be: %c\n", 'B');
- printf ("Arr_1_Glob[8]: %d\n", Arr_1_Glob[8]);
- printf (" should be: %d\n", 7);
- printf ("Arr_2_Glob[8][7]: %d\n", Arr_2_Glob[8][7]);
- printf (" should be: Number_Of_Runs + 10\n");
- printf ("Ptr_Glob->\n");
- printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
- printf (" should be: (implementation-dependent)\n");
- printf (" Discr: %d\n", Ptr_Glob->Discr);
- printf (" should be: %d\n", 0);
- printf (" Enum_Comp: %d\n", Ptr_Glob->variant.var_1.Enum_Comp);
- printf (" should be: %d\n", 2);
- printf (" Int_Comp: %d\n", Ptr_Glob->variant.var_1.Int_Comp);
- printf (" should be: %d\n", 17);
- printf (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
- printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
- printf ("Next_Ptr_Glob->\n");
- printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
- printf (" should be: (implementation-dependent), same as above\n");
- printf (" Discr: %d\n", Next_Ptr_Glob->Discr);
- printf (" should be: %d\n", 0);
- printf (" Enum_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Enum_Comp);
- printf (" should be: %d\n", 1);
- printf (" Int_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Int_Comp);
- printf (" should be: %d\n", 18);
- printf (" Str_Comp: %s\n",
- Next_Ptr_Glob->variant.var_1.Str_Comp);
- printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
- printf ("Int_1_Loc: %d\n", Int_1_Loc);
- printf (" should be: %d\n", 5);
- printf ("Int_2_Loc: %d\n", Int_2_Loc);
- printf (" should be: %d\n", 13);
- printf ("Int_3_Loc: %d\n", Int_3_Loc);
- printf (" should be: %d\n", 7);
- printf ("Enum_Loc: %d\n", Enum_Loc);
- printf (" should be: %d\n", 1);
- printf ("Str_1_Loc: %s\n", Str_1_Loc);
- printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
- printf ("Str_2_Loc: %s\n", Str_2_Loc);
- printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
- printf ("\n");
-
-*/
- User_Time = End_Time - Begin_Time;
-
- if (User_Time < Too_Small_Time)
- {
- printf ("Measured time too small to obtain meaningful results\n");
- printf ("Please increase number of runs\n");
- printf ("\n");
- }
- else
- {
-#ifdef TIME
- Microseconds = (float) User_Time * Mic_secs_Per_Second
- / (float) Number_Of_Runs;
- Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time;
-#else
- Microseconds = (float) User_Time * Mic_secs_Per_Second
- / ((float) HZ * ((float) Number_Of_Runs));
- Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs)
- / (float) User_Time;
-#endif
- printf ("Microseconds for one run through Dhrystone: ");
- printf ("%6.1f \n", Microseconds);
- printf ("Dhrystones per Second: ");
- printf ("%6.1f \n", Dhrystones_Per_Second);
- printf ("\n");
- printf ("This equals to %6.1f DMIPS\n", Dhrystones_Per_Second/1757);
- }
-
-}
-
-
-Proc_1 (Ptr_Val_Par)
-/******************/
-
-REG Rec_Pointer Ptr_Val_Par;
- /* executed once */
-{
- REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
- /* == Ptr_Glob_Next */
- /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */
- /* corresponds to "rename" in Ada, "with" in Pascal */
-
- structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
- Ptr_Val_Par->variant.var_1.Int_Comp = 5;
- Next_Record->variant.var_1.Int_Comp
- = Ptr_Val_Par->variant.var_1.Int_Comp;
- Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
- Proc_3 (&Next_Record->Ptr_Comp);
- /* Ptr_Val_Par->Ptr_Comp->Ptr_Comp
- == Ptr_Glob->Ptr_Comp */
- if (Next_Record->Discr == Ident_1)
- /* then, executed */
- {
- Next_Record->variant.var_1.Int_Comp = 6;
- Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
- &Next_Record->variant.var_1.Enum_Comp);
- Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
- Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
- &Next_Record->variant.var_1.Int_Comp);
- }
- else /* not executed */
- structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
-} /* Proc_1 */
-
-
-Proc_2 (Int_Par_Ref)
-/******************/
- /* executed once */
- /* *Int_Par_Ref == 1, becomes 4 */
-
-One_Fifty *Int_Par_Ref;
-{
- One_Fifty Int_Loc;
- Enumeration Enum_Loc;
-
- Int_Loc = *Int_Par_Ref + 10;
- do /* executed once */
- if (Ch_1_Glob == 'A')
- /* then, executed */
- {
- Int_Loc -= 1;
- *Int_Par_Ref = Int_Loc - Int_Glob;
- Enum_Loc = Ident_1;
- } /* if */
- while (Enum_Loc != Ident_1); /* true */
-} /* Proc_2 */
-
-
-Proc_3 (Ptr_Ref_Par)
-/******************/
- /* executed once */
- /* Ptr_Ref_Par becomes Ptr_Glob */
-
-Rec_Pointer *Ptr_Ref_Par;
-
-{
- if (Ptr_Glob != Null)
- /* then, executed */
- *Ptr_Ref_Par = Ptr_Glob->Ptr_Comp;
- Proc_7 (10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
-} /* Proc_3 */
-
-
-Proc_4 () /* without parameters */
-/*******/
- /* executed once */
-{
- Boolean Bool_Loc;
-
- Bool_Loc = Ch_1_Glob == 'A';
- Bool_Glob = Bool_Loc | Bool_Glob;
- Ch_2_Glob = 'B';
-} /* Proc_4 */
-
-
-Proc_5 () /* without parameters */
-/*******/
- /* executed once */
-{
- Ch_1_Glob = 'A';
- Bool_Glob = false;
-} /* Proc_5 */
-
-
- /* Procedure for the assignment of structures, */
- /* if the C compiler doesn't support this feature */
-#ifdef NOSTRUCTASSIGN
-memcpy (d, s, l)
-register char *d;
-register char *s;
-register int l;
-{
- while (l--) *d++ = *s++;
-}
-#endif
-
-
diff --git a/lib/CPUs/MIPS/bsp/examples/dhry_2.c b/lib/CPUs/MIPS/bsp/examples/dhry_2.c
deleted file mode 100644
index 63a3d3e..0000000
--- a/lib/CPUs/MIPS/bsp/examples/dhry_2.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- ****************************************************************************
- *
- * "DHRYSTONE" Benchmark Program
- * -----------------------------
- *
- * Version: C, Version 2.1
- *
- * File: dhry_2.c (part 3 of 3)
- *
- * Date: May 25, 1988
- *
- * Author: Reinhold P. Weicker
- *
- ****************************************************************************
- */
-
-#include "dhry.h"
-
-#ifndef REG
-#define REG
- /* REG becomes defined as empty */
- /* i.e. no register variables */
-#endif
-
-extern int Int_Glob;
-extern char Ch_1_Glob;
-
-
-Proc_6 (Enum_Val_Par, Enum_Ref_Par)
-/*********************************/
- /* executed once */
- /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
-
-Enumeration Enum_Val_Par;
-Enumeration *Enum_Ref_Par;
-{
- *Enum_Ref_Par = Enum_Val_Par;
- if (! Func_3 (Enum_Val_Par))
- /* then, not executed */
- *Enum_Ref_Par = Ident_4;
- switch (Enum_Val_Par)
- {
- case Ident_1:
- *Enum_Ref_Par = Ident_1;
- break;
- case Ident_2:
- if (Int_Glob > 100)
- /* then */
- *Enum_Ref_Par = Ident_1;
- else *Enum_Ref_Par = Ident_4;
- break;
- case Ident_3: /* executed */
- *Enum_Ref_Par = Ident_2;
- break;
- case Ident_4: break;
- case Ident_5:
- *Enum_Ref_Par = Ident_3;
- break;
- } /* switch */
-} /* Proc_6 */
-
-
-Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
-/**********************************************/
- /* executed three times */
- /* first call: Int_1_Par_Val == 2, Int_2_Par_Val == 3, */
- /* Int_Par_Ref becomes 7 */
- /* second call: Int_1_Par_Val == 10, Int_2_Par_Val == 5, */
- /* Int_Par_Ref becomes 17 */
- /* third call: Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
- /* Int_Par_Ref becomes 18 */
-One_Fifty Int_1_Par_Val;
-One_Fifty Int_2_Par_Val;
-One_Fifty *Int_Par_Ref;
-{
- One_Fifty Int_Loc;
-
- Int_Loc = Int_1_Par_Val + 2;
- *Int_Par_Ref = Int_2_Par_Val + Int_Loc;
-} /* Proc_7 */
-
-
-Proc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
-/*********************************************************************/
- /* executed once */
- /* Int_Par_Val_1 == 3 */
- /* Int_Par_Val_2 == 7 */
-Arr_1_Dim Arr_1_Par_Ref;
-Arr_2_Dim Arr_2_Par_Ref;
-int Int_1_Par_Val;
-int Int_2_Par_Val;
-{
- REG One_Fifty Int_Index;
- REG One_Fifty Int_Loc;
-
- Int_Loc = Int_1_Par_Val + 5;
- Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
- Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
- Arr_1_Par_Ref [Int_Loc+30] = Int_Loc;
- for (Int_Index = Int_Loc; Int_Index <= Int_Loc+1; ++Int_Index)
- Arr_2_Par_Ref [Int_Loc] [Int_Index] = Int_Loc;
- Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
- Arr_2_Par_Ref [Int_Loc+20] [Int_Loc] = Arr_1_Par_Ref [Int_Loc];
- Int_Glob = 5;
-} /* Proc_8 */
-
-
-Enumeration Func_1 (Ch_1_Par_Val, Ch_2_Par_Val)
-/*************************************************/
- /* executed three times */
- /* first call: Ch_1_Par_Val == 'H', Ch_2_Par_Val == 'R' */
- /* second call: Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C' */
- /* third call: Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C' */
-
-Capital_Letter Ch_1_Par_Val;
-Capital_Letter Ch_2_Par_Val;
-{
- Capital_Letter Ch_1_Loc;
- Capital_Letter Ch_2_Loc;
-
- Ch_1_Loc = Ch_1_Par_Val;
- Ch_2_Loc = Ch_1_Loc;
- if (Ch_2_Loc != Ch_2_Par_Val)
- /* then, executed */
- return (Ident_1);
- else /* not executed */
- {
- Ch_1_Glob = Ch_1_Loc;
- return (Ident_2);
- }
-} /* Func_1 */
-
-
-Boolean Func_2 (Str_1_Par_Ref, Str_2_Par_Ref)
-/*************************************************/
- /* executed once */
- /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
- /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
-
-Str_30 Str_1_Par_Ref;
-Str_30 Str_2_Par_Ref;
-{
- REG One_Thirty Int_Loc;
- Capital_Letter Ch_Loc;
-
- Int_Loc = 2;
- while (Int_Loc <= 2) /* loop body executed once */
- if (Func_1 (Str_1_Par_Ref[Int_Loc],
- Str_2_Par_Ref[Int_Loc+1]) == Ident_1)
- /* then, executed */
- {
- Ch_Loc = 'A';
- Int_Loc += 1;
- } /* if, while */
- if (Ch_Loc >= 'W' && Ch_Loc < 'Z')
- /* then, not executed */
- Int_Loc = 7;
- if (Ch_Loc == 'R')
- /* then, not executed */
- return (true);
- else /* executed */
- {
- if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
- /* then, not executed */
- {
- Int_Loc += 7;
- Int_Glob = Int_Loc;
- return (true);
- }
- else /* executed */
- return (false);
- } /* if Ch_Loc */
-} /* Func_2 */
-
-
-Boolean Func_3 (Enum_Par_Val)
-/***************************/
- /* executed once */
- /* Enum_Par_Val == Ident_3 */
-Enumeration Enum_Par_Val;
-{
- Enumeration Enum_Loc;
-
- Enum_Loc = Enum_Par_Val;
- if (Enum_Loc == Ident_3)
- /* then, executed */
- return (true);
- else /* not executed */
- return (false);
-} /* Func_3 */
-
diff --git a/lib/CPUs/MIPS/bsp/examples/dttl.c b/lib/CPUs/MIPS/bsp/examples/dttl.c
deleted file mode 100644
index 8efffa2..0000000
--- a/lib/CPUs/MIPS/bsp/examples/dttl.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/* dttl.c -- simulation of Cassini/Huygens symbol synchronizer loop
- *
- * Author: Lorenzo Simone's (matlab script)
- * Modifications by: Jon Hamkins (conversion to C, support routines,
- * memory requirement reductions)
- * Last Revised: Wed Jan 31 10:47:52 PST 2001
- */
-#define M_PI 3.1415926535897932384626433832795
-
-#include
-#include
-#include "random.h"
-
-/* global variables */
-int delay,
- L; /* samples per symbol */
-double Pt, /* transition density */
- sigma; /* noise standard deviation */
-long seed=-123;
-
-/* This function simulates a large 1-dimensional array without requiring
- * storage for the whole array. This is possible because the array is
- * accessed in roughly increasing indices. Thus, we only need to
- * store a few symbols worth of samples in the array, and we can reuse
- * the array indices as time goes on. */
-int drint(double v)
-{
- return (int)(v+0.5);
-}
-
-double
-rec(int idx)
-{
- static int firsttime = 1,
- max, /* maximum index containing data */
- mod, /* length of ring buffer */
- b; /* value of last transmitted bit */
- static double r[2000]; /* need several symbols worth of samples */
- int i,j,k;
-
- /* First time, store samples for random delay and first few symbols */
- if (firsttime==1) {
- firsttime=0;
- for (i=0; i0.5) ? 1 : -1; /* first random symbol */
- for (j=0; j<3; j++) { /* 3 binary symbols with transition Pt */
- b = (ran1(&seed)>Pt) ? b : -b; /* next symbol value */
- for (k=0; kmax) /* check if we need to create another sample */
- {
- b = (ran1(&seed)>Pt) ? b : -b; /* next symbol value */
- /* generate samples for one symbol and store in ring buffer */
- for (i=1; i<=L; i++) r[(int)(fmod(max+i,mod))] = b+sigma*gaussian(&seed);
- max += L; /* maximum index for which samples exist */
- }
- /* return appropriate sample from ring buffer */
- return(r[(int)(fmod(idx,mod))]);
-}
-
-main()
-{
- double
- detout, /* detector output */
- I, old_I, /* in-phase accumulations */
- Q, old_Q, /* quadrature accumulations */
- T, /* transition detection */
- theta, /* baseband NCO output (radians) */
- lambda, /* normalized timing error (symbols) */
- A, alfa, Ampl, Bl, Df,
- DR, Es_No, Es_No_lin, Fc1, Fc2, Fvco, Fs, Kd, Kv,
- lambda_ss_sim = 0., lambda_ss_th, No, P, P_No,
- sigma_lambda_sim = 0., sigma_lambda_th, SNR_sim, SNR_th, tau, Tc1, Tc2,
- time, Ts, x1, Y, bit_I, bit_Q, bit;
- int i, j, k, N, offset, k1, k2, EOB;
- FILE *p1, *p2, *p3, *p4, *p5;
-
- /* Data settings */
- Fc1 = 48000; /* sample rate at DTTL input (F1/2 = 8.215MHz/2) */
- Tc1 = 1./Fc1;
-
- DR = 4800; /* data rate (symb/sec) */
-
- Fc2 = DR; /* sampling rate pre-detection */
- Tc2 = 1./Fc2;
-
- L = drint(Tc2/Tc1); /* samples per symbol in the arm filters */
- offset = drint(L/2.);
-
- Es_No = 600.; /* dB */
- P_No = Es_No+10.*log10(DR); /* data power-over-noise spectral density */
- /* ratio (dBHz) */
-
- N = 2500; /* number of symbols to simulate */
- Pt=.5; /* Transition density */
-
- Bl=0.01*DR; /* loop bandwidth (Hz) */
- Df=0.001*DR; /* frequency offset */
- Fvco=DR+Df;
-
- tau=ran1(&seed)-.5; /* set symbol timing offset, -.5 to .5 */
- delay=drint(2.*L+tau*L+1); /* channel delay */
-
- P=1.; /* data power */
- Ampl=sqrt(P);
-
- No=10.*log10(P*Tc2)-Es_No; /* noise spectral density (dBW/Hz) */
- sigma=sqrt(pow(10.,0.1*No)/(2.*Tc1));
- printf("sigma=%f\n",sigma);
-
- /* DPLL settings */
- Fs=DR; /* loop sampling frequency (Hz) */
- Ts=1./Fs; /* loop sampling time (s) */
-
- /* Loop gain */
- Kd=2.*Ampl*Pt; /* phase detector gain (quants/rad) */
- /* @ high Es/No */
- Kv=1.; /* VCO gain (rad/quants) */
-
- /* Analog loop filter components */
- alfa=4.*Bl/(Kd*Kv);
-
- /* Digital loop filter components */
- A=alfa*Ts;
-
- /* Initial condition */
- theta = 0;
- old_I=1;
- old_Q=1;
- x1=0;
- Y=0;
-
- /* Plot data files */
-// p1 = fopen("plot1.dat","w"); /* theta */
-// p2 = fopen("plot2.dat","w"); /* lambda */
-// p3 = fopen("plot3.dat","w"); /* detout */
-// p4 = fopen("plot4.dat","w"); /* I-Data */
-// p5 = fopen("plot5.dat","w"); /* Q-Data */
-
- k1 = drint(0.5*N);
- k2 = N;
-
- printf("Data rate: %.0f symbols/sec\n",DR);
- printf("Sample rate at DTTL input: %.0f samples/sec\n",Fc1);
- printf("Samples per symbol: %d\n",L);
- printf("Random delay set to: %f symbols (%d samples)\n",tau,delay);
- printf("Transition density used in random bit generation: %f\n",Pt);
- printf("Es/No: %f dB\n",Es_No);
- printf("Loop bandwidth: %f Hz\n",Bl);
- printf("Doppler: %f Hz\n",Df);
- printf("Simulation length: %d symbols (%d samples)\n\n",N,N*L+delay);
-
- /* Simulation Loop */
- for (i=2; i<=N; i++)
- {
- /* loop over symbols */
- /* find start of in-phase integration */
- for (j=1; j < L; j++)
- {
- if (fmod(theta + 2*M_PI * Fvco*(j+1+(i-1)*(Fc1/DR))/Fc1, 2*M_PI)
- < fmod(theta + 2*M_PI * Fvco*(j +(i-1)*(Fc1/DR))/Fc1, 2*M_PI))
- break;
- /* one could replace loop above with a direct calculation such as: */
- /* j=ceil((1.-modulo(theta/(2*M_PI),1.))/(Fvco*Tc1))-1.; */
- /* j+1 is the first index in the block */
- EOB=j+(i-1)*L; /* End of Block */
- }
- /* In-phase integrator */
- bit_I = 0.;
- printf("Symbol # %d\n", i);
- printf("I[%d:%d] :\n", EOB-L+1, EOB);
- for (j=EOB-L+1; j<=EOB; j++)
- {
- bit = rec(j);
- if (bit > 0)
- printf("-");
- else
- printf("_");
-
- bit_I += bit;
- }
- printf("\n");
- I = bit_I;
-
- /* Mid-Phase integrator */
- bit_Q = 0.;
- printf("Q[%d:%d] :\n", EOB-L+offset+1, EOB+offset);
- for (j=EOB-L+offset+1; j<=EOB+offset; j++)
- {
- bit = rec(j);
- if (bit > 0)
- printf("-");
- else
- printf("_");
-
- bit_Q += bit;
- }
- printf("\n\n");
- Q = bit_Q;
-
- Q *= 2.*M_PI/(Tc2/Tc1);
-
- /* Transition Detector */
- I = (I > 0) ? 1. : -1.; /* hard limiter */
- T = 0.5*(I - old_I);
-
- /* Detector Output */
- detout = fmod(old_Q*T,2*M_PI);
-
- /* Save accumulations for next time through loop */
- old_I = I;
- old_Q = Q;
- if (fabs(detout)>M_PI)
- detout = -detout+2*M_PI*((detout>0) ? 1. : -1.);
-
- /* NCO */
- Y += detout*A; /* Loop filter */
- theta=Kv*Y; /* phase */
-// lambda = theta/(2.*M_PI)+(i*Tc2*Df+tau); /* normalized error */
- lambda = theta/(2.*M_PI)+(i*(Fvco/DR -1) + tau); /* normalized error */
-
- /* error mean and variance calculation */
- lambda_ss_sim += lambda; /* partial sum */
- sigma_lambda_sim += lambda*lambda; /* partial sum of squares */
-
- /* store phase and normalized error to data files */
-// fprintf(p1,"%f %f\n",(double)i,theta);
-// fprintf(p2,"%f %f\n",(double)i,lambda);
-// fprintf(p3,"%f %f\n",(double)i,detout);
-// fprintf(p4,"%f %f\n",(double)i,I);
-// fprintf(p5,"%f %f\n",(double)i,Q);
- }
-// fclose(p1);
-// fclose(p2);
-// fclose(p3);
-// fclose(p4);
-// fclose(p5);
-
- /* Statistics Analysis */
- /* ------------------- */
- /* complete the mean and variance calculation */
- lambda_ss_sim /= N;
- sigma_lambda_sim = sigma_lambda_sim/N - lambda_ss_sim*lambda_ss_sim;
- Es_No_lin = pow(10.,0.1*Es_No);
-// sigma_lambda_th = Bl*Tc2/(4.*Pt*Es_No_lin*pow(erf(sqrt(Es_No_lin)),2.));
- sigma_lambda_th = Bl*Tc2/(4.*Pt*Es_No_lin*Es_No_lin);
- SNR_sim = -10*log10(sigma_lambda_sim);
- SNR_th = -10*log10(sigma_lambda_th);
- /* Steady-State error */
- lambda_ss_th=Df/(4.*Bl);
- printf("Simulation: var: %f rad^2 loop SNR: %f dB ss error: %f%%\n",
- sigma_lambda_sim, SNR_sim, 100.*lambda_ss_sim);
- printf("Theory: var: %f rad^2 loop SNR: %f dB ss error: %f%%\n",
- sigma_lambda_th, SNR_th, 100.*lambda_ss_th);
-// system("gnuplot < plot1.gp");
-// system("gnuplot < plot2.gp");
- printf("Done.\n");
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/gunzip.c b/lib/CPUs/MIPS/bsp/examples/gunzip.c
deleted file mode 100644
index 066c88e..0000000
--- a/lib/CPUs/MIPS/bsp/examples/gunzip.c
+++ /dev/null
@@ -1,198 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define CPU_FREQ_HZ 100000000
-#include "libsys.h"
-
-#include "crc32.h"
-#include "inflate.h"
-
-char buffer[1024*1024];
-char * volatile pPtr_r;
-char * volatile pPtr_w;
-volatile int timeout_cnt;
-volatile int file_len;
-
-void handler3(void)
-{
- volatile UINT32 *pUART_stat = (UINT32*)SYS_UART0_STAT;
- volatile UINT32 *pUART_data = (UINT32*)SYS_UART0_DATA;
-
- while(0x200 & *pUART_stat)
- {
-// sputs("w: "); print_word((int)pPtr_w); sputs("\n");
- if (pPtr_w == &buffer[sizeof(buffer)-1])
- pPtr_w = buffer;
- *(pPtr_w++) = *pUART_data;
- timeout_cnt = 100;
- file_len++;
- }
-
-}
-
-int READBYTE(z_stream *zs) {
- if (zs->avail_in <= 0)
- return -1;
-
- zs->avail_in --;
- return *(zs->next_in ++);
-}
-
-#define MAX_BUFOUT 16*1024*1024
-int main(int argc, char **argv)
-{
- volatile UINT32 *pUART_stat = (UINT32*)SYS_UART0_STAT;
- unsigned char outData[MAX_BUFOUT];
- FILE *infp;
- int i, gpflags, tmp[4];
- unsigned long size, crc;
- unsigned char *fileData;
- unsigned long bytes, InflatedSize, InflatedCRC, speed_count;
- z_stream zs;
- time_t start_time, work_time;
-
- UART0_setbaud(460800);
-
- printf("Reading gzipped stream..\n");
-
- pPtr_r = buffer;
- pPtr_w = buffer;
- *pUART_stat = (1 << 6);
- interrupt_register(3, handler3);
- interrupt_enable(3);
-
- file_len = 0;
- timeout_cnt = 1000000;
- while(timeout_cnt--)
- {
- sleep(1);
- }
-
- printf("file_len: %d\n", file_len);
- bytes = file_len;
- fileData = pPtr_r;
-
- zs.next_in = fileData;
- zs.avail_in = (unsigned int) bytes;
- zs.next_out = outData;
- zs.avail_out = MAX_BUFOUT;
-
- tmp[0] = READBYTE(&zs);
- if (tmp[0] == -1)
- {
- // error reading from file
- printf("error reading data from file\n");
- return 0;
- }
- tmp[1] = READBYTE(&zs);
-
- if (tmp[0] != 0x1f || tmp[1] != 0x8b) {
-// fprintf(stderr, "Magic number mismatch 0x%02x%02x\n",
-// tmp[0], tmp[1]);
- return 20;
- }
-
- tmp[0] = READBYTE(&zs);
- if(tmp[0] != 8) {
-// fprintf(stderr, "Unknown compression method: 0x%02x\n", tmp[0]);
- return 20;
- }
-
- gpflags = READBYTE(&zs);
- if ((gpflags & ~0x1f)) {
- printf("Unknown flags set!\n");
- }
-
- /* Skip file modification time (4 bytes) */
- READBYTE(&zs);
- READBYTE(&zs);
- READBYTE(&zs);
- READBYTE(&zs);
- /* Skip extra flags and operating system fields (2 bytes) */
- READBYTE(&zs);
- READBYTE(&zs);
-
- if ((gpflags & 4)) {
- /* Skip extra field */
- tmp[0] = READBYTE(&zs);
- tmp[1] = READBYTE(&zs);
- i = tmp[0] + 256*tmp[1];
- while (i--)
- {
- READBYTE(&zs);
- }
- }
- if((gpflags & 8)) {
- while((READBYTE(&zs))) {
- }
- }
- if((gpflags & 16)) {
- while((READBYTE(&zs))) {
- }
- }
- if((gpflags & 2)) {
- /* Skip CRC16 */
- READBYTE(&zs);
- READBYTE(&zs);
- }
-
- printf("Go\n");
- // normal test
- start_time = clock();
- if (InflateData(&zs))
- {
- printf("Problem during decompression!\n");
- return 0;
- }
- work_time = clock() - start_time;
-
-
-/*
- // speed test
- fprintf(stdout, "SPEED TEST!\n");
- speed_count = 0;
- while (time(NULL) - start_time < 20)
- {
- zs_speed.next_in = zs.next_in;
- zs_speed.next_out = zs.next_out;
- zs_speed.avail_in = zs.avail_in;
- zs_speed.avail_out = zs.avail_out;
- if (InflateData(&zs_speed))
- {
- fprintf(stdout, "Problem during decompression!\n");
- return 0;
- }
- speed_count ++;
- }
- fprintf(stdout, "speed count %ld\n", speed_count);
- zs.next_in = zs_speed.next_in;
- zs.next_out = zs_speed.next_out;
- zs.avail_in = zs_speed.avail_in;
- zs.avail_out = zs_speed.avail_out;
-*/
-
- crc = READBYTE(&zs);
- crc |= (READBYTE(&zs)<<8);
- crc |= (READBYTE(&zs)<<16);
- crc |= (READBYTE(&zs)<<24);
-
- size = READBYTE(&zs);
- size |= (READBYTE(&zs)<<8);
- size |= (READBYTE(&zs)<<16);
- size |= (READBYTE(&zs)<<24);
-
- InflatedSize = MAX_BUFOUT - zs.avail_out;
- InflatedCRC = MakeCRC32(outData, InflatedSize, 0);
-
-// write(1, outData, InflatedSize);
- fprintf(stdout, "CRC: %08lx %08lx %s\n", crc, InflatedCRC, (crc != InflatedCRC)?"**error**":"");
- fprintf(stdout, "Size: %08lx %08lx %s\n", size, InflatedSize, (size != InflatedSize)?"**error**":"");
- fprintf(stdout, "Time for decompression was %.2f seconds\n", (float)work_time/1000);
- fprintf(stdout, "Throughput is %d kByte/s\n", InflatedSize/work_time);
-
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/hashtest.c b/lib/CPUs/MIPS/bsp/examples/hashtest.c
deleted file mode 100644
index b960966..0000000
--- a/lib/CPUs/MIPS/bsp/examples/hashtest.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/********************************************************************\
- *
- * FILE: hashtest.c
- *
- * CONTENTS: test file for sample C-implementation of
- * RIPEMD-160 and RIPEMD128
- * * command line arguments:
- * filename -- compute hash code of file read binary
- * -sstring -- print string & hashcode
- * -t -- perform time trial
- * -x -- execute standard test suite, ASCII input
- * * for linkage with rmd128.c: define RMDsize as 128
- * for linkage with rmd160.c: define RMDsize as 160 (default)
- * TARGET: any computer with an ANSI C compiler
- *
- * AUTHOR: Antoon Bosselaers, ESAT-COSIC
- * DATE: 18 April 1996
- * VERSION: 1.1
- * HISTORY: bug in RMDonemillion() corrected
- *
- * Copyright (c) Katholieke Universiteit Leuven
- * 1996, All Rights Reserved
- *
- * Conditions for use of the RIPEMD-160 Software
- *
- * The RIPEMD-160 software is freely available for use under the terms and
- * conditions described hereunder, which shall be deemed to be accepted by
- * any user of the software and applicable on any use of the software:
- *
- * 1. K.U.Leuven Department of Electrical Engineering-ESAT/COSIC shall for
- * all purposes be considered the owner of the RIPEMD-160 software and of
- * all copyright, trade secret, patent or other intellectual property
- * rights therein.
- * 2. The RIPEMD-160 software is provided on an "as is" basis without
- * warranty of any sort, express or implied. K.U.Leuven makes no
- * representation that the use of the software will not infringe any
- * patent or proprietary right of third parties. User will indemnify
- * K.U.Leuven and hold K.U.Leuven harmless from any claims or liabilities
- * which may arise as a result of its use of the software. In no
- * circumstances K.U.Leuven R&D will be held liable for any deficiency,
- * fault or other mishappening with regard to the use or performance of
- * the software.
- * 3. User agrees to give due credit to K.U.Leuven in scientific publications
- * or communications in relation with the use of the RIPEMD-160 software
- * as follows: RIPEMD-160 software written by Antoon Bosselaers,
- * available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
- *
-\********************************************************************/
-#ifndef RMDsize
-#define RMDsize 160
-#endif
-
-#include
-#include
-#include
-#include
-#if RMDsize == 128
-#include "rmd128.h"
-#elif RMDsize == 160
-#include "rmd160.h"
-#endif
-
-#define TEST_BLOCK_SIZE 8000
-#define TEST_BLOCKS 1250
-#define TEST_BYTES ((long)TEST_BLOCK_SIZE * (long)TEST_BLOCKS)
-
-/********************************************************************/
-
-byte *RMD(byte *message)
-/*
- * returns RMD(message)
- * message should be a string terminated by '\0'
- */
-{
- dword MDbuf[RMDsize/32]; /* contains (A, B, C, D(, E)) */
- static byte hashcode[RMDsize/8]; /* for final hash-value */
- dword X[16]; /* current 16-word chunk */
- unsigned int i; /* counter */
- dword length; /* length in bytes of message */
- dword nbytes; /* # of bytes not yet processed */
-
- /* initialize */
- MDinit(MDbuf);
- length = (dword)strlen((char *)message);
-
- /* process message in 16-word chunks */
- for (nbytes=length; nbytes > 63; nbytes-=64) {
- for (i=0; i<16; i++) {
- X[i] = BYTES_TO_DWORD(message);
- message += 4;
- }
- compress(MDbuf, X);
- } /* length mod 64 bytes left */
-
- /* finish: */
- MDfinish(MDbuf, message, length, 0);
-
- for (i=0; i>2]; /* implicit cast to byte */
- hashcode[i+1] = (MDbuf[i>>2] >> 8); /* extracts the 8 least */
- hashcode[i+2] = (MDbuf[i>>2] >> 16); /* significant bits. */
- hashcode[i+3] = (MDbuf[i>>2] >> 24);
- }
-
- return (byte *)hashcode;
-}
-
-/********************************************************************/
-
-byte *RMDbinary(char *fname)
-/*
- * returns RMD(message in file fname)
- * fname is read as binary data.
- */
-{
- FILE *mf; /* pointer to file */
- byte data[1024]; /* contains current mess. block */
- dword nbytes; /* length of this block */
- dword MDbuf[RMDsize/32]; /* contains (A, B, C, D(, E)) */
- static byte hashcode[RMDsize/8]; /* for final hash-value */
- dword X[16]; /* current 16-word chunk */
- unsigned int i, j; /* counters */
- dword length[2]; /* length in bytes of message */
- dword offset; /* # of unprocessed bytes at */
- /* call of MDfinish */
-
- /* initialize */
- if ((mf = fopen(fname, "rb")) == NULL) {
- fprintf(stderr, "\nRMDbinary: cannot open file \"%s\".\n",
- fname);
- exit(1);
- }
- MDinit(MDbuf);
- length[0] = 0;
- length[1] = 0;
-
- while ((nbytes = fread(data, 1, 1024, mf)) != 0) {
- /* process all complete blocks */
- for (i=0; i<(nbytes>>6); i++) {
- for (j=0; j<16; j++)
- X[j] = BYTES_TO_DWORD(data+64*i+4*j);
- compress(MDbuf, X);
- }
- /* update length[] */
- if (length[0] + nbytes < length[0])
- length[1]++; /* overflow to msb of length */
- length[0] += nbytes;
- }
-
- /* finish: */
- offset = length[0] & 0x3C0; /* extract bytes 6 to 10 inclusive */
- MDfinish(MDbuf, data+offset, length[0], length[1]);
-
- for (i=0; i>2];
- hashcode[i+1] = (MDbuf[i>>2] >> 8);
- hashcode[i+2] = (MDbuf[i>>2] >> 16);
- hashcode[i+3] = (MDbuf[i>>2] >> 24);
- }
-
- fclose(mf);
-
- return (byte *)hashcode;
-}
-
-/********************************************************************/
-
-void speedtest(void)
-/*
- * A time trial routine, to measure the speed of ripemd.
- * Measures processor time required to process TEST_BLOCKS times
- * a message of TEST_BLOCK_SIZE characters.
- */
-{
- clock_t t0, t1;
- byte *data;
- byte hashcode[RMDsize/8];
- dword X[16];
- dword MDbuf[RMDsize/32];
- unsigned int i, j, k;
-
- srand(time(NULL));
-
- /* allocate and initialize test data */
- if ((data = (byte*)malloc(TEST_BLOCK_SIZE)) == NULL) {
- fprintf(stderr, "speedtest: allocation error\n");
- exit(1);
- }
- for (i=0; i> 7);
-
- /* start timer */
- printf("\n\nRIPEMD-%u time trial. Processing %ld characters...\n",
- RMDsize, TEST_BYTES);
- t0 = clock();
-
- /* process data */
- MDinit(MDbuf);
- for (i=0; i %3.2f Mbit/s\n\n", 8*(double)CLOCKS_PER_SEC*TEST_BYTES/((double)t1-t0)/(1024*1024));
-
- for (i=0; i>2];
- hashcode[i+1] = (MDbuf[i>>2] >> 8);
- hashcode[i+2] = (MDbuf[i>>2] >> 16);
- hashcode[i+3] = (MDbuf[i>>2] >> 24);
- }
- printf("\nhashcode: ");
- for (i=0; i0; i--)
- compress(MDbuf, X);
- MDfinish(MDbuf, NULL, 1000000UL, 0);
- for (i=0; i>2];
- hashcode[i+1] = (MDbuf[i>>2] >> 8);
- hashcode[i+2] = (MDbuf[i>>2] >> 16);
- hashcode[i+3] = (MDbuf[i>>2] >> 24);
- }
- printf("\n* message: 1 million times \"a\"\n hashcode: ");
- for (i=0; i
-#define A 0.5
-#define B 0.55
-
-_Sat long _Fract sat_add3 (_Sat long _Fract a, _Sat long _Fract b)
-{
- return a + b;
-}
-
-long _Fract mul3 (long _Fract a, long _Fract b)
-{
- return a * b;
-}
-
-int main()
-{
- printf("hello %X + %X = %X\n", (_Sat long _Fract)A, (_Sat long _Fract)B, sat_add3(A, B));
- printf("hello %X * %X = %X\n", (_Sat long _Fract)A, (_Sat long _Fract)B, mul3(A, B));
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/hpi.c b/lib/CPUs/MIPS/bsp/examples/hpi.c
deleted file mode 100644
index 3a21263..0000000
--- a/lib/CPUs/MIPS/bsp/examples/hpi.c
+++ /dev/null
@@ -1,949 +0,0 @@
-#include
-#include
-#include
-#include
-#include "libsys.h"
-#include "hpi.h"
-
-static volatile UINT32 _g_int_active;
-static volatile UINT32 _g_mbx_return;
-static volatile UINT32 _g_mbx_in_flag;
-
-// ---------------------------------------------------------
-// Globals
-// ---------------------------------------------------------
-typedef struct _susb_t
-{
- fp_t fptr_ept[USB_MAX_NUM_EPT];
- void *aptr_ept[USB_MAX_NUM_EPT];
-
- fp_t fptr_rst;
- void *aptr_rst;
-
- fp_t fptr_sof;
- void *aptr_sof;
-
- fp_t fptr_cfg;
- void *aptr_cfg;
-
- fp_t fptr_sus;
- void *aptr_sus;
-
- fp_t fptr_id;
- void *aptr_id;
-
- fp_t fptr_vbus;
- void *aptr_vbus;
-
-} usb_t;
-
-static usb_t _g_usb[USB_MAX_NUM_PORTS];
-//static usb_irp_t *_g_usb_irp_ptr[USB_MAX_NUM_PORTS][USB_MAX_NUM_EPT];
-
-// ---------------------------------------------------------
-// HPI ISR
-// ---------------------------------------------------------
-void cy67k3_isr(void)
-{
- INT32 i;
- UINT16 sie_msg, hpi_status;
- UINT32 port, siemsg_handled, int_handled;
- _g_int_active = 1;
-// sputs("--------------------------------------------------------\n");
-// sputs("USB-Interrupt(4)\n");
-// sputs("HPI Status : ");
- hpi_status = cy67k3_read_HPI_STATUS();
-// print_word(hpi_status);
-// sputs("\n");
-
-// sputs("MAILBOX (REG): ");
-
-// cy67k3_write(HPI_ADDRESS, HPI_REG_MAILBOX);
-// print_word(cy67k3_read_HPI_DATA());
-// sputs("\n");
-
- int_handled = 0;
- if (hpi_status & HPI_STATUS_MBX_IN)
- {
- int_handled = 1;
-// sputs("MAILBOX (HPI): ");
- _g_mbx_return = cy67k3_read_HPI_MAILBOX();
- _g_mbx_in_flag = 1;
-// print_word(_g_mbx_return);
-// sputs("\n");
- }
-
- if (hpi_status & HPI_STATUS_RESET1)
- {
- int_handled = 1;
- hpi_read_reg(SUSB1_REG_STATUS);
- hpi_comm_exec_int(SUSB_INIT_INT, 2, R1, 0, R2, 1);
-// sputs("RESET 1\n");
- }
-
- if (hpi_status & HPI_STATUS_RESET2)
- {
- int_handled = 1;
- hpi_read_reg(SUSB2_REG_STATUS);
- hpi_comm_exec_int(SUSB_INIT_INT, 2, R1, 0, R2, 2);
-// sputs("RESET 2\n");
- }
-
- if (hpi_status & HPI_STATUS_DONE1)
- {
- int_handled = 1;
-// sputs("DONE 1\n");
- }
-
- if (hpi_status & HPI_STATUS_DONE2)
- {
- int_handled = 1;
-// sputs("DONE 2\n");
- }
-
- if (hpi_status & HPI_STATUS_SOFEOP1)
- {
- int_handled = 1;
- hpi_read_reg(SUSB1_REG_STATUS);
-// sputs("SOF/EOP 1\n");
- }
-
- if (hpi_status & HPI_STATUS_SOFEOP2)
- {
- int_handled = 1;
- hpi_read_reg(SUSB2_REG_STATUS);
-// sputs("SOF/EOP 2\n");
- }
-
- port = 0;
- siemsg_handled = 0;
- if (hpi_status & HPI_STATUS_SIEMSG1)
- {
- int_handled = 1;
- sie_msg = hpi_read_reg(HPI_REG_SIE1MSG);
-
- // Reset message register
- hpi_write_reg(HPI_REG_SIE1MSG, 0x0000);
-
- if (sie_msg & SUSB_RST_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_rst)
- (_g_usb[port].fptr_rst)(_g_usb[port].aptr_rst);
- }
-
- if (sie_msg & SUSB_SOF_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_sof)
- (_g_usb[port].fptr_sof)(_g_usb[port].aptr_sof);
- }
-
- if (sie_msg & SUSB_CFG_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_cfg)
- (_g_usb[port].fptr_cfg)(_g_usb[port].aptr_cfg);
- }
-
- if (sie_msg & SUSB_SUS_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_sus)
- (_g_usb[port].fptr_sus)(_g_usb[port].aptr_sus);
- }
-
- if (sie_msg & SUSB_ID_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_id)
- (_g_usb[port].fptr_id)(_g_usb[port].aptr_id);
- }
-
- if (sie_msg & SUSB_VBUS_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_vbus)
- (_g_usb[port].fptr_vbus)(_g_usb[port].aptr_vbus);
- }
-
- for (i=0; i < 8; i++)
- {
- if (sie_msg & (SUSB_EP0_MSG << i))
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_ept[i])
- (_g_usb[port].fptr_ept[i])(_g_usb[port].aptr_ept[i]);
- }
- }
- if (!siemsg_handled)
- {
- sputs("Unhandled SIE1 message ");
- print_word(sie_msg);
- sputs("!\n");
- }
-
- }
- port = 1;
- siemsg_handled = 0;
- if (hpi_status & HPI_STATUS_SIEMSG2)
- {
- int_handled = 1;
- sie_msg = hpi_read_reg(HPI_REG_SIE2MSG);
-
- // Reset message register
- hpi_write_reg(HPI_REG_SIE2MSG, 0x0000);
-
- if (sie_msg & SUSB_RST_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_rst)
- (_g_usb[port].fptr_rst)(_g_usb[port].aptr_rst);
- }
-
- if (sie_msg & SUSB_SOF_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_sof)
- (_g_usb[port].fptr_sof)(_g_usb[port].aptr_sof);
- }
-
- if (sie_msg & SUSB_CFG_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_cfg)
- (_g_usb[port].fptr_cfg)(_g_usb[port].aptr_cfg);
- }
-
- if (sie_msg & SUSB_SUS_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_sus)
- (_g_usb[port].fptr_sus)(_g_usb[port].aptr_sus);
- }
-
- if (sie_msg & SUSB_ID_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_id)
- (_g_usb[port].fptr_id)(_g_usb[port].aptr_id);
- }
-
- if (sie_msg & SUSB_VBUS_MSG)
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_vbus)
- (_g_usb[port].fptr_vbus)(_g_usb[port].aptr_vbus);
- }
-
- for (i=0; i < 8; i++)
- {
- if (sie_msg & (SUSB_EP0_MSG << i))
- {
- siemsg_handled = 1;
- if (_g_usb[port].fptr_ept[i])
- (_g_usb[port].fptr_ept[i])(_g_usb[port].aptr_ept[i]);
- }
- }
- if (!siemsg_handled)
- {
- sputs("Unhandled SIE2 message ");
- print_word(sie_msg);
- sputs("!\n");
- }
-
- }
- if (!int_handled)
- {
- sputs("Unhandled interrupt (status = ");
- print_word(hpi_status);
- sputs(")!\n");
- }
-
-// sputs("--------------------------------------------------------\n");
- _g_int_active = 0;
-}
-
-// ---------------------------------------------------------
-// CY7C67300 low-level routines
-// ---------------------------------------------------------
-void cy67k3_reset(void)
-{
- int i;
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_CTRL;
-
- *pHpi = 3;
- for (i=0; i <160; i++)
- {
- __asm __volatile
- (
- ".set noreorder\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- ".set reorder\n"
- );
- }
-
- *pHpi = 2;
-
-}
-
-UINT16 cy67k3_read_HPI_DATA(void)
-{
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_DATA;
-
- return (UINT16)*pHpi;
-}
-
-UINT16 cy67k3_read_HPI_MAILBOX(void)
-{
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_MBX;
-
- return (UINT16)*pHpi;
-}
-
-UINT16 cy67k3_read_HPI_ADDRESS(void)
-{
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_ADDR;
-
- return (UINT16)*pHpi;
-}
-
-UINT16 cy67k3_read_HPI_STATUS(void)
-{
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_STATUS;
-
- return (UINT16)*pHpi;
-}
-
-void cy67k3_write_HPI_DATA(UINT16 data)
-{
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_DATA;
-
- *pHpi = (UINT32)data;
-}
-
-void cy67k3_write_HPI_MAILBOX(UINT16 data)
-{
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_MBX;
-
- *pHpi = (UINT32)data;
-}
-
-void cy67k3_write_HPI_ADDRESS(UINT16 data)
-{
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_ADDR;
-
- *pHpi = (UINT32)data;
-}
-
-void cy67k3_write_HPI_STATUS(UINT16 data)
-{
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_STATUS;
-
- *pHpi = (UINT32)data;
-}
-
-// ---------------------------------------------------------
-// HPI API
-// ---------------------------------------------------------
-UINT32 hpi_init(void)
-{
- volatile UINT32 *pHpi = (UINT32*)SYS_USB_CTRL;
- int i;
- UINT16 reg;
-
- // ToDo: Enable HPI interrupt
- _g_int_active = 0;
-
- hpi_write_reg(HPI_REG_SIE1MSG, 0x0000);
- hpi_write_reg(HPI_REG_SIE2MSG, 0x0000);
- hpi_write_reg(SUSB1_REG_STATUS, 0xFFFF);
- hpi_write_reg(SUSB2_REG_STATUS, 0xFFFF);
-
- // Init 1
- for(i=0; i < USB_MAX_NUM_EPT; i++)
- {
- hpi_write_reg(SUSB1_REG_EP_ADDR0 + 16*i, 0);
- hpi_write_reg(SUSB1_REG_EP_CNTRES0 + 16*i, 0);
- hpi_write_reg(SUSB1_REG_EP_COUNT0 + 16*i, 0);
- hpi_write_reg(SUSB1_REG_EP_CTRL0 + 16*i, 0);
- hpi_write_reg(SUSB1_REG_EP_STATUS0 + 16*i, 0);
- }
- // Init 2
- for(i=0; i < USB_MAX_NUM_EPT; i++)
- {
- hpi_write_reg(SUSB2_REG_EP_ADDR0 + 16*i, 0);
- hpi_write_reg(SUSB2_REG_EP_CNTRES0 + 16*i, 0);
- hpi_write_reg(SUSB2_REG_EP_COUNT0 + 16*i, 0);
- hpi_write_reg(SUSB2_REG_EP_CTRL0 + 16*i, 0);
- hpi_write_reg(SUSB2_REG_EP_STATUS0 + 16*i, 0);
- }
-
- hpi_write_reg(HPI_REG_INTROUTE, 0x0000);
- reg = hpi_read_reg(HPI_REG_INTROUTE);
-// hpi_write_reg(HPI_REG_INTROUTE, reg | 0x0202); // Route reset {1,2} to HPI only
-// hpi_write_reg(HPI_REG_INTROUTE, reg | 0x2800); // Route SOF/EOP {1,2} to HPI only
-// hpi_write_reg(HPI_REG_INTROUTE, reg | 0x1400); // Route SOF/EOP {1,2} to CY16 only
- hpi_write_reg(HPI_REG_INTROUTE, reg | 0x3C00); // Route SOF/EOP {1,2} to HPI and CY16
-
-
- interrupt_register(4, cy67k3_isr);
- interrupt_enable(4);
- *pHpi = 0x02;
-
- return HPI_NOERROR;
-}
-
-void hpi_mbx_write(UINT16 msgcode)
-{
- _g_mbx_in_flag = 0;
- cy67k3_write_HPI_MAILBOX(msgcode);
-}
-
-UINT32 hpi_mbx_read(void)
-{
- UINT32 err;
- UINT16 cy_return;
-
- if (_g_int_active)
- {
- while (!(cy67k3_read_HPI_STATUS() & HPI_STATUS_MBX_IN));
- cy_return = cy67k3_read_HPI_MAILBOX();
- }
- else
- {
- while(!_g_mbx_in_flag);
- cy_return = _g_mbx_return;
- }
-
- switch (cy_return)
- {
- case COMM_ACK:
- err = cy_return;
- break;
-
- case COMM_NAK:
- case COMM_ASYNC:
- err = HPI_ERR_PREFIX_MBX | cy_return;
- break;
-
- default:
- err = HPI_ERR_PREFIX_MBX | cy_return;
- break;
- }
- return err;
-}
-
-UINT32 hpi_check_addr(UINT16 addr)
-{
- if ((addr >= 0x0000) && (addr < 0x4000))
- return 0;
-
- if ((addr >= 0xC080) && (addr < 0xC0BC))
- return 0;
-
- if (addr >= 0xE000)
- return 0;
-
- sputs("Invalid address for HPI direct access! Use LCP-command instead!\n");
- return HPI_ERR_INVPARAM;
-}
-
-UINT32 hpi_read_reg(UINT16 addr)
-{
- UINT32 result;
-
- result = hpi_check_addr(addr);
- if (IS_ERROR(result))
- return result;
-
- cy67k3_write_HPI_ADDRESS(addr);
- return cy67k3_read_HPI_DATA();
-}
-
-UINT32 hpi_write_reg(UINT16 addr, UINT16 data)
-{
- UINT32 result;
-
- result = hpi_check_addr(addr);
- if (IS_ERROR(result))
- return result;
-
- cy67k3_write_HPI_ADDRESS(addr);
- cy67k3_write_HPI_DATA(data);
-}
-
-UINT32 hpi_write_ram(UINT16 addr, UINT16 *pData, UINT32 len)
-{
- int i, num_words;
-
- if (addr > 0x3FFE)
- return HPI_ERR_INVPARAM;
-
- if (addr & 1) // Not 16bit aligned?
- return HPI_ERR_INVPARAM;
-
- cy67k3_write_HPI_ADDRESS(addr);
-
- num_words = len/2;
- if (len % 2)
- num_words++;
-
- for (i=0; i < num_words; i++)
- cy67k3_write_HPI_DATA(pData[i]);
-
- return len;
-}
-
-UINT32 hpi_read_ram(UINT16 addr, UINT16 *pData, UINT32 len)
-{
- int i, num_words;
-
- if (addr > 0x3FFE)
- return HPI_ERR_INVPARAM;
-
- if (addr & 1) // Not 16bit aligned?
- return HPI_ERR_INVPARAM;
-
- cy67k3_write_HPI_ADDRESS(addr);
-
- num_words = len/2;
- if (len % 2)
- num_words++;
-
- for (i=0; i < num_words; i++)
- pData[i] = cy67k3_read_HPI_DATA();
-
- return len;
-}
-
-UINT32 hpi_comm_reset(void)
-{
- hpi_mbx_write(COMM_RESET);
-
- return hpi_mbx_read();
-}
-
-UINT32 hpi_comm_jump2code(UINT16 addr)
-{
- cy67k3_write_HPI_ADDRESS(addr);
- hpi_mbx_write(COMM_JUMP2CODE);
-
- return hpi_mbx_read();
-}
-
-UINT32 hpi_comm_callcode(UINT16 addr)
-{
- hpi_write_reg(COMM_CODE_ADDR, addr);
-
- hpi_mbx_write(COMM_CALL_CODE);
-
- return hpi_mbx_read();
-}
-
-UINT32 hpi_comm_write_ctrl_reg(UINT16 addr, UINT16 data, UINT16 logic)
-{
-
- hpi_write_reg(COMM_CTRL_REG_ADDR, addr);
- hpi_write_reg(COMM_CTRL_REG_DATA, data);
- hpi_write_reg(COMM_CTRL_REG_LOGIC, logic);
-
- hpi_mbx_write(COMM_WRITE_CTRL_REG);
-
- return hpi_mbx_read();
-}
-
-UINT32 hpi_comm_read_ctrl_reg(UINT16 addr)
-{
- UINT32 result;
-
- hpi_write_reg(COMM_CTRL_REG_ADDR, addr);
-
- hpi_mbx_write(COMM_READ_CTRL_REG);
-
- result = hpi_mbx_read();
- if (IS_ERROR(result))
- return result;
-
- cy67k3_write_HPI_ADDRESS(COMM_CTRL_REG_DATA);
- return (UINT32)cy67k3_read_HPI_DATA();
-
-}
-
-UINT32 hpi_comm_write_xmem(UINT16 addr, UINT8 *pData, UINT16 len)
-{
- return HPI_ERR_NOTIMPL;
-
-}
-
-UINT32 hpi_comm_read_xmem(UINT16 addr, UINT8 *pData, UINT16 len)
-{
- return HPI_ERR_NOTIMPL;
-
-}
-
-typedef struct _sreg_param_t
-{
- UINT32 id;
- UINT16 val;
-
-} reg_param_t;
-
-UINT32 hpi_comm_exec_int(UINT16 intnum, UINT32 nargs, ...)
-{
- int i;
- UINT32 result;
- va_list args;
- reg_param_t reg_param[MAX_NUM_REGS];
-
- va_start(args, nargs);
-
- if (nargs > MAX_NUM_REGS)
- {
- fprintf(stderr, "hpi_comm_exec_int(): Number (%d), of arguments exceeds %d!\n", nargs, MAX_NUM_REGS);
- return HPI_ERR_INVPARAM;
- }
-
- for (i=0; i < nargs; i++)
- {
- reg_param[i].id = va_arg(args, UINT32);
- if (reg_param[i].id > MAX_NUM_REGS)
- {
- fprintf(stderr, "hpi_comm_exec_int(): Invalid register R%d!\n", reg_param[i].id);
- return HPI_ERR_INVPARAM;
- }
-
- reg_param[i].val = (UINT16)va_arg(args, UINT32);
- }
- va_end(args);
-
- hpi_write_reg(COMM_INT_NUM, intnum);
-
- for (i=0; i < nargs; i++)
- {
- hpi_write_reg(COMM_R0 + 2*reg_param[i].id, reg_param[i].val);
- }
-
- hpi_mbx_write(COMM_EXEC_INT);
-
- result = hpi_mbx_read();
- if (IS_ERROR(result))
- return result;
-
- return (UINT32)hpi_read_reg(COMM_R0);
-}
-
-UINT32 usb_init(void)
-{
- INT32 i;
-
- for (i=0; i < USB_MAX_NUM_PORTS; i++)
- {
- memset(&_g_usb[i], 0, sizeof(usb_t));
- }
- return 0;
-}
-
-UINT32 usb_callback_register(UINT32 port, UINT32 type, fp_t pFunc, void *pArg)
-{
- UINT32 result;
- if (port >= USB_MAX_NUM_PORTS)
- return -1;
-
- result = 0;
- switch (type)
- {
- case SUSB_EP0_MSG:
- _g_usb[port].fptr_ept[0] = pFunc;
- _g_usb[port].aptr_ept[0] = pArg;
- break;
-
- case SUSB_EP1_MSG:
- _g_usb[port].fptr_ept[1] = pFunc;
- _g_usb[port].aptr_ept[1] = pArg;
- break;
-
- case SUSB_EP2_MSG:
- _g_usb[port].fptr_ept[2] = pFunc;
- _g_usb[port].aptr_ept[2] = pArg;
- break;
-
- case SUSB_EP3_MSG:
- _g_usb[port].fptr_ept[3] = pFunc;
- _g_usb[port].aptr_ept[3] = pArg;
- break;
-
- case SUSB_EP4_MSG:
- _g_usb[port].fptr_ept[4] = pFunc;
- _g_usb[port].aptr_ept[4] = pArg;
- break;
-
- case SUSB_EP5_MSG:
- _g_usb[port].fptr_ept[5] = pFunc;
- _g_usb[port].aptr_ept[5] = pArg;
- break;
-
- case SUSB_EP6_MSG:
- _g_usb[port].fptr_ept[6] = pFunc;
- _g_usb[port].aptr_ept[6] = pArg;
- break;
-
- case SUSB_EP7_MSG:
- _g_usb[port].fptr_ept[7] = pFunc;
- _g_usb[port].aptr_ept[7] = pArg;
- break;
-
- case SUSB_RST_MSG:
- _g_usb[port].fptr_rst = pFunc;
- _g_usb[port].aptr_rst = pArg;
- break;
-
- case SUSB_SOF_MSG:
- _g_usb[port].fptr_sof = pFunc;
- _g_usb[port].aptr_sof = pArg;
- break;
-
- case SUSB_CFG_MSG:
- _g_usb[port].fptr_cfg = pFunc;
- _g_usb[port].aptr_cfg = pArg;
- break;
-
- case SUSB_SUS_MSG:
- _g_usb[port].fptr_sus = pFunc;
- _g_usb[port].aptr_sus = pArg;
- break;
-
- case SUSB_ID_MSG:
- _g_usb[port].fptr_id = pFunc;
- _g_usb[port].aptr_id = pArg;
- break;
-
- case SUSB_VBUS_MSG:
- _g_usb[port].fptr_vbus = pFunc;
- _g_usb[port].aptr_vbus = pArg;
- break;
-
- default:
- result = -1;
- break;
- }
-
- return result;
-}
-
-UINT32 usb_irp_register(usb_irp_t *pIRP, UINT32 port, UINT32 ept, UINT32 size, UINT32 is_out)
-{
-
- if (!pIRP)
- return -1;
-
- if (port >= USB_MAX_NUM_PORTS)
- return -1;
-
- if (ept >= USB_MAX_NUM_EPT)
- return -1;
-
- if (size >= USB_MAX_IMG_SIZE)
- return -1;
-
- memset(pIRP, 0, sizeof(usb_irp_t));
- pIRP->is_out = is_out;
- pIRP->is_in = !is_out;
- pIRP->tsize = size;
- pIRP->port = port;
- pIRP->ept = ept;
- pIRP->cy_irp_addr = USB_IRP_BASE + port*USB_MAX_NUM_EPT*sizeof(cy_req_t) + ept*sizeof(cy_req_t);
- pIRP->cy_req.next = 0;
- pIRP->cy_req.addr = USB_IMG_BASE + port*USB_MAX_NUM_EPT*USB_MAX_IMG_SIZE + ept*USB_MAX_IMG_SIZE;
- pIRP->cy_req.size = size;
- pIRP->cy_req.callback = 0;
- fifo_alloc(&pIRP->fifo, 8*USB_MAX_IMG_SIZE);
-
- return 0;
-}
-
-UINT32 usb_irp_enqueue(usb_irp_t *pIRP)
-{
- UINT32 result;
-
- if (!pIRP)
- {
-// sputs ("usb_irp_enqueue(): Invalid IRP!\n");
- return -1;
- }
-
-// printf("cy_addr: %4.4X, Next: %4.4X, Addr: %4.4X, Size: %4.4X, CB: %4.4X\n", pIRP->cy_irp_addr, pIRP->cy_req.next, pIRP->cy_req.addr, pIRP->cy_req.size, pIRP->cy_req.callback);
-
- if (pIRP->is_out)
- {
- hpi_write_ram(pIRP->cy_irp_addr, (UINT16*)&pIRP->cy_req, sizeof(cy_req_t));
- if (pIRP->port == 0)
- result = hpi_comm_exec_int(SUSB1_RECEIVE_INT, 2, R1, pIRP->ept, R8, pIRP->cy_irp_addr);
-
- if (pIRP->port == 1)
- result = hpi_comm_exec_int(SUSB2_RECEIVE_INT, 2, R1, pIRP->ept, R8, pIRP->cy_irp_addr);
- }
- if (pIRP->is_in)
- {
- pIRP->tx_in_progress = 1;
- hpi_write_ram(pIRP->cy_irp_addr, (UINT16*)&pIRP->cy_req, sizeof(cy_req_t));
- if (pIRP->port == 0)
- result = hpi_comm_exec_int(SUSB1_SEND_INT, 2, R1, pIRP->ept, R8, pIRP->cy_irp_addr);
-
- if (pIRP->port == 1)
- result = hpi_comm_exec_int(SUSB2_SEND_INT, 2, R1, pIRP->ept, R8, pIRP->cy_irp_addr);
- }
-
-// if (result)
-// printf ("usb_irp_enqueue(): Result = %8.8X\n", result);
-
- return result;
-
-}
-
-UINT32 fifo_alloc(fifo_t *pObj, UINT32 size)
-{
- pObj->pBuf = (UINT8*)malloc(size);
- if (!pObj->pBuf)
- {
-// printf ("fifo_alloc(): Error allocating memory!\n");
- return -1;
- }
-// printf ("fifo_alloc(): pBuf at %8.8X\n", (UINT32)pObj->pBuf);
- pObj->size = size;
- pObj->pPtr_wr = pObj->pBuf;
- pObj->pPtr_rd = pObj->pBuf;
-
- return 0;
-}
-
-UINT32 fifo_free(fifo_t *pObj)
-{
- if (pObj->pBuf)
- free(pObj->pBuf);
-
- return 0;
-}
-
-UINT32 fifo_flush(fifo_t *pObj)
-{
- pObj->pPtr_wr = pObj->pBuf;
- pObj->pPtr_rd = pObj->pBuf;
-
- return 0;
-}
-
-UINT32 fifo_is_empty(fifo_t *pObj)
-{
- return (pObj->pPtr_wr == pObj->pPtr_rd);
-}
-
-UINT32 fifo_is_full(fifo_t *pObj)
-{
- UINT8 *pNext, *pEnd;
-
- pEnd = pObj->pBuf + pObj->size;
- pNext = pObj->pPtr_wr + 1;
- if (pNext == pEnd)
- pNext = pObj->pBuf;
-
- return (pNext == pObj->pPtr_rd);
-}
-
-UINT32 fifo_read(fifo_t *pObj, UINT8 *pData, UINT32 size, UINT32 timeout, UINT32 do_block)
-{
- UINT32 i;
- UINT32 wait_4ever, timeout_cnt, cnt;
- UINT8 *pEnd;
-
- pEnd = pObj->pBuf + pObj->size;
- wait_4ever = (timeout == 0);
-
- cnt = 0;
- while(size)
- {
- timeout_cnt = timeout;
-
- while(fifo_is_empty(pObj))
- {
- if (!do_block)
- return cnt;
-
- if (!wait_4ever)
- {
- if (timeout_cnt)
- {
- timeout_cnt--;
- sleep(1);
- }
- else
- {
- return cnt;
- }
- }
- }
-
- if (pData)
- pData[cnt] = *(pObj->pPtr_rd);
-
- cnt++;
- pObj->pPtr_rd++;
- if (pObj->pPtr_rd == pEnd)
- pObj->pPtr_rd = pObj->pBuf;
-
- size--;
- }
-
- return cnt;
-}
-
-UINT32 fifo_write(fifo_t *pObj, UINT8 *pData, UINT32 size, UINT32 timeout, UINT32 do_block)
-{
- UINT32 wait_4ever, timeout_cnt, cnt;
- UINT8 *pEnd;
-
- pEnd = pObj->pBuf + pObj->size;
- wait_4ever = (timeout == 0);
-
- cnt = 0;
- while(size)
- {
- timeout_cnt = timeout;
-
- while(fifo_is_full(pObj))
- {
- if (!do_block)
- return cnt;
-
- if (!wait_4ever)
- {
- if (timeout_cnt)
- {
- timeout_cnt--;
- sleep(1);
- }
- else
- {
- return cnt;
- }
- }
- }
-
- if (pData)
- *(pObj->pPtr_wr) = pData[cnt];
-
- cnt++;
- pObj->pPtr_wr++;
- if (pObj->pPtr_wr == pEnd)
- pObj->pPtr_wr = pObj->pBuf;
-
- size--;
- }
-
- return cnt;
-}
-
-// ---------------------------------------------------------
diff --git a/lib/CPUs/MIPS/bsp/examples/hpi.h b/lib/CPUs/MIPS/bsp/examples/hpi.h
deleted file mode 100644
index 58edabe..0000000
--- a/lib/CPUs/MIPS/bsp/examples/hpi.h
+++ /dev/null
@@ -1,384 +0,0 @@
-#ifndef HPI_H
-#define HPI_H
-
-// ---------------------------------------------------------
-// API related
-// ---------------------------------------------------------
-//#define IS_ERROR(e) (0 != (e & HPI_ERROR))
-#define HPI_NOERROR 0
-#define HPI_ERROR 0x80000000
-#define HPI_ERR_NOTIMPL (HPI_ERROR + 1)
-#define HPI_ERR_INVPARAM (HPI_ERROR + 2)
-#define HPI_ERR_TIMEOUT (HPI_ERROR + 3)
-#define HPI_ERR_PREFIX_MBX (HPI_ERROR + 0x00010000)
-
-#define MAX_NUM_REGS 14
-#define R0 0
-#define R1 1
-#define R2 2
-#define R3 3
-#define R4 4
-#define R5 5
-#define R6 6
-#define R7 7
-#define R8 8
-#define R9 9
-#define R10 10
-#define R11 11
-#define R12 12
-#define R13 13
-
-#define USB_MAX_NUM_PORTS 2
-#define USB_MAX_NUM_EPT 8
-#define USB_MAX_IMG_SIZE 512
-#define USB_IRP_BASE 0x0F80
-#define USB_IMG_BASE 0x1000
-
-typedef void (*fp_t)(void*);
-
-// Receive buffer on EP
-typedef struct _scy_req_t
-{
- UINT16 next;
- UINT16 addr;
- UINT16 size;
- UINT16 callback;
-} cy_req_t;
-
-typedef struct _sfifo_t
-{
- UINT32 size;
- UINT8 *pBuf;
- UINT8 * volatile pPtr_wr, * volatile pPtr_rd;
-
-} fifo_t;
-
-typedef struct _susb_irp_t
-{
- UINT16 tsize;
- UINT32 is_in, is_out;
- UINT32 port, ept;
- UINT16 cy_irp_addr;
- fifo_t fifo;
- UINT32 tx_in_progress;
- cy_req_t cy_req;
-} usb_irp_t;
-
-// ---------------------------------------------------------
-// CY7C67300 related
-// ---------------------------------------------------------
-#define HPI_WAITACK 1
-#define HPI_NOWAIT 0
-
-// ---------------------------------------------------------
-// HPI status flags
-#define HPI_STATUS_MBX_IN 0x0001
-#define HPI_STATUS_RESET1 0x0002
-#define HPI_STATUS_DONE1 0x0004
-#define HPI_STATUS_DONE2 0x0008
-#define HPI_STATUS_SIEMSG1 0x0010
-#define HPI_STATUS_SIEMSG2 0x0020
-#define HPI_STATUS_RESUME1 0x0040
-#define HPI_STATUS_RESUME2 0x0080
-#define HPI_STATUS_MBX_OUT 0x0100
-#define HPI_STATUS_RESET2 0x0200
-#define HPI_STATUS_SOFEOP1 0x0400
-#define HPI_STATUS_SOFEOP2 0x1000
-#define HPI_STATUS_ID 0x4000
-#define HPI_STATUS_VBUS 0x8000
-
-// ---------------------------------------------------------
-// LCP command codes
-#define COMM_RESET 0xFA50
-#define COMM_JUMP2CODE 0xCE00
-#define COMM_EXEC_INT 0xCE01
-#define COMM_READ_CTRL_REG 0xCE02
-#define COMM_WRITE_CTRL_REG 0xCE03
-#define COMM_CALL_CODE 0xCE04
-#define COMM_READ_XMEM 0xCE05
-#define COMM_WRITE_XMEM 0xCE06
-#define C0MM_CONFIG 0xCE07
-#define COMM_READ_MEM 0xCE08
-#define COMM_WRITE_MEM 0xCE09
-// LCP response codes
-#define COMM_ACK 0x0FED
-#define COMM_NAK 0xDEAD
-#define COMM_ASYNC 0xF00D
-
-// ---------------------------------------------------------
-// LCP memory addresses
-#define COMM_PORT_CMD 0x01BA // For PORT Command
-#define COMM_MEM_ADDR 0x01BC // Address for COMM_RD/WR_MEM
-#define COMM_MEM_LEN 0x01BE // Address for COMM_RD/WR_MEM
-#define COMM_LAST_DATA 0x01C0 // memory pointer for xmem
-#define COMM_CTRL_REG_ADDR 0x01BC // Address for COMM_RD/WR_CTRL_REG
-#define COMM_CTRL_REG_DATA 0x01BE // Address for COMM_RD/WR_CTRL_REG
-#define COMM_CTRL_REG_LOGIC 0x01C0 // Address used for AND/OR
-#define REG_WRITE_FLG 0x0000 // Value for COMM_CTRL_REG_LOGIC
-#define REG_AND_FLG 0x0001 // Value for COMM_CTRL_REG_LOGIC
-#define REG_OR_FLG 0x0002 // Value for COMM_CTRL_REG_LOGIC
-#define COMM_TIMEOUT 0x01BE // Address setting Timeout for sending response to host
-#define COMM_CODE_ADDR 0x01BC // Address for COMM_CALL_CODE and COMM_JUMP2CODE
-#define COMM_INT_NUM 0x01C2 // Address used for COMM_EXEC_INT
-#define COMM_R0 0x01C4 // CY16-R0 register
-#define COMM_R1 0x01C6 // CY16-R1 register
-#define COMM_R2 0x01C8 // CY16-R2 register
-#define COMM_R3 0x01CA // CY16-R3 register
-#define COMM_R4 0x01CC // CY16-R4 register
-#define COMM_R5 0x01CE // CY16-R5 register
-#define COMM_R6 0x01D0 // CY16-R6 register
-#define COMM_R7 0x01D2 // CY16-R7 register
-#define COMM_R8 0x01D4 // CY16-R8 register
-#define COMM_R9 0x01D6 // CY16-R9 register
-#define COMM_R10 0x01D8 // CY16-R10 register
-#define COMM_R11 0x01DA // CY16-R11 register
-#define COMM_R12 0x01DC // CY16-R12 register
-#define COMM_R13 0x01DE // CY16-R13 register
-
-// for COMM_CTRL_REG_LOGIC
-#define LOGIC_DIRECT 0
-#define LOGIC_AND 1
-#define LOGIC_OR 2
-
-// ---------------------------------------------------------
-// Software interrupts
-#define SUSB_INIT_INT 113
-// USB 1
-#define SUSB1_DEVICE_DESCRIPTOR_VEC 90
-#define SUSB1_CONFIGURATION_DESCRIPTOR_VEC 91
-#define SUSB1_STRING_DESCRIPTOR_VEC 92
-#define SUSB1_FINISH_INT 89
-#define SUSB1_STALL_INT 82
-#define SUSB1_STANDARD_INT 83
-#define SUSB1_SEND_INT 80
-#define SUSB1_RECEIVE_INT 81
-#define SUSB1_VENDOR_INT 85
-#define SUSB1_CLASS_INT 87
-#define SUSB1_LOADER_INT 94
-#define SUSB1_DELTA_CONFIG_INT 95
-
-// USB 2
-#define SUSB2_DEVICE_DESCRIPTOR_VEC 106
-#define SUSB2_CONFIGURATION_DESCRIPTOR_VEC 107
-#define SUSB2_STRING_DESCRIPTOR_VEC 108
-#define SUSB2_FINISH_INT 105
-#define SUSB2_STALL_INT 98
-#define SUSB2_STANDARD_INT 99
-#define SUSB2_SEND_INT 96
-#define SUSB2_RECEIVE_INT 97
-#define SUSB2_VENDOR_INT 101
-#define SUSB2_CLASS_INT 103
-#define SUSB2_LOADER_INT 110
-#define SUSB2_DELTA_CONFIG_INT 111
-
-// ---------------------------------------------------------
-// General USB Registers
-#define USB_REG_FLAGS 0xC000 // CPU Flags
-#define USB_REG_BANK 0xC002 // Register Bank
-#define USB_REG_REVISON 0xC004 // Hardware Revision
-#define USB_REG_SPEED 0xC008 // CPU Speed
-#define USB_REG_PWRCTRL 0xC00A // Power Control
-#define USB_REG_INTEN 0xC00E // Interrupt Enable
-#define USB_REG_BP 0xC014 // Breakpoint
-#define USB_REG_USBDIAG 0xC03C // USB Diagnostic
-#define USB_REG_MEMDIAG 0xC03E // Memory Diagnostic
-
-// HPI registers
-#define HPI_REG_BP 0x0140 // HPI Breakpoint
-#define HPI_REG_INTROUTE 0x0142 // Interrupt Routing
-#define HPI_REG_SIE1MSG 0x0144 // SIE1msg
-#define HPI_REG_SIE2MSG 0x0148 // SIE2msg
-#define HPI_REG_MAILBOX 0xC0C6 // HPI Mailbox
-
-// ---------------------------------------------------------
-// General Device Registers
-// Device 1
-#define SUSB1_REG_PORTSEL 0xC084 // Port select
-#define SUSB1_REG_USBCTRL 0xC08A // USB control
-#define SUSB1_REG_INTEN 0xC08C // Interrupt enable
-#define SUSB1_REG_ADDR 0xC08E // Address
-#define SUSB1_REG_STATUS 0xC090 // Status
-#define SUSB1_REG_FRAMENUM 0xC092 // Frame number
-#define SUSB1_REG_SOFEOPCNT 0xC094 // SOF/EOP count
-
-// Device 2
-#define SUSB2_REG_PORTSEL 0xC0A4 // Port select
-#define SUSB2_REG_USBCTRL 0xC0AA // USB control
-#define SUSB2_REG_INTEN 0xC0AC // Interrupt enable
-#define SUSB2_REG_ADDR 0xC0AE // Address
-#define SUSB2_REG_STATUS 0xC0B0 // Status
-#define SUSB2_REG_FRAMENUM 0xC0B2 // Frame number
-#define SUSB2_REG_SOFEOPCNT 0xC0B4 // SOF/EOP count
-
-// ---------------------------------------------------------
-// Endpoint Registers
-// Device 1 Control
-#define SUSB1_REG_EP_CTRL0 0x0200
-#define SUSB1_REG_EP_CTRL1 0x0210
-#define SUSB1_REG_EP_CTRL2 0x0220
-#define SUSB1_REG_EP_CTRL3 0x0230
-#define SUSB1_REG_EP_CTRL4 0x0240
-#define SUSB1_REG_EP_CTRL5 0x0250
-#define SUSB1_REG_EP_CTRL6 0x0260
-#define SUSB1_REG_EP_CTRL7 0x0270
-// Device 1 Address
-#define SUSB1_REG_EP_ADDR0 0x0202
-#define SUSB1_REG_EP_ADDR1 0x0212
-#define SUSB1_REG_EP_ADDR2 0x0222
-#define SUSB1_REG_EP_ADDR3 0x0232
-#define SUSB1_REG_EP_ADDR4 0x0242
-#define SUSB1_REG_EP_ADDR5 0x0252
-#define SUSB1_REG_EP_ADDR6 0x0262
-#define SUSB1_REG_EP_ADDR7 0x0272
-// Device 1 Count
-#define SUSB1_REG_EP_COUNT0 0x0204
-#define SUSB1_REG_EP_COUNT1 0x0214
-#define SUSB1_REG_EP_COUNT2 0x0224
-#define SUSB1_REG_EP_COUNT3 0x0234
-#define SUSB1_REG_EP_COUNT4 0x0244
-#define SUSB1_REG_EP_COUNT5 0x0254
-#define SUSB1_REG_EP_COUNT6 0x0264
-#define SUSB1_REG_EP_COUNT7 0x0274
-// Device 1 Status
-#define SUSB1_REG_EP_STATUS0 0x0206
-#define SUSB1_REG_EP_STATUS1 0x0216
-#define SUSB1_REG_EP_STATUS2 0x0226
-#define SUSB1_REG_EP_STATUS3 0x0236
-#define SUSB1_REG_EP_STATUS4 0x0246
-#define SUSB1_REG_EP_STATUS5 0x0256
-#define SUSB1_REG_EP_STATUS6 0x0266
-#define SUSB1_REG_EP_STATUS7 0x0276
-// Device 1 Count result
-#define SUSB1_REG_EP_CNTRES0 0x0208
-#define SUSB1_REG_EP_CNTRES1 0x0218
-#define SUSB1_REG_EP_CNTRES2 0x0228
-#define SUSB1_REG_EP_CNTRES3 0x0238
-#define SUSB1_REG_EP_CNTRES4 0x0248
-#define SUSB1_REG_EP_CNTRES5 0x0258
-#define SUSB1_REG_EP_CNTRES6 0x0268
-#define SUSB1_REG_EP_CNTRES7 0x0278
-
-// Device 2 Control
-#define SUSB2_REG_EP_CTRL0 0x0280
-#define SUSB2_REG_EP_CTRL1 0x0290
-#define SUSB2_REG_EP_CTRL2 0x02A0
-#define SUSB2_REG_EP_CTRL3 0x02B0
-#define SUSB2_REG_EP_CTRL4 0x02C0
-#define SUSB2_REG_EP_CTRL5 0x02D0
-#define SUSB2_REG_EP_CTRL6 0x02E0
-#define SUSB2_REG_EP_CTRL7 0x02F0
-// Device 2 Address
-#define SUSB2_REG_EP_ADDR0 0x0282
-#define SUSB2_REG_EP_ADDR1 0x0292
-#define SUSB2_REG_EP_ADDR2 0x02A2
-#define SUSB2_REG_EP_ADDR3 0x02B2
-#define SUSB2_REG_EP_ADDR4 0x02C2
-#define SUSB2_REG_EP_ADDR5 0x02D2
-#define SUSB2_REG_EP_ADDR6 0x02E2
-#define SUSB2_REG_EP_ADDR7 0x02F2
-// Device 2 Count
-#define SUSB2_REG_EP_COUNT0 0x0284
-#define SUSB2_REG_EP_COUNT1 0x0294
-#define SUSB2_REG_EP_COUNT2 0x02A4
-#define SUSB2_REG_EP_COUNT3 0x02B4
-#define SUSB2_REG_EP_COUNT4 0x02C4
-#define SUSB2_REG_EP_COUNT5 0x02D4
-#define SUSB2_REG_EP_COUNT6 0x02E4
-#define SUSB2_REG_EP_COUNT7 0x02F4
-// Device 2 Status
-#define SUSB2_REG_EP_STATUS0 0x0286
-#define SUSB2_REG_EP_STATUS1 0x0296
-#define SUSB2_REG_EP_STATUS2 0x02A6
-#define SUSB2_REG_EP_STATUS3 0x02B6
-#define SUSB2_REG_EP_STATUS4 0x02C6
-#define SUSB2_REG_EP_STATUS5 0x02D6
-#define SUSB2_REG_EP_STATUS6 0x02E6
-#define SUSB2_REG_EP_STATUS7 0x02F6
-// Device 2 Count result
-#define SUSB2_REG_EP_CNTRES0 0x0288
-#define SUSB2_REG_EP_CNTRES1 0x0298
-#define SUSB2_REG_EP_CNTRES2 0x02A8
-#define SUSB2_REG_EP_CNTRES3 0x02B8
-#define SUSB2_REG_EP_CNTRES4 0x02C8
-#define SUSB2_REG_EP_CNTRES5 0x02D8
-#define SUSB2_REG_EP_CNTRES6 0x02E8
-#define SUSB2_REG_EP_CNTRES7 0x02F8
-
-// ---------------------------------------------------------
-// others
-#define HUSB_TDLISTDONE 0x1000
-#define HUSB_SOF 0x2000
-#define HUSB_ARMV 0x0001
-#define HUSB_AINS_FS 0x0002
-#define HUSB_AINS_LS 0x0004
-#define HUSB_AWAKEUP 0x0008
-#define HUSB_BRMV 0x0010
-#define HUSB_BINS_FS 0x0020
-#define HUSB_BINS_LS 0x0040
-#define HUSB_BWAKEUP 0x0080
-
-#define SUSB_EP0_MSG 0x0001
-#define SUSB_EP1_MSG 0x0002
-#define SUSB_EP2_MSG 0x0004
-#define SUSB_EP3_MSG 0x0008
-#define SUSB_EP4_MSG 0x0010
-#define SUSB_EP5_MSG 0x0020
-#define SUSB_EP6_MSG 0x0040
-#define SUSB_EP7_MSG 0x0080
-#define SUSB_RST_MSG 0x0100
-#define SUSB_SOF_MSG 0x0200
-#define SUSB_CFG_MSG 0x0400
-#define SUSB_SUS_MSG 0x0800
-#define SUSB_ID_MSG 0x4000
-#define SUSB_VBUS_MSG 0x8000
-
-// ---------------------------------------------------------
-// Functions
-// ---------------------------------------------------------
-
-// HPI low-level routines
-void cy67k3_isr(void);
-void cy67k3_reset(void);
-UINT16 cy67k3_read_HPI_DATA(void);
-UINT16 cy67k3_read_HPI_MAILBOX(void);
-UINT16 cy67k3_read_HPI_ADDRESS(void);
-UINT16 cy67k3_read_HPI_STATUS(void);
-void cy67k3_write_HPI_DATA(UINT16 data);
-void cy67k3_write_HPI_MAILBOX(UINT16 data);
-void cy67k3_write_HPI_ADDRESS(UINT16 data);
-void cy67k3_write_HPI_STATUS(UINT16 data);
-
-// HPI API
-UINT32 hpi_init(void);
-void hpi_mbx_write(UINT16 msgcode);
-UINT32 hpi_mbx_read(void);
-UINT32 hpi_read_reg(UINT16 addr);
-UINT32 hpi_write_reg(UINT16 addr, UINT16 data);
-UINT32 hpi_write_ram(UINT16 addr, UINT16 *pData, UINT32 num_words);
-UINT32 hpi_read_ram(UINT16 addr, UINT16 *pData, UINT32 num_words);
-UINT32 hpi_comm_reset(void);
-UINT32 hpi_comm_jump2code(UINT16 addr);
-UINT32 hpi_comm_callcode(UINT16 addr);
-UINT32 hpi_comm_write_ctrl_reg(UINT16 addr, UINT16 data, UINT16 logic);
-UINT32 hpi_comm_read_ctrl_reg(UINT16 addr);
-UINT32 hpi_comm_write_xmem(UINT16 addr, UINT8 *pData, UINT16 len);
-UINT32 hpi_comm_read_xmem(UINT16 addr, UINT8 *pData, UINT16 len);
-UINT32 hpi_comm_exec_int(UINT16 intnum, UINT32 nargs, ...);
-
-// USB API
-UINT32 usb_init(void);
-UINT32 usb_irp_register(usb_irp_t *pIRP, UINT32 port, UINT32 ept, UINT32 size, UINT32 is_out);
-UINT32 usb_irp_enqueue(usb_irp_t *pIRP);
-UINT32 usb_callback_register(UINT32 port, UINT32 type, fp_t pFunc, void *pArg);
-
-#define FIFO_BLOCK 1
-#define FIFO_NONBLOCK 0
-UINT32 fifo_alloc(fifo_t *pObj, UINT32 size);
-UINT32 fifo_free(fifo_t *pObj);
-UINT32 fifo_flush(fifo_t *pObj);
-UINT32 fifo_is_full(fifo_t *pObj);
-UINT32 fifo_is_empty(fifo_t *pObj);
-UINT32 fifo_read(fifo_t *pObj, UINT8 *pData, UINT32 size, UINT32 timeout, UINT32 do_block);
-UINT32 fifo_write(fifo_t *pObj, UINT8 *pData, UINT32 size, UINT32 timeout, UINT32 do_block);
-
-#endif // HPI_H
diff --git a/lib/CPUs/MIPS/bsp/examples/inflate.c b/lib/CPUs/MIPS/bsp/examples/inflate.c
deleted file mode 100644
index b50581d..0000000
--- a/lib/CPUs/MIPS/bsp/examples/inflate.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/* inflate routines for Palm OS (to inflate a deflated stream)
- *
- * Based heavily upon gunzip.c by Pasi Ojala
- * http://www.cs.tut.fi/~albert/Dev/gunzip/
- * Many, many thanks for that code!
- *
- * Changes:
- * 2002-12-30 - Added #defines to use zlib's struct instead of mine, just
- * in case you want to compile it that way.
- * 2002-12-29 - Found out that this is VERY slow. ZLib is 3x faster.
- * Worked on speeding it up. Partially successful. Profiled
- * code and marked critical areas. 1932 bytes added to a
- * Palm program by linking in the .o file. Schweet!
- * 2002-12-21 - Finished surgery. Only one function to inflate dynamic and
- * fixed data. Rewrote table generation to be iterative.
- * Hacked and slashed my way through unnecessary code.
- * The size is now down to 3512 bytes.
- * 2002-12-20 - Started major surgery
- * 2002-12-19 - Looked at the code a bit more
- * 2002-12-17 - Continued work. Down to about 6k for the .o file
- * 2002-12-09 - Continued work, added z_stream_fid instead of globals
- * 2002-12-08 - Started work so that it decompresses up to 64k (one memory
- * chunk on the Palm.
- * 2002-12-07 - Removed bit reverse table. Removed unzip code.
- */
-#include "libsys.h"
-#include "inflate.h"
-#ifdef VERBOSE
-#include // Just in case you put a printf() function back in
-#endif
-
-void Status(char *, int);
-
-typedef struct HufNode_struct {
- // b0 and b1 are either values in the tree array to jump to (branches)
- // or are literal values.
- // if (bX & 0x8000)
- // value = bX ^ 0x8000;
- // else
- // link_to_array_element = bX;
- unsigned int b0; // Bigger than 1 byte (2 is ideal)
- unsigned int b1; // Bigger than 1 byte (2 is ideal)
-} HufNode;
-
-
-// Not that rhobust anymore -- If out of data, this will
-// return a whole lot of 1 bits.
-//
-// This function consumes a large percentage of time (#1)
-char READBIT(z_stream *zs)
-{
- char carry;
-
- if (zs->reserved == 1)
- {
- if (zs->avail_in == 0)
- return 1;
- zs->reserved = *(zs->next_in ++) | 0x0100;
- zs->avail_in --;
- }
-
- carry = zs->reserved & 1;
- zs->reserved >>= 1;
-
- return carry;
-}
-
-
-// Make sure that [a] is <= 16
-// If there are endian problems, force [a] to be <= 8
-// Might be faster if all (up to [a] bits) of zs->reserved was read into res
-// right away.
-//
-// This function consumes a large percentage of time (#4)
-int READBITS(z_stream *zs, int a)
-{
- int res = 0, pos = 0;
-
- while (a --)
- {
- if (zs->reserved == 1)
- {
- if (zs->avail_in == 0)
- return 1;
- zs->reserved = *(zs->next_in ++) | 0x0100;
- zs->avail_in --;
- }
-
- res += (zs->reserved & 1) << pos;
- zs->reserved >>= 1;
- pos ++;
- }
-
- return res;
-}
-
-
-// Huffman tree structures, variables and related routines
-//
-// These routines are one-bit-at-a-time decode routines. They
-// are not as fast as multi-bit routines, but maybe a bit easier
-// to understand and use a lot less memory.
-//
-// The tree is created in an array
-//
-// currentTree = where to put the tree (in an array)
-// numval = Number of elements in the lengths array
-// lengths = array of lengths
-//
-//
-// This function consumes a large percentage of time (#5)
-int CreateTree(HufNode *currentTree, int numval, unsigned char *lengths) {
- int i, j, len; // basically scratch values
- int BlankNode; // Where is the next blank array index
- int this_code, mask, *bitData; // used in tree generation
- int bl_count[16] = { 0, }; // Counter of code lengths
- int next_code[16] = { 0, }; // Code for a specific length
- // 16 = (15 is max length of a code when inflating) + (1 for zero)
-
- // Step 1: Count the code lengths
- for (i = 0; i < numval; i ++)
- {
- j = lengths[i];
- if (j > 15)
- return 1;
- bl_count[j] ++;
- }
-
- // Step 2: Find numerical value of the smallest code of each length
- // Also note that I've inserted some weak validation code here. I'm
- // not 100% sure that it is up to RFC specs, but it seems to work fine
- // in my tests
- //
- // The validation theory is that at the root node, you have 2 branches or
- // values possible. If you branch, you get 2 more potentials. If you
- // get a value, you lose one potential. So, if the root node has one of
- // each, the number of potentials at the next level is still two. If that
- // node just has branches, the number of potentials is four. If both of
- // the nodes on the following level just have values, the number of
- // potentials is 0, leaving us with a complete tree.
- //
- // If I don't validate and if an invalid tree gets generated, an
- // infinite loop is possible
- bl_count[0] = 0;
- j = 0;
- len = 2;
- for (i = 1; i < 16; i ++)
- {
- len -= bl_count[i];
- len *= 2;
- j = (j + bl_count[i - 1]) << 1;
- next_code[i] = j;
- }
- if (len)
- return 1;
-
- // Step 3: Assign numerical values to all codes
- BlankNode = 1;
- currentTree[0].b0 = 0x0000;
- currentTree[0].b1 = 0x0000;
- for (i = 0; i < numval; i ++)
- {
- len = lengths[i];
- if (len != 0)
- {
- this_code = next_code[len];
- next_code[len] ++;
- mask = 1 << (len - 1);
- j = 0;
- while (mask > 1)
- {
- if (this_code & mask)
- bitData = &(currentTree[j].b1);
- else
- bitData = &(currentTree[j].b0);
-
- if (*bitData == 0x0000)
- {
- *bitData = BlankNode;
- j = BlankNode;
- BlankNode ++;
- currentTree[j].b0 = 0x0000;
- currentTree[j].b1 = 0x0000;
- }
- else
- j = *bitData;
-
- mask >>= 1;
- }
- if (this_code & 0x01)
- currentTree[j].b1 = 0x8000 | i;
- else
- currentTree[j].b0 = 0x8000 | i;
- }
- }
-
-#ifdef VERBOSE
- fprintf(stderr, "%d table entries used\n",
- BlankNode);
- if (numval < 20) {
- for (i = 0; i < BlankNode; i ++)
- {
- fprintf(stderr, "0x%03x - ", i);
- if (currentTree[i].b0 & 0x8000)
- fprintf(stderr, "value: 0x%03x ", currentTree[i].b0 ^ 0x8000);
- else
- fprintf(stderr, " link: 0x%03x ", currentTree[i].b0);
-
- if (currentTree[i].b1 & 0x8000)
- fprintf(stderr, "value: 0x%03x\n", currentTree[i].b1 ^ 0x8000);
- else
- fprintf(stderr, " link: 0x%03x\n", currentTree[i].b1);
- }
- }
-#endif
-
- return 0;
-}
-
-
-// Using the tree passed in, read bits from the data stream until we arrive
-// at the proper value
-//
-// This function consumes a large percentage of time (#2)
-int DecodeValue(z_stream *zs, HufNode *currentTree)
-{
- unsigned int i = 0;
-
- // decode one symbol of the data per iteration
- // Infinite loop detection code could go here. Maximum
- // bits to read is 15.
- while (i < 0x8000)
- {
- if (READBIT(zs))
- i = currentTree[i].b1;
- else
- i = currentTree[i].b0;
- }
- return i & 0x7FFF;
-}
-
-
-int Decompress_Stored(z_stream *zs)
-{
- int blockLen, cSum;
-
-#ifdef VERBOSE
- fprintf(stderr, "Stored\n");
-#endif
-
- zs->reserved = 1;;
- if (zs->avail_in < 4)
- return -1;
-
- zs->avail_in -= 4;
- blockLen = *(zs->next_in ++);
- blockLen |= *(zs->next_in ++) << 8;
-
- cSum = *(zs->next_in ++);
- cSum |= (*(zs->next_in ++) << 8);
-
- if ((blockLen + cSum) ^ 0xFFFF)
- return 1;
- if (zs->avail_in < blockLen || zs->avail_out < blockLen)
- return -1;
- zs->avail_in -= blockLen;
- zs->avail_out -= blockLen;
-
- while (blockLen --)
- {
- *(zs->next_out) = *(zs->next_in);
- zs->next_out ++;
- zs->next_in ++;
- }
-
- return 0;
-}
-
-
-int MakeTrees(z_stream *zs, char is_fixed, HufNode *literalTree,
- HufNode *distanceTree)
-{
- // Order of the bit length code lengths
- static const unsigned border[] = {
- 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
- unsigned char ll[288+32];
- int i, j, n, l, literalCodes, distCodes;
-
- if (is_fixed)
- {
- literalCodes = 288;
-
- // Set a large range to 8
- for (i = 0; i < 288; i ++)
- ll[i] = 8;
- // In that range, set some to 9 and others to 7
- // (smaller code, but slightly slower table generation)
- for (i = 144; i < 256; i ++)
- ll[i] = 9;
- for (; i < 280; i ++)
- ll[i] = 7;
-
- distCodes = 32;
-
- for (i = 288; i < 320; i ++)
- ll[i] = 5;
- }
- else
- {
- literalCodes = 257 + READBITS(zs, 5);
- distCodes = 1 + READBITS(zs, 5);
- l = 4 + READBITS(zs, 4);
-
- for (j = 0; j < 19; j ++)
- ll[j] = 0;
-
- // Get the decode tree code lengths
- // The decode tree is Huffman encoded
-
- for (j = 0; j < l; j++)
- {
- ll[border[j]] = READBITS(zs, 3);
- }
- if (CreateTree(distanceTree, 19, ll))
- return 1;
-
- // read in literal and distance code lengths
- n = literalCodes + distCodes;
- i = 0;
- while (i < n)
- {
- j = DecodeValue(zs, distanceTree);
- if (j < 16) // length of code in bits (0..15)
- ll[i++] = j;
- else if (j == 16)
- { // repeat last length 3 to 6 times
- j = 3 + READBITS(zs, 2);
-
- if (i + j > n)
- return 1;
-
- l = i ? ll[i-1] : 0;
- while (j --)
- ll[i++] = l;
- }
- else
- {
- if (j == 17) // 3 to 10 zero length codes
- j = 3 + READBITS(zs, 3);
- else // j == 18: 11 to 138 zero length codes
- j = 11 + READBITS(zs, 7);
-
- if (i + j > n)
- return 1;
-
- while (j --)
- ll[i++] = 0;
- }
- }
- }
-
-
- // Can overwrite tree decode tree as it is not used anymore
- if (CreateTree(literalTree, literalCodes, &ll[0]))
- return 1;
-
- if(CreateTree(distanceTree, distCodes, &ll[literalCodes]))
- return 1;
-
- return 0;
-}
-
-
-// This function consumes a large percentage of time (#3)
-// Most output produced by gzip/zlib/etc is dynamic.
-int Decompress_DynamicOrFixed(z_stream *zs, char is_fixed)
-{
- // Copy lengths for literal codes 257..285
- static const unsigned short cplens[] = {
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
- 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 };
- // Extra bits for literal codes 257..285
- static const unsigned short cplext[] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
- 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99 }; // 99==invalid
- // Copy offsets for distance codes 0..29
- static const unsigned short cpdist[] = {
- 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0007, 0x0009, 0x000d,
- 0x0011, 0x0019, 0x0021, 0x0031, 0x0041, 0x0061, 0x0081, 0x00c1,
- 0x0101, 0x0181, 0x0201, 0x0301, 0x0401, 0x0601, 0x0801, 0x0c01,
- 0x1001, 0x1801, 0x2001, 0x3001, 0x4001, 0x6001 };
- // Extra bits for distance codes
- static const unsigned short cpdext[] = {
- 0, 0, 0, 0, 1, 1, 2, 2,
- 3, 3, 4, 4, 5, 5, 6, 6,
- 7, 7, 8, 8, 9, 9, 10, 10,
- 11, 11, 12, 12, 13, 13 };
- HufNode literalTree[288];
- HufNode distanceTree[32];
- int j, l, dist;
-
-#ifdef VERBOSE
- if (is_fixed)
- fprintf(stderr, "Fixed Huffman codes\n");
- else
- fprintf(stderr, "Dynamic Huffman codes\n");
-#endif
-
- if (MakeTrees(zs, is_fixed, literalTree, distanceTree))
- return 1;
-
- while (1)
- {
- j = DecodeValue(zs, literalTree);
- if (j >= 256)
- {
- if (j == 256) // EOF
- break;
-
- //printf("%04x ", j);
- j -= 256 + 1; // bytes + EOF
-
- l = READBITS(zs, cplext[j]) + cplens[j];
- //printf("%04x ", l);
-
- j = DecodeValue(zs, distanceTree);
- //printf("%02x ", j);
-
- dist = READBITS(zs, cpdext[j]) + cpdist[j];
- //printf("%04x ", dist);
-
- //printf("LZ77 len %d dist %d @%04x\n", l, dist, bIdx);
- while(l--)
- {
- //printf("%02x ", c);
- if (! zs->avail_out --)
- return -1;
-
- *(zs->next_out ++) = *(zs->next_out - dist);
- }
- //printf("\n");
- }
- else
- {
- //printf("%02x\n", j);
- if (! zs->avail_out --)
- return -1;
- *(zs->next_out ++) = (unsigned char) j;
- }
- }
- return 0;
-}
-
-
-// Returns 0 if success
-int InflateData(z_stream *zs) {
- int last, type;
-
- zs->reserved = 1;;
-
- do
- {
- last = READBIT(zs);
-#ifdef VERBOSE
- if (last)
- fprintf(stderr, "Last Block: ");
- else
- fprintf(stderr, "Not Last Block: ");
-#endif
-
- type = READBITS(zs, 2);
-
- if (type == 0)
- {
-#ifdef VERBOSE
- fprintf(stderr, "Decompress_Stored..");
-#endif
- if (Decompress_Stored(zs))
- return 1;
- }
- else if (type > 2)
- {
-#ifdef VERBOSE
- if (type == 3)
- fprintf(stderr, "Reserved block type!!\n");
- else // the "else" should never happen
- fprintf(stderr, "Unexpected value %d!\n", type);
-#endif
- zs->reserved = 1;;
- return 1;
- }
- else
- {
-#ifdef VERBOSE
- fprintf(stderr, "Decompress_DynamicOrFixed..");
-#endif
- if (Decompress_DynamicOrFixed(zs, type & 0x01))
- return 1;
- }
- } while(!last);
-
- zs->reserved = 1;;
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/inflate.h b/lib/CPUs/MIPS/bsp/examples/inflate.h
deleted file mode 100644
index 1f6fd38..0000000
--- a/lib/CPUs/MIPS/bsp/examples/inflate.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifdef USE_ZLIB_STRUCT
-#include "SysZLib.h" // For PalmOS. Change to your liking.
-#else
-typedef struct z_stream_s
-{
- unsigned char *next_in; // Next input byte (CHANGES)
- unsigned int avail_in; // number of bytes left at next_in
- unsigned char *next_out; // Next output byte goes here (CHANGES)
- unsigned int avail_out; // number of bytes left at next_out
- unsigned int reserved; // For the readbit() and readbits() functions
- // Bigger than 1 byte
-} z_stream;
-#endif
-
-int InflateData(z_stream *zs);
diff --git a/lib/CPUs/MIPS/bsp/examples/irq.c b/lib/CPUs/MIPS/bsp/examples/irq.c
deleted file mode 100644
index 85e1320..0000000
--- a/lib/CPUs/MIPS/bsp/examples/irq.c
+++ /dev/null
@@ -1,92 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include "libsys.h"
-#include "regdef.h"
-#include "xcpt.h"
-#include "irq.h"
-
-static fp_irq_t g_irq_handler[MAX_NUM_IRQ] = {NULL};
-
-int _irq_dispatch(struct xcptcontext * xcp)
-{
- int i, ip, cause;
-
- cause = xcp->cr & xcp->sr;
- ip = (cause >> 8) & 0xFF;
-
- for (i=0; i < MAX_NUM_IRQ; i++)
- {
- if (ip & 1)
- if (g_irq_handler[i])
- (g_irq_handler[i])(xcp);
-
- ip >>= 1;
- }
-
- return 0;
-}
-
-void interrupt_register(int irq_num, fp_irq_t fp)
-{
- if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
- g_irq_handler[irq_num] = fp;
-
-}
-
-void interrupt_enable(int irq_num)
-{
- reg_t reg, im;
-
- if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
- {
- im = 1 << irq_num;
- reg = CP0_SR_read();
- reg |= (SR_MASK_IM & (im << 8));
- CP0_SR_write(reg);
- }
-
-}
-
-void interrupt_disable(int irq_num)
-{
- reg_t reg, im;
-
- if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
- {
- im = 1 << irq_num;
- reg = CP0_SR_read();
- reg &= ~(SR_MASK_IM & (im << 8));
- CP0_SR_write(reg);
- }
-}
-
-void interrupt_set(int irq_num)
-{
- reg_t reg, ip;
-
- if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
- {
- ip = 1 << irq_num;
- reg = CP0_CR_read();
- reg |= (CR_MASK_IP & (ip << 8));
- CP0_CR_write(reg);
- }
-}
-
-void interrupt_clr(int irq_num)
-{
- reg_t reg, ip;
-
- if ((irq_num >= 0) && (irq_num < MAX_NUM_IRQ))
- {
- ip = 1 << irq_num;
- reg = CP0_CR_read();
- reg &= ~(CR_MASK_IP & (ip << 8));
- CP0_CR_write(reg);
- }
-}
-
-
diff --git a/lib/CPUs/MIPS/bsp/examples/irq.h b/lib/CPUs/MIPS/bsp/examples/irq.h
deleted file mode 100644
index d6c343c..0000000
--- a/lib/CPUs/MIPS/bsp/examples/irq.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef IRQ_H
-#define IRQ_H
-
-#include "xcpt.h"
-
-#define MAX_NUM_IRQ 8
-
-typedef void (*fp_irq_t)(struct xcptcontext * xcp);
-
-int _irq_dispatch(struct xcptcontext * xcp);
-void interrupt_register(int irq_num, fp_irq_t fp);
-void interrupt_enable(int irq_num);
-void interrupt_disable(int irq_num);
-
-#endif // IRQ_H
diff --git a/lib/CPUs/MIPS/bsp/examples/isqrt.c b/lib/CPUs/MIPS/bsp/examples/isqrt.c
deleted file mode 100644
index 6022fc1..0000000
--- a/lib/CPUs/MIPS/bsp/examples/isqrt.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* +++Date last modified: 05-Jul-1997 */
-
-#include
-#include "snipmath.h"
-
-#define BITSPERLONG 32
-
-#define TOP2BITS(x) ((x & (3L << (BITSPERLONG-2))) >> (BITSPERLONG-2))
-
-
-/* usqrt:
- ENTRY x: unsigned long
- EXIT returns floor(sqrt(x) * pow(2, BITSPERLONG/2))
-
- Since the square root never uses more than half the bits
- of the input, we use the other half of the bits to contain
- extra bits of precision after the binary point.
-
- EXAMPLE
- suppose BITSPERLONG = 32
- then usqrt(144) = 786432 = 12 * 65536
- usqrt(32) = 370727 = 5.66 * 65536
-
- NOTES
- (1) change BITSPERLONG to BITSPERLONG/2 if you do not want
- the answer scaled. Indeed, if you want n bits of
- precision after the binary point, use BITSPERLONG/2+n.
- The code assumes that BITSPERLONG is even.
- (2) This is really better off being written in assembly.
- The line marked below is really a "arithmetic shift left"
- on the double-long value with r in the upper half
- and x in the lower half. This operation is typically
- expressible in only one or two assembly instructions.
- (3) Unrolling this loop is probably not a bad idea.
-
- ALGORITHM
- The calculations are the base-two analogue of the square
- root algorithm we all learned in grammar school. Since we're
- in base 2, there is only one nontrivial trial multiplier.
-
- Notice that absolutely no multiplications or divisions are performed.
- This means it'll be fast on a wide range of processors.
-*/
-
-void usqrt(unsigned long x, struct int_sqrt *q)
-{
- unsigned long a = 0L; /* accumulator */
- unsigned long r = 0L; /* remainder */
- unsigned long e = 0L; /* trial product */
-
- int i;
-
- for (i = 0; i < BITSPERLONG; i++) /* NOTE 1 */
- {
- r = (r << 2) + TOP2BITS(x); x <<= 2; /* NOTE 2 */
- a <<= 1;
- e = (a << 1) + 1;
- if (r >= e)
- {
- r -= e;
- a++;
- }
- }
- memcpy(q, &a, sizeof(long));
-}
-
-#ifdef TEST
-
-#include
-#include
-
-main(void)
-{
- int i;
- unsigned long l = 0x3fed0169L;
- struct int_sqrt q;
-
- for (i = 0; i < 101; ++i)
- {
- usqrt(i, &q);
- printf("sqrt(%3d) = %2d, remainder = %2d\n",
- i, q.sqrt, q.frac);
- }
- usqrt(l, &q);
- printf("\nsqrt(%lX) = %X, remainder = %X\n", l, q.sqrt, q.frac);
- return 0;
-}
-
-#endif /* TEST */
diff --git a/lib/CPUs/MIPS/bsp/examples/kernel.S b/lib/CPUs/MIPS/bsp/examples/kernel.S
deleted file mode 100644
index aa0648b..0000000
--- a/lib/CPUs/MIPS/bsp/examples/kernel.S
+++ /dev/null
@@ -1,184 +0,0 @@
-#include
-#include
-
- .section .exc_vect
-_xcpt_vector_tbl:
- .fill 16, 4, 0
-
- .text
-
-LEAF(_xcpt_handler)
- .set noreorder
- .set noat
- /* Note: exceptions do not save and restore registers k0 and k1.
- * on entry, k1 = exception class.
- */
-
- /* allocate exception stack frame (on 8-byte boundary) */
- subu k1, sp, XCP_SIZE
- srl k1, 3 /* shift right/left -> alligned on boundary */
- sll k1, 3
-
- /* save enough registers to get by */
- sw AT, XCP_AT(k1)
- sw v0, XCP_V0(k1)
- sw v1, XCP_V1(k1)
- sw a0, XCP_A0(k1)
- sw a1, XCP_A1(k1)
- sw a2, XCP_A2(k1)
- sw a3, XCP_A3(k1)
- sw sp, XCP_SP(k1)
- sw ra, XCP_RA(k1)
-
- /* get coprocessor 0 exception state */
- mfc0 a0, CP0_CR
- mfc0 a1, CP0_SR
- mfc0 a2, CP0_BADDR
- mfc0 a3, CP0_EPC
-
- /* we can safely use AT now */
- .set at
-
- /* switch to using sp to point at exception frame */
- move sp, k1
-
- /* nothing sensible to store for k0/k1, store zero */
- sw zero, XCP_K0(sp)
- sw zero, XCP_K1(sp)
-
- /* we are now interruptible: dump all remaining state
- * into the exception stack frame.
- */
- /* coprocessor exception state */
- sw a0, XCP_CR(sp)
- sw a1, XCP_SR(sp)
- sw a2, XCP_BADDR(sp)
- sw a3, XCP_EPC(sp)
-
- /* mdhi and mdlo */
- mfhi v0
- mflo v1
- sw v0, XCP_MDHI(sp)
- sw v1, XCP_MDLO(sp)
-
- /* Save all the other general registers.
- * We save zero, s0-s7 and s8 as well, as instruction emulators (e.g. FP
- * operations) and debuggers rely on all registers stored together in
- * well-defined structure.
- */
- sw zero, XCP_ZERO(sp)
- sw t0, XCP_T0(sp)
- sw t1, XCP_T1(sp)
- sw t2, XCP_T2(sp)
- sw t3, XCP_T3(sp)
- sw t4, XCP_T4(sp)
- sw t5, XCP_T5(sp)
- sw t6, XCP_T6(sp)
- sw t7, XCP_T7(sp)
- sw s0, XCP_S0(sp)
- sw s1, XCP_S1(sp)
- sw s2, XCP_S2(sp)
- sw s3, XCP_S3(sp)
- sw s4, XCP_S4(sp)
- sw s5, XCP_S5(sp)
- sw s6, XCP_S6(sp)
- sw s7, XCP_S7(sp)
- sw t8, XCP_T8(sp)
- sw t9, XCP_T9(sp)
- sw gp, XCP_GP(sp)
- sw s8, XCP_S8(sp)
-
- /* I don't know what the following does. [rb] */
- /* load our _gp pointer */
-# la gp, _gp
-
- /* and call the C exception handler */
- move a0, sp # arg1 = &xcp
- subu sp, 16 # (arg save area)
- j _xcpt_call
- move ra, zero # fake return address
-
- /* This strange call to _xcpt_call with zero return address is to
- * help exception-aware debuggers to trace back over the exception event.
- * We are basically interposing a bogus stackframe (with a zero return
- * address) between the C exception handler and the actual machine
- * exception.
- */
-$xcptrest:
- .set noat
- add AT, sp, 16
-
- /* at points to exception frame */
-$xcptrestother:
- /* restore all state */
- /* restore most general registers */
- lw t0, XCP_T0(AT)
- lw t1, XCP_T1(AT)
- lw t2, XCP_T2(AT)
- lw t3, XCP_T3(AT)
- lw t4, XCP_T4(AT)
- lw t5, XCP_T5(AT)
- lw t6, XCP_T6(AT)
- lw t7, XCP_T7(AT)
- lw s0, XCP_S0(AT)
- lw s1, XCP_S1(AT)
- lw s2, XCP_S2(AT)
- lw s3, XCP_S3(AT)
- lw s4, XCP_S4(AT)
- lw s5, XCP_S5(AT)
- lw s6, XCP_S6(AT)
- lw s7, XCP_S7(AT)
- lw t8, XCP_T8(AT)
- lw t9, XCP_T9(AT)
- lw gp, XCP_GP(AT)
- lw s8, XCP_S8(AT)
-
- /* mdhi and mdlo */
- lw v0, XCP_MDHI(AT)
- lw v1, XCP_MDLO(AT)
- mthi v0
- mtlo v1
-
- /* remaining general registers */
- lw a0, XCP_A0(AT)
- lw a1, XCP_A1(AT)
- lw a2, XCP_A2(AT)
- lw a3, XCP_A3(AT)
- lw ra, XCP_RA(AT)
-
- /* restore the exception-time status register */
- .set noreorder
- lw v0, XCP_SR(AT)
- nop
- mtc0 v0, CP0_SR
- lw v1, XCP_V1(AT)
- lw v0, XCP_V0(AT)
- lw sp, XCP_SP(AT)
-
- /* we are not uninterruptible and can use k1 safely */
- lw k1, XCP_EPC(AT)
- lw AT, XCP_AT(AT)
- mtc0 k1, CP0_EPC
- j k1
- rfe
-
- .set reorder
- .set at
-END(_xcpt_handler)
-
-
-LEAF(_xcpt_call)
- /* on entry: a0 == &xcp */
- subu sp, 24
- sw ra, 16(sp)
-
- /* punt out to _xcpt_deliver */
- jal _xcpt_deliver
- nop
- lw ra, 16(sp)
- addu sp, 24
- beqz ra, $xcptrest
- nop
- j ra
- nop
-END(_xcpt_call)
diff --git a/lib/CPUs/MIPS/bsp/examples/libsys.c b/lib/CPUs/MIPS/bsp/examples/libsys.c
deleted file mode 100644
index 93721da..0000000
--- a/lib/CPUs/MIPS/bsp/examples/libsys.c
+++ /dev/null
@@ -1,1101 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "libsys.h"
-
-
-// ---------------------------------------------------------------------------------
-// Forward declarations
-// ---------------------------------------------------------------------------------
-void flush(UINT32 port);
-UINT32 GetPort(int file);
-
-// ---------------------------------------------------------------------------------
-// Types
-// ---------------------------------------------------------------------------------
-void libsys_init(void)
-{
- UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
- UINT32 volatile *pITIM_ctrl = (UINT32*)SYS_ITIM_CTRL;
-
- Screen_clr();
-
- // Disable timers
- *pITIM_ctrl = 0;
-
- // Disable all VGA stuff
- *pVGA_ctrl = 0;
-
- // Initialzie syscall support
- syscalls_init();
-
- // Initalize debugger
- dbg_init();
-
- // flush stdin
- flush(GetPort(0));
-
- // Do some initializations here
-
-}
-
-UINT32 GetPort(int file)
-{
- if (file == 0)
- return 0;
-
- if (file == 1)
- return 0;
-
- if (file == 2)
- return 2;
-}
-
-enum
-{
- IF_TYPE_INVALID = 0,
- IF_TYPE_UART,
- IF_TYPE_PS2,
- IF_TYPE_VGA
-};
-
-typedef struct _suart_if_t
-{
- volatile UINT32 *pCTRL;
- volatile UINT32 *pDATA;
- volatile UINT32 *pBAUD;
-} uart_if_t;
-
-typedef struct _sps2_if_t
-{
- volatile UINT32 *pCTRL;
- volatile UINT32 *pDATA;
-} ps2_if_t;
-
-typedef struct _svga_if_t
-{
- volatile UINT32 *pCTRL;
- volatile UINT32 *pDATA;
- volatile UINT32 *pCSRX;
- volatile UINT32 *pCSRY;
-} vga_if_t;
-
-typedef struct _scon_if_in_t
-{
- UINT32 type;
- void *pIF;
-} con_if_in_t;
-
-typedef struct _scon_if_out_t
-{
- UINT32 type;
- void *pIF;
-} con_if_out_t;
-
-// ---------------------------------------------------------------------------------
-// Globals
-// ---------------------------------------------------------------------------------
-static uart_if_t uart_if[2] =
-{
- {(UINT32*)SYS_UART0_STAT, (UINT32*)SYS_UART0_DATA, (UINT32*)SYS_UART0_BAUD},
- {(UINT32*)SYS_UART1_STAT, (UINT32*)SYS_UART1_DATA, (UINT32*)SYS_UART1_BAUD}
-};
-
-extern ps2_if_t ps2_if[];
-
-static vga_if_t vga_if =
-{
- (UINT32*)SYS_VGA_CTRL, (UINT32*)SYS_VGA_ASCII, (UINT32*)SYS_VGA_POSX, (UINT32*)SYS_VGA_POSY
-};
-
-static con_if_in_t con_if_in[4] =
-{
- {IF_TYPE_UART, &uart_if[0]},
- {IF_TYPE_UART, &uart_if[1]},
- {IF_TYPE_PS2, &ps2_if[0]},
- {IF_TYPE_PS2, &ps2_if[1]}
-};
-
-static con_if_out_t con_if_out[4] =
-{
- {IF_TYPE_UART, &uart_if[0]},
- {IF_TYPE_UART, &uart_if[1]},
- {IF_TYPE_VGA, &vga_if},
- {IF_TYPE_INVALID, NULL}
-};
-
-// ---------------------------------------------------------------------------------
-// MIPS specific
-// ---------------------------------------------------------------------------------
-UINT32 CP0_SR_read(void)
-{
- UINT32 result;
-
- __asm__
- (
- "mfc0 %[val], $12\n"
- : [val] "=r" (result)
- );
-
- return result;
-}
-
-void CP0_SR_write(UINT32 val)
-{
- __asm__
- (
- "mtc0 %[val], $12\n"
- : /* no output */
- : [val] "r" (val)
- );
-}
-
-UINT32 CP0_CR_read(void)
-{
- UINT32 result;
-
- __asm__
- (
- "mfc0 %[val], $13\n"
- : [val] "=r" (result)
- );
-
- return result;
-}
-
-void CP0_CR_write(UINT32 val)
-{
- __asm__
- (
- "mtc0 %[val], $13\n"
- :
- : [val] "r" (val)
- );
-}
-
-UINT32 CP0_TR_read(void)
-{
- UINT32 result;
-
- __asm__
- (
- "mfc0 %[val], $31\n"
- : [val] "=r" (result)
- );
-
- return result;
-}
-
-void CP0_TR_write(UINT32 val)
-{
- __asm__
- (
- "mtc0 %[val], $31\n"
- :
- : [val] "r" (val)
- );
-}
-
-UINT32 CP0_PRID_read(void)
-{
- UINT32 result;
-
- __asm__
- (
- "mfc0 %[val], $15\n"
- : [val] "=r" (result)
- );
-
- return result;
-}
-
-void CP0_TR_write_ptr(UINT32* pPtr)
-{
- __asm__
- (
- "swc0 $31, 0(%[pPtr])\n"
- :
- : [pPtr] "r" (pPtr)
- );
-}
-
-void CP0_TR_read_ptr(UINT32* pPtr)
-{
- __asm__
- (
- "lwc0 $31, 0(%[pPtr])\n"
- :
- : [pPtr] "r" (pPtr)
- );
-}
-
-void ICACHE_invalidate_all(void)
-{
- __asm__
- (
- "cop0 32\n"
- );
-}
-
-void ICACHE_invalidate_at(UINT32* pPtr)
-{
- __asm__
- (
- "mtc0 %[pPtr], $31\n"
- "cop0 33\n"
- :
- : [pPtr] "r" (pPtr)
- );
-}
-
-void DCACHE_invalidate_all(void)
-{
- __asm__
- (
- "cop0 34\n"
- );
-}
-
-void DCACHE_invalidate_at(UINT32* pPtr)
-{
- __asm__
- (
- "mtc0 %[pPtr], $31\n"
- "cop0 35\n"
- :
- : [pPtr] "r" (pPtr)
- );
-}
-
-// -------------------------------------------------------------
-// BEGIN QUICK AND DIRTY
-// -------------------------------------------------------------
-//keymap for the AT keyboard SG layout
-typedef struct
-{
- UINT8 scancode;
- UINT8 unshifted;
- UINT8 shifted;
- UINT8 altered;
-} libsys_key_entry_t;
-
-#define SHIFTED (1<<0)
-#define ALTERED (1<<1)
-#define CONTROLLED (1<<2)
-
-static const libsys_key_entry_t __keymap_german[] =
-{
- {0x1c, 'a', 'A', 'a'},
- {0x32, 'b', 'B', 'b'},
- {0x21, 'c', 'C', 'c'},
- {0x23, 'd', 'D', 'd'},
- {0x24, 'e', 'E', '€'},
- {0x2b, 'f', 'F', 'f'},
- {0x34, 'g', 'G', 'g'},
- {0x33, 'h', 'H', 'h'},
- {0x43, 'i', 'I', 'i'},
- {0x3b, 'j', 'J', 'j'},
- {0x42, 'k', 'K', 'k'},
- {0x4b, 'l', 'L', 'l'},
- {0x3a, 'm', 'M', 'µ'},
- {0x31, 'n', 'N', 'n'},
- {0x44, 'o', 'O', 'o'},
- {0x4d, 'p', 'P', 'p'},
- {0x15, 'q', 'Q', '@'},
- {0x2d, 'r', 'R', 'r'},
- {0x1b, 's', 'S', 's'},
- {0x2c, 't', 'T', 't'},
- {0x3c, 'u', 'U', 'u'},
- {0x2a, 'v', 'V', 'v'},
- {0x1d, 'w', 'W', 'w'},
- {0x22, 'x', 'X', 'x'},
- {0x1a, 'y', 'Y', 'y'},
- {0x35, 'z', 'Z', 'z'},
- {0x16, '1', '!', '1'},
- {0x1e, '2', '"', '2'},
- {0x26, '3', '§', '3'},
- {0x25, '4', '$', '4'},
- {0x2e, '5', '%', '5'},
- {0x36, '6', '&', '6'},
- {0x3d, '7', '/', '{'},
- {0x3e, '8', '(', '['},
- {0x46, '9', ')', ']'},
- {0x45, '0', '=', '}'},
- {0x4e, 'ß', '?', '\\'},
- {0x29, ' ', ' ', ' '},
- {0x41, ',', ';', ','},
- {0x49, '.', ':', '.'},
- {0x4a, '-', '_', '-'},
- {0x52, 'ä', 'Ä', 'ä'},
- {0x4c, 'ö', 'Ö', 'ö'},
- {0x54, 'ü', 'Ü', 'ü'},
- {0x5a, '\n', '\n', '\n'}, //RETURN
- {0x5b, '+', '*', '~'},
- {0x5d, '#', '\'', '#'},
- {0x0e, '^', '°', '^'},
- {0x61, '<', '>', '|'},
- {0x66, '\b', '\b', '\b'},
- {0} //sentinel
-};
-
-static char __findkey(char scancode, int mode)
-{
- const libsys_key_entry_t *p = __keymap_german;
- while (p->scancode)
- {
- if (p->scancode == scancode)
- {
- switch (mode)
- {
- case SHIFTED:
- return p->shifted;
- case ALTERED:
- return p->altered;
- case ALTERED|SHIFTED:
- default:
- return p->unshifted;
- }
- }
- p++;
- }
- return 0;
-}
-
-#define RELEASE 0x8000
-#define SPECIALKEY 0x4000
-#define EXTENDED 0x2000
-#define X_CONTROLLED 0x0400
-#define X_ALTERED 0x0200
-#define X_SHIFTED 0x0100
-#define CAPS (SPECIALKEY|0x58)
-#define F1 (SPECIALKEY|0x05)
-#define F2 (SPECIALKEY|0x06)
-#define F3 (SPECIALKEY|0x04)
-#define F4 (SPECIALKEY|0x0c)
-#define F5 (SPECIALKEY|0x03)
-#define F6 (SPECIALKEY|0x0b)
-#define F7 (SPECIALKEY|0x83)
-#define F8 (SPECIALKEY|0x0a)
-#define F9 (SPECIALKEY|0x01)
-#define F10 (SPECIALKEY|0x09)
-#define F11 (SPECIALKEY|0x78)
-#define F12 (SPECIALKEY|0x07)
-#define ARROW_UP (SPECIALKEY|EXTENDED|0x75)
-#define ARROW_DOWN (SPECIALKEY|EXTENDED|0x72)
-#define ARROW_LEFT (SPECIALKEY|EXTENDED|0x6b)
-#define ARROW_RIGHT (SPECIALKEY|EXTENDED|0x74)
-
-UINT32 PS2_readchar(ps2_if_t *pIF)
-{
- if (!pIF)
- return -1;
-
- while (!(SYS_PS2_BIT_RX_AVAIL & *pIF->pCTRL));
-
- return (*pIF->pDATA & 0xFF);
-
-}
-
-UINT32 con_readchar(ps2_if_t *pIF)
-{
- UINT8 c;
- static char mode = 0;
- static char nextrelease = 0;
- static char extended = 0;
- int flags = 0;
- int char_valid = 0;
- UINT8 key;
-
- key = PS2_readchar(pIF);
-
- switch (key)
- {
- case 0xf0: //release key
- nextrelease = 1;
- break;
- case 0x14: //control key
- if (nextrelease)
- {
- mode &= ~CONTROLLED;
- } else
- {
- mode |= CONTROLLED;
- }
- nextrelease = 0;
- break;
- case 0x12: //left SHIFT
- case 0x59: //right SHIFT
- if (nextrelease)
- {
- mode &= ~SHIFTED;
- } else
- {
- mode |= SHIFTED;
- }
- nextrelease = 0;
- break;
- case 0x11: //left and right ALT (right one also with E0)
- if (nextrelease)
- {
- mode &= ~ALTERED;
- } else
- {
- mode |= ALTERED;
- }
- nextrelease = 0;
- break;
- case 0xe0: //extended key following
- extended = 1;
- break;
- default:
- if (nextrelease) flags |= RELEASE;
- if (extended) flags |= EXTENDED;
- flags |= mode << 8;
- c = __findkey(key, mode);
- char_valid = (c && ((flags & RELEASE) != RELEASE));
- nextrelease = 0;
- extended = 0;
- break;
- }
-
- if (char_valid)
- {
- // fprintf(stderr, "c = %c (%d), flags = 0x%08X, mode = 0x%08X\n", c, c, flags, mode);
- return c;
- }
-
- return -1;
-}
-// -------------------------------------------------------------
-// END QUICK AND DIRTY
-// -------------------------------------------------------------
-
-// ------------------------------------
-// Low-level I/O
-// ------------------------------------
-int UART_readchar(uart_if_t *pIF)
-{
- if (!pIF)
- return -1;
-
- if (SYS_UART_BIT_RX_AVAIL & *pIF->pCTRL)
- return (*pIF->pDATA & 0xFF);
-
- return -1;
-}
-
-void UART_writechar(uart_if_t *pIF, char c)
-{
- if (!pIF)
- return;
-
- while((SYS_UART_BIT_TX_HALFFULL & *pIF->pCTRL) != 0);
-
- *pIF->pDATA = (UINT32)c;
-}
-
-void cg_writechar(vga_if_t *pIF, char c)
-{
- UINT32 code;
-
- if (!pIF)
- return;
-
- // Output translation
- switch(c)
- {
- case 'Ä':
- code = 196;
- break;
-
- case 'ä':
- code = 228;
- break;
-
- case 'Ö':
- code = 214;
- break;
-
- case 'ö':
- code = 246;
- break;
-
- case 'Ü':
- code = 220;
- break;
-
- case 'ü':
- code = 252;
- break;
-
- case '&':
- code = 230;
- break;
-
- case '§':
- code = 167;
- break;
-
- case 'ß':
- code = 223;
- break;
-
- case '°':
- code = 176;
- break;
-
- case 'µ':
- code = 181;
- break;
-
- default:
- code = (UINT32)c;
- break;
- }
-
- while (!(*pIF->pCTRL & SYS_VGA_BIT_CGRDY));
- *pIF->pDATA = code;
-}
-
-void cg_set_csr_x(vga_if_t *pIF, UINT32 coord)
-{
- if (!pIF)
- return;
-
- // Set cursor
- while (!(*pIF->pCTRL & SYS_VGA_BIT_CGRDY));
- *pIF->pCSRX = coord;
-}
-
-void cg_set_csr_y(vga_if_t *pIF, UINT32 coord)
-{
- if (!pIF)
- return;
-
- // Set cursor
- while (!(*pIF->pCTRL & SYS_VGA_BIT_CGRDY));
- *pIF->pCSRY = coord;
-}
-
-void cg_clr_line(vga_if_t *pIF)
-{
- if (!pIF)
- return;
-
- while (!(*pIF->pCTRL & SYS_VGA_BIT_CGRDY));
- *pIF->pCTRL |= SYS_VGA_BIT_CLRLINE;
-}
-
-void cg_clr_screen(vga_if_t *pIF)
-{
-
- if (!pIF)
- return;
-
- while (!(*pIF->pCTRL & SYS_VGA_BIT_CGRDY));
- *pIF->pCTRL |= SYS_VGA_BIT_CLRSCR;
-
- // Cursor home
- while (!(*pIF->pCTRL & SYS_VGA_BIT_CGRDY));
- *pIF->pCSRX = 0;
-
- while (!(*pIF->pCTRL & SYS_VGA_BIT_CGRDY));
- *pIF->pCSRY = 0;
-
-}
-
-void Screen_clr(void)
-{
- cg_clr_screen(&vga_if);
-}
-
-void Screen_line_clr(void)
-{
- cg_clr_line(&vga_if);
-}
-
-void Screen_csr_set_x(UINT32 coord)
-{
- cg_set_csr_x(&vga_if, coord);
-}
-
-void Screen_csr_set_y(UINT32 coord)
-{
- cg_set_csr_y(&vga_if, coord);
-}
-
-UINT32 Screen_get_resx(void)
-{
- UINT32 volatile *pVGA_res = (UINT32*)SYS_VGA_RES;
-
- return (0xFFF & (*pVGA_res >> 0));
-}
-
-UINT32 Screen_get_resy(void)
-{
- UINT32 volatile *pVGA_res = (UINT32*)SYS_VGA_RES;
-
- return (0xFFF & (*pVGA_res >> 12));
-}
-
-UINT32 Screen_get_fps(void)
-{
- UINT32 volatile *pVGA_res = (UINT32*)SYS_VGA_RES;
-
- return (0xFF & (*pVGA_res >> 24));
-}
-
-// ---------------------------------------------------------------------------------
-void flush(UINT32 port)
-{
- int c;
- con_if_in_t *pIF;
-
- pIF = &con_if_in[port];
-
- do
- {
- switch(pIF->type)
- {
- case IF_TYPE_UART:
- c = UART_readchar((uart_if_t*)pIF->pIF);
- break;
-
- case IF_TYPE_PS2:
- c = con_readchar((ps2_if_t*)pIF->pIF);
- break;
-
- default:
- break;
- }
-
- } while(c > 0);
-}
-
-char readchar(UINT32 port)
-{
- int c;
- con_if_in_t *pIF;
-
- pIF = &con_if_in[port];
-
- do
- {
- switch(pIF->type)
- {
- case IF_TYPE_UART:
- c = UART_readchar((uart_if_t*)pIF->pIF);
- break;
-
- case IF_TYPE_PS2:
- c = con_readchar((ps2_if_t*)pIF->pIF);
- break;
-
- default:
- break;
- }
-
- } while(c < 0);
-
- return (char)c;
-}
-
-void writechar(UINT32 port, char c)
-{
- con_if_out_t *pIF;
-
- pIF = &con_if_out[port];
-
- switch(pIF->type)
- {
- case IF_TYPE_UART:
- UART_writechar((uart_if_t*)pIF->pIF, c);
- break;
-
- case IF_TYPE_VGA:
- cg_writechar((vga_if_t*)pIF->pIF, c);
- break;
-
- default:
- break;
- }
-}
-
-void _putchar(UINT32 port, char c)
-{
-
- con_if_out_t *pIF;
-
- pIF = &con_if_out[port];
-
- switch(pIF->type)
- {
- case IF_TYPE_UART:
- if (c == 0x0A)
- UART_writechar((uart_if_t*)pIF->pIF, 0x0D);
- UART_writechar((uart_if_t*)pIF->pIF, c);
- break;
-
- case IF_TYPE_VGA:
- cg_writechar((vga_if_t*)pIF->pIF, c);
- if (c == 0x0A)
- {
- cg_clr_line((vga_if_t*)pIF->pIF);
- cg_writechar((vga_if_t*)pIF->pIF, 0x0D);
- }
- break;
-
- default:
- break;
- }
-}
-
-char _getchar(void)
-{
- return readchar(GetPort(0));
-}
-
-void _exit (int exitcode)
-{
- fflush(stdout);
- fflush(stderr);
- while(1);
-}
-
-void sleep(unsigned ms)
-{
- unsigned stop;
- struct tms t;
-
- times(&t);
- stop = t.tms_utime + ms;
-
- do
- {
- times(&t);
- } while (t.tms_utime < stop);
-
-}
-
-
-int getrusage(int who, struct rusage *usage)
-{
- volatile long *pReg_usec = (long*)SYS_TIMER_USEC;
- volatile long *pReg_sec = (long*)SYS_TIMER_SEC;
-
- // who: RUSAGE_SELF or RUSAGE_CHILDREN
- usage->ru_utime.tv_usec = *pReg_usec;
- usage->ru_utime.tv_sec = *pReg_sec;
- usage->ru_stime.tv_usec = *pReg_usec;
- usage->ru_stime.tv_sec = *pReg_sec;
-}
-
-clock_t times(struct tms *buffer)
-{
- volatile long *pReg_usec = (long*)SYS_TIMER_USEC;
- volatile long *pReg_sec = (long*)SYS_TIMER_SEC;
- long sec;
- long usec;
-
- sec = *pReg_sec;
- usec = *pReg_usec;
-
- if (buffer)
- {
- buffer->tms_utime = sec*1000 + usec/1000;
- buffer->tms_stime = 0;
- buffer->tms_cutime = 0;
- buffer->tms_cstime = 0;
- }
-
- return (clock_t)sec;
-}
-
-int gettimeofday(struct timeval *tp, void *tzp)
-{
- volatile long *pReg_usec = (long*)SYS_TIMER_USEC;
- volatile long *pReg_sec = (long*)SYS_TIMER_SEC;
-
- if (tp)
- {
- tp->tv_sec = *pReg_sec;
- tp->tv_usec = *pReg_usec;
- }
-
- return 0;
-}
-
-int settimeofday(const struct timeval *tp, const struct timezone *tzp)
-{
- volatile long *pReg_usec = (long*)SYS_TIMER_USEC;
- volatile long *pReg_sec = (long*)SYS_TIMER_SEC;
- div_t res;
-
- res = div(tp->tv_usec, 1E6);
-
- if (tp)
- {
- *pReg_usec = res.rem;
- *pReg_sec = tp->tv_sec + res.quot;
- }
-
- return 0;
-}
-
-caddr_t sbrk(int incr)
-{
- extern char end;
- extern char stack_ptr;
- static char *heap_end;
- char *prev_heap_end;
-
- if (heap_end == 0)
- {
- heap_end = &end;
- }
-
- prev_heap_end = heap_end;
- if (heap_end + incr > &stack_ptr)
- {
-// sputs("Heap and stack collision\n");
-// sputs("Stack Ptr = ");print_word(&stack_ptr);sputs("\n");
-// sputs("Heap end = ");print_word(heap_end);sputs("\n");
-// sputs("Increment = ");print_word(incr);sputs("\n");
- exit(1);
- }
- heap_end += incr;
- return (caddr_t) prev_heap_end;
-}
-
-int fstat(int file, struct stat *st)
-{
-// sputs("fstat ("); print_word(file); sputs(")\n");
- st->st_mode = S_IFCHR;
- st->st_blksize = 0;
- return 0;
-}
-
-int lseek(int file, int ptr, int dir)
-{
-// sputs("lseek ("); print_word(file); sputs(")\n");
- errno = ESPIPE;
- return -1;
-}
-
-int open(const char *name, int flags, int mode)
-{
-// sputs("open (\""); sputs(name); sputs("\")\n");
- errno = EIO;
- return -1;
-}
-
-int close(int file)
-{
-// sputs("close ("); print_word(file); sputs(")\n");
- return 0;
-}
-
-int read(int file, char *ptr, int len)
-{
- UINT32 port;
- int i;
- char c;
-
-// sputs("read (file="); print_word(file); sputs(", len ="); print_word(len); sputs(")\n");
- i = 0;
- port = GetPort(file);
-
- while (i < len)
- {
- c = readchar(port);
-
- if (c == 0x04)
- break;
-
- if ((c == 0x0D) || (c == 0x0A))
- {
- writechar(port, 0x0D);
- ptr[i++] = 0x0D;
- writechar(port, 0x0A);
- ptr[i++] = 0x0A;
- break;
- }
-
- writechar(port, c);
- ptr[i++] = c;
-
- }
- return i;
-}
-
-int write(int file, char *ptr, int len)
-{
- UINT32 port;
- int i = 0;
-
-// sputs("write ("); print_word(file); sputs(")\n");
-
- port = GetPort(file);
- for (i=0; i < len; i++)
- _putchar(port, *ptr++);
-
- return i;
-}
-
-int isatty(int file)
-{
-// sputs("isatty ("); print_word(file); sputs(")\n");
- return 1;
-}
-
-int getpid(void)
-{
- return 1;
-}
-
-#include
-#undef errno
-extern int errno;
-int kill(int pid, int sig)
-{
- errno = EINVAL;
- return -1;
-}
-
-#include
-#undef errno
-extern int errno;
-int link(char *old, char *new)
-{
- errno = EMLINK;
- return -1;
-}
-
-#include
-#undef errno
-extern int errno;
-int unlink(char *name)
-{
- errno = ENOENT;
- return -1;
-}
-
-int sputs(char *pStr)
-{
- char *start;
- start = pStr;
-
- while(*pStr)
- _putchar(GetPort(0), *(pStr++));
-
- return pStr - start;
-}
-
-void print_byte(char byte)
-{
- int i;
- unsigned char c, nibble;
-
- for (i=0; i < 2; i++)
- {
- nibble = (char)((byte >> 4) & 0xF);
- byte <<= 4;
-
- if (nibble < 10)
- c = nibble + '0';
- else
- c = nibble + 'A' - 10;
-
- _putchar(GetPort(0), c);
- }
-}
-
-void print_word(int word)
-{
- int i;
- unsigned char c, nibble;
-
- for (i=0; i < 4; i++)
- {
- c = (char) (word >> 24);
- print_byte(c);
- word <<= 8;
- }
-}
-
-// ---------------------------------------------------------------------------------
-// PrintBuffer8()
-// Prints byte buffer as hex and ascii interpretation
-// ---------------------------------------------------------------------------------
-// _Parameters :
-// pBuf: : IN: Buffer to display
-// nbpr : Number of bytes per row to display
-// len : Length of input buffer
-// _Return: none
-//
-// ---------------------------------------------------------------------------
-void PrintBuffer8(UINT8 *pBuf, int nbpr, int len)
-{
- memdump(pBuf, 1, nbpr, len);
-}
-
-void memdump(UINT8 *pBuf, int print_offset_only, int num_bytes_per_row, int len)
-{
- int i, j, cnt_hex, cnt_asc, base;
- unsigned char c;
-
- i = j = 0;
- cnt_hex = len;
- cnt_asc = len;
- base = 0;
- if (!print_offset_only)
- base = (int)pBuf;
-
- do
- {
- print_word(base + i);
- sputs(": ");
- for (j=0; j < num_bytes_per_row; j++)
- {
- if (cnt_hex)
- {
- print_byte(pBuf[i+j]);
- sputs(" ");
- cnt_hex--;
- }
- else
- {
- sputs(" ");
- break;
- }
-
- }
-
- sputs(" ");
- for (j=0; j < num_bytes_per_row; j++)
- {
- if (cnt_asc)
- {
- c = pBuf[i+j];
- if((c < 0x20) || (c > 0x7F))
- c = '.';
-
- _putchar(GetPort(0), c);
- cnt_asc--;
- }
- else
- {
- sputs(" ");
- break;
- }
- }
- sputs("\n");
- i += num_bytes_per_row;
-
- } while (cnt_hex);
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/libsys.h b/lib/CPUs/MIPS/bsp/examples/libsys.h
deleted file mode 100644
index d14d2d9..0000000
--- a/lib/CPUs/MIPS/bsp/examples/libsys.h
+++ /dev/null
@@ -1,187 +0,0 @@
-#ifndef LIBSYS_H
-#define LIBSYS_H
-
-// ---------------------------------------------------------
-// Types
-// ---------------------------------------------------------
-#define INT8 signed char
-#define INT16 signed short
-#define INT32 signed int
-#define INT64 signed long long
-#define UINT8 unsigned char
-#define UINT16 unsigned short
-#define UINT32 unsigned int
-#define UINT64 unsigned long long
-#define INT INT32
-#define UINT UINT32
-#define FLOAT32 float
-#define FLOAT64 double
-
-#define NO_ERROR LSYS_SUCCESS
-#define ERROR LSYS_ERR_BASE
-#define LSYS_SUCCESS 0
-#define LSYS_ERR_BASE 0x80000000
-
-#define IS_ERROR(e) ((e & LSYS_ERR_BASE) == LSYS_ERR_BASE)
-
-// GPIO
-#define SYS_GPIO0 0xA0000000
-#define SYS_GPIO1 0xA0000004
-#define SYS_LED_PORT SYS_GPIO0
-#define SYS_USB_CTRL SYS_GPIO1
-#define SYS_TIMER_USEC 0xA0000008
-#define SYS_TIMER_SEC 0xA000000C
-
-// TIMERs
-#define SYS_ITIM_CTRL 0xA0000018
-#define SYS_ITIM_STAT 0xA000001C
-#define SYS_ITIM0_CNT 0xA0000020
-#define SYS_ITIM1_CNT 0xA0000024
-#define SYS_ITIM2_CNT 0xA0000028
-#define SYS_ITIM3_CNT 0xA000002C
-#define SYS_ITIM0_CMP 0xA0000030
-#define SYS_ITIM1_CMP 0xA0000034
-#define SYS_ITIM2_CMP 0xA0000038
-#define SYS_ITIM3_CMP 0xA000003C
-
-// UARTs
-#define SYS_UART_BIT_TX_HALFFULL 0x00000001
-#define SYS_UART_BIT_TX_FULL 0x00000002
-#define SYS_UART_BIT_RX_HALFFULL 0x00000004
-#define SYS_UART_BIT_RX_FULL 0x00000008
-#define SYS_UART_BIT_RX_AVAIL 0x00000010
-#define SYS_UART_BIT_TX_INTEN 0x00000020
-#define SYS_UART_BIT_RX_INTEN 0x00000040
-#define SYS_UART_BIT_TX_IRQ 0x00000100
-#define SYS_UART_BIT_RX_IRQ 0x00000200
-#define SYS_UART_DATA SYS_UART0_DATA
-#define SYS_UART_STAT SYS_UART0_STAT
-#define SYS_UART_BAUD SYS_UART0_BAUD
-#define SYS_UART0_DATA 0xA0010000
-#define SYS_UART0_STAT 0xA0010004
-#define SYS_UART0_BAUD 0xA0010008
-#define SYS_UART1_DATA 0xA0010100
-#define SYS_UART1_STAT 0xA0010104
-#define SYS_UART1_BAUD 0xA0010108
-
-// PS2s
-#define SYS_PS2_BIT_TX_EMPTY 0x00000001
-#define SYS_PS2_BIT_RX_AVAIL 0x00000004
-#define SYS_PS2_BIT_PIN_CLOCK 0x00000008
-#define SYS_PS2_BIT_PIN_DATA 0x00000010
-#define SYS_PS2_BIT_TX_INTEN 0x00000020
-#define SYS_PS2_BIT_RX_INTEN 0x00000040
-#define SYS_PS2_BIT_TX_IRQ 0x00000100
-#define SYS_PS2_BIT_RX_IRQ 0x00000200
-#define SYS_PS2_BIT_RX_ERR_PAR 0x00000800
-#define SYS_PS2_BIT_RX_ERR_FLAG 0x00008000
-#define SYS_PS2_0_DATA 0xA0010200
-#define SYS_PS2_0_STAT 0xA0010204
-#define SYS_PS2_1_DATA 0xA0010300
-#define SYS_PS2_1_STAT 0xA0010304
-
-// USB
-#define SYS_USB_DATA 0xA0020000
-#define SYS_USB_MBX 0xA0020004
-#define SYS_USB_ADDR 0xA0020008
-#define SYS_USB_STATUS 0xA002000C
-
-// VGA
-#define SYS_VGA_CTRL 0xA0030000 // R/W
-#define SYS_VGA_BIT_CGRDY 0x00000001 // RO
-#define SYS_VGA_BIT_MSTEN 0x00000002 // R/W
-#define SYS_VGA_BIT_BUFCHG_INTEN 0x00000004 // RO
-#define SYS_VGA_BIT_BUFCHG_FLAG 0x00000008 // RO
-#define SYS_VGA_BIT_CLRSCR 0x00000010 // WO
-#define SYS_VGA_BIT_CLRLINE 0x00000020 // WO
-#define SYS_VGA_BIT_BLIT_REQ 0x00000100 // R/W
-#define SYS_VGA_BIT_BLIT_BSY 0x00000100 // R/W
-#define SYS_VGA_BIT_BLIT_FIN 0x00000200 // R/W
-#define SYS_VGA_BIT_BLIT_ACK 0x00000200 // R/W
-#define SYS_VGA_BIT_BLIT_FIN_INTEN 0x00000400 // R/W
-#define SYS_VGA_ASCII 0xA0030004 // R/W
-#define SYS_VGA_POSX 0xA0030008 // R/W
-#define SYS_VGA_POSY 0xA003000C // R/W
-#define SYS_VGA_CGCOL 0xA0030010 // R/W
-#define SYS_VGA_RES 0xA0030014 // RO
-#define SYS_VGA_FB_FRONT 0xA0030018 // R/W
-#define SYS_VGA_FB_BACK 0xA003001C // R/W
-#define SYS_VGA_BLIT_SRC0 SYS_VGA_BLIT_SRC0_FIRST // R/W
-#define SYS_VGA_BLIT_SRC0_FIRST 0xA0030020 // R/W
-#define SYS_VGA_BLIT_SRC0_LAST 0xA0030024 // R/W
-#define SYS_VGA_BLIT_SRC0_DIMX 0xA0030028 // R/W
-#define SYS_VGA_BLIT_DST SYS_VGA_BLIT_DST_FIRST // R/W
-#define SYS_VGA_BLIT_DST_FIRST 0xA0030050 // R/W
-#define SYS_VGA_BLIT_DST_LAST 0xA0030054 // R/W
-#define SYS_VGA_BLIT_DST_DIMX 0xA0030058 // R/W
-#define SYS_VGA_BLIT_NX 0xA0030060 // R/W
-#define SYS_VGA_BLIT_NY 0xA0030064 // R/W
-
-// AC'97
-#define SYS_AC97_STAT 0xA0040000
-#define SYS_AC97_CTRL 0xA0040000
-#define SYS_AC97_ACSTAT 0xA0040400
-#define SYS_AC97_ACCTRL 0xA0040600
-#define SYS_AC97_PCM 0xA0040800
-#define SYS_AC97_WAVIN SYS_AC97_PCM
-#define SYS_AC97_WAVOUT SYS_AC97_PCM
-
-// Flash
-#define SYS_FLASH_IO 0xA4000000
-#define SYS_FLASH_MEM 0x00000000
-
-// Sync. SRAM
-#define SYS_SSRAM_IO 0xA8000000
-
-UINT32 CP0_SR_read(void);
-void CP0_SR_write(UINT32 val);
-UINT32 CP0_CR_read(void);
-void CP0_CR_write(UINT32 val);
-UINT32 CP0_PRID_read(void);
-UINT32 CP0_TR_read(void);
-void CP0_TR_write(UINT32 val);
-void CP0_TR_write_ptr(UINT32* pPtr);
-void CP0_TR_read_ptr(UINT32* pPtr);
-void ICACHE_invalidate_all(void);
-void ICACHE_invalidate_at(UINT32* pPtr);
-void DCACHE_invalidate_all(void);
-void DCACHE_invalidate_at(UINT32* pPtr);
-
-#define CALC_BAUD(b) \
- ((UINT32)((float)CPU_FREQ_HZ/(16*b) + 0.5f) - 1);
-
-#define UART0_setbaud(b) \
- *((UINT32*)SYS_UART0_BAUD) = CALC_BAUD(b);
-
-#define UART1_setbaud(b) \
- *((UINT32*)SYS_UART1_BAUD) = CALC_BAUD(b);
-
-#define UART2_setbaud(b) \
- *((UINT32*)SYS_UART2_BAUD) = CALC_BAUD(b);
-
-char readchar(UINT32 port);
-void writechar(UINT32 port, char c);
-int write(int file, char *ptr, int len);
-int sputs(char *pStr);
-void print_byte(char byte);
-void print_word(int word);
-void _exit (int exitcode);
-void sleep(unsigned ms);
-
-char _getchar(void);
-
-void PrintBuffer8(UINT8 *pBuf, int nbpr, int len);
-void memdump(UINT8 *pBuf, int print_offset_only, int num_bytes_per_row, int len);
-
-void Screen_clr(void);
-void Screen_line_clr(void);
-void Screen_csr_set_x(UINT32 coord);
-void Screen_csr_set_y(UINT32 coord);
-UINT32 Screen_get_resx(void);
-UINT32 Screen_get_resy(void);
-UINT32 Screen_get_fps(void);
-
-
-
-#endif // LIBSYS_H
-
diff --git a/lib/CPUs/MIPS/bsp/examples/libsys/.directory_history b/lib/CPUs/MIPS/bsp/examples/libsys/.directory_history
deleted file mode 100644
index f347082..0000000
--- a/lib/CPUs/MIPS/bsp/examples/libsys/.directory_history
+++ /dev/null
@@ -1,70 +0,0 @@
-VHDL/lib/CPUs/MIPS/bsp/examples/dbg.c
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/dbg.c
-VHDL/lib/CPUs/MIPS/bsp/examples/irq.c
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/irq.c
-VHDL/lib/CPUs/MIPS/bsp/examples/irq.h
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/irq.h
-VHDL/lib/CPUs/MIPS/bsp/examples/kernel.S
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/kernel.S
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys.c
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/libsys.c
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys.h
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/libsys.h
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/dbg.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/irq.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/irq.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/kernel.S
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/libsys.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/libsys.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_dis.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_dis.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_gfx.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_gfx.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_xcpt.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/regdef.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/startup.S
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/xcpt.c
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/xcpt.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/xcpt_asm.h
-
-VHDL/lib/CPUs/MIPS/bsp/examples/mips_gfx.c
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_gfx.c
-VHDL/lib/CPUs/MIPS/bsp/examples/mips_gfx.h
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_gfx.h
-VHDL/lib/CPUs/MIPS/bsp/examples/mips_ps2.c
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.c
-VHDL/lib/CPUs/MIPS/bsp/examples/mips_ps2.h
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.h
-VHDL/lib/CPUs/MIPS/bsp/examples/mipsdis.c
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_dis.c
-VHDL/lib/CPUs/MIPS/bsp/examples/mipsdis.h
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/mips_dis.h
-VHDL/lib/CPUs/MIPS/bsp/examples/regdef.h
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/regdef.h
-VHDL/lib/CPUs/MIPS/bsp/examples/startup.S
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/startup.S
-VHDL/lib/CPUs/MIPS/bsp/examples/xcpt.c
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/xcpt.c
-VHDL/lib/CPUs/MIPS/bsp/examples/xcpt.h
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/xcpt.h
-VHDL/lib/CPUs/MIPS/bsp/examples/xcpt_asm.h
-VHDL/lib/CPUs/MIPS/bsp/examples/libsys/xcpt_asm.h
diff --git a/lib/CPUs/MIPS/bsp/examples/libsys/Makefile b/lib/CPUs/MIPS/bsp/examples/libsys/Makefile
deleted file mode 100644
index 376b961..0000000
--- a/lib/CPUs/MIPS/bsp/examples/libsys/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-ENDIAN_FLAGS=-EL
-CFLAGS=$(ENDIAN_FLAGS) -msoft-float -O2 -march=r3000 -I. -Wl,-M
-
-AS=mipsel-elf-as
-AR=mipsel-elf-ar
-CC=mipsel-elf-gcc
-LD=mipsel-elf-ld
-OBJDUMP=mipsel-elf-objdump
-OBJCOPY=mipsel-elf-objcopy
-FLASHGEN=flashgen
-
-SRCS=libsys.c xcpt.c syscalls.c irq.c dbg.c mips_dis.c mips_gfx.c mips_ps2.c
-OBJS=libsys.o xcpt.o syscalls.o irq.o dbg.o mips_dis.o mips_gfx.o mips_ps2.o
-
-all: libsys.a
- $(MAKE) -C eb
-
-%.o : %.c %.h
- $(CC) $(CFLAGS) -G 0 -c $(SRCS)
-
-libsys.a: $(OBJS)
- $(AR) -r libsys.a $(OBJS)
- $(CC) $(CFLAGS) -G 0 -c startup.S
- $(CC) $(CFLAGS) -G 0 -c kernel.S
-
-clean:
- rm -rf *.a *.o *.map *.dis *.elf > /dev/null
- $(MAKE) -C eb clean
-
diff --git a/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.c b/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.c
deleted file mode 100644
index 960c240..0000000
--- a/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.c
+++ /dev/null
@@ -1,268 +0,0 @@
-#include
-#include
-#include
-#include "libsys.h"
-#include "mips_ps2.h"
-
-ps2_if_t ps2_if[2] =
-{
- {ps2_type_unknown, (UINT32*)SYS_PS2_0_STAT, (UINT32*)SYS_PS2_0_DATA},
- {ps2_type_unknown, (UINT32*)SYS_PS2_1_STAT, (UINT32*)SYS_PS2_1_DATA}
-};
-
-UINT32 PS2_get_num_if(void)
-{
- return (sizeof(ps2_if)/sizeof(ps2_if_t));
-}
-
-ps2_if_t *PS2_get_if(UINT32 port)
-{
- if (port < PS2_get_num_if())
- return &ps2_if[port];
-
- return NULL;
-}
-
-void PS2_byte_write(UINT32 port, UINT8 byte)
-{
- ps2_if_t *pIF;
-
- pIF = &ps2_if[port];
-
- while(!(*pIF->pCTRL & SYS_PS2_BIT_TX_EMPTY));
-
- *pIF->pDATA = (UINT32)byte;
-}
-
-UINT32 PS2_byte_read(UINT32 port, UINT32 timeout_ms)
-{
- ps2_if_t *pIF;
-
- pIF = &ps2_if[port];
-
- while(!(*pIF->pCTRL & SYS_PS2_BIT_RX_AVAIL))
- {
- timeout_ms--;
- if (!timeout_ms)
- return PS2_ERR_TIMEOUT;
-
- sleep(1);
- }
- return (UINT32)*pIF->pDATA;
-}
-
-UINT32 PS2_cmd(UINT32 port, UINT8 cmd, UINT32 ack_timeout_ms)
-{
- UINT32 result;
-
- PS2_byte_write(port, cmd);
- result = PS2_byte_read(port, ack_timeout_ms);
- if (0xFA != result)
- {
- printf ("PS2_cmd(%d): no ACK received. Result = %08X\n", port, result);
- return PS2_ERR_PS2_PREFIX | result;
- }
- return 0;
-}
-
-void PS2_flush(UINT32 port)
-{
- while (!IS_ERROR(PS2_byte_read(port, 10)));
-}
-
-UINT32 PS2_init(UINT32 port)
-{
- int i;
- ps2_if_t *pIF;
- UINT8 id[2];
-
- pIF = &ps2_if[port];
- pIF->type = ps2_type_unknown;
-
- UINT32 result;
-
- // Disable RX-interrupt
- *pIF->pCTRL &= ~SYS_PS2_BIT_RX_INTEN;
-
- printf ("PS2_init(%d) - Initialize... ", port);
-
- // Flush buffer
- PS2_flush(port);
-
- // send RESET
- result = PS2_cmd(port, 0xFF, 1000);
- if (IS_ERROR(result))
- {
- printf ("Reset error %08X\n", result);
- return result;
- }
-
- // Read BAT
- result = PS2_byte_read(port, 1000);
- if (0xAA != result)
- {
- printf ("BAT error %08X\n", result);
- return result;
- }
-
- printf ("Success\n");
-
- while(1)
- {
- // Read ID
- result = PS2_byte_read(port, 10);
- if (IS_ERROR(result))
- {
- // No ID => keyboard
- printf ("PS2_init(%d) - Keyboard detected\n", port);
-
- // send Get Device-ID
- result = PS2_cmd(port, 0xF2, 1000);
- if (IS_ERROR(result))
- {
- printf ("Get Device-ID error %08X\n", result);
- break;
- }
- id[0] = PS2_byte_read(port, 1000);
- id[1] = PS2_byte_read(port, 1000);
- printf ("PS2_init(%d) - Device-ID: %02X%02X\n", port, id[0], id[1]);
-
- // Get Scan code set (phase 1)
- result = PS2_cmd(port, 0xF0, 1000);
- if (IS_ERROR(result))
- {
- printf ("1. Get Scan code error %08X\n", result);
- break;
- }
- // Get Scan code set (phase 2)
- result = PS2_cmd(port, 0x00, 1000);
- if (IS_ERROR(result))
- {
- printf ("2. Get Scan code error %08X\n", result);
- break;
- }
- result = PS2_byte_read(port, 1000);
- printf ("PS2_init(%d) - Current scan code set = %d\n", port, result);
-
- // if Scan code SET != 2
- if (result != 2)
- {
- printf ("PS2_init(%d) - Set scan code set = 2\n", port);
- // Set Scan code set (phase 1)
- result = PS2_cmd(port, 0xF0, 1000);
- if (IS_ERROR(result))
- {
- printf ("1. Set Scan code error %08X\n", result);
- break;
- }
- // Set Scan code set (phase 2)
- result = PS2_cmd(port, 0x02, 1000);
- if (IS_ERROR(result))
- {
- printf ("2. Set Scan code error %08X\n", result);
- break;
- }
- }
-
- // Test LEDs
- for (i=0; i < 4; i++)
- {
- result = PS2_cmd(port, 0xED, 1000);
- if (IS_ERROR(result))
- {
- printf ("1. LED error %08X\n", result);
- break;
- }
- result = PS2_cmd(port, 0x02, 1000);
- if (IS_ERROR(result))
- {
- printf ("2. LED error %08X\n", result);
- break;
- }
- sleep(100);
- result = PS2_cmd(port, 0xED, 1000);
- if (IS_ERROR(result))
- {
- printf ("1. LED error %08X\n", result);
- break;
- }
- result = PS2_cmd(port, 0x04, 1000);
- if (IS_ERROR(result))
- {
- printf ("2. LED error %08X\n", result);
- break;
- }
- sleep(100);
- result = PS2_cmd(port, 0xED, 1000);
- if (IS_ERROR(result))
- {
- printf ("1. LED error %08X\n", result);
- break;
- }
- result = PS2_cmd(port, 0x01, 1000);
- if (IS_ERROR(result))
- {
- printf ("2. LED error %08X\n", result);
- break;
- }
- sleep(100);
- }
- result = PS2_cmd(port, 0xED, 1000);
- if (IS_ERROR(result))
- {
- printf ("1. LED error %08X\n", result);
- break;
- }
- result = PS2_cmd(port, 0x00, 1000);
- if (IS_ERROR(result))
- {
- printf ("2. LED error %08X\n", result);
- break;
- }
-
- pIF->type = ps2_type_keyb;
- result = pIF->type;
- break;
- }
-
- // We got a byte => maybe mouse
- if (result == 0)
- {
- // We got zero => yes, it's a mouse
- printf ("PS2_init(%d) - Mouse device detected\n", port);
-
- // send Get Device-ID
- result = PS2_cmd(port, 0xF2, 1000);
- if (IS_ERROR(result))
- {
- printf ("Get Device-ID error %08X\n", result);
- break;
- }
- id[0] = PS2_byte_read(port, 1000);
- printf ("PS2_init(%d) - Device-ID: %02X\n", port, id[0]);
- printf ("PS2_init(%d) - Enable stream mode...", port);
- result = PS2_cmd(port, 0xF4, 1000);
- if (IS_ERROR(result))
- {
- printf ("error %08X\n", result);
- break;
- }
- printf ("Success\n");
- pIF->type = ps2_type_mouse;
- result = pIF->type;
- break;
- }
- }
-
- // Flush buffer
- PS2_flush(port);
-
- if (IS_ERROR(result))
- return result;
-
- // Enable RX-interrupt
- *pIF->pCTRL |= SYS_PS2_BIT_RX_INTEN;
-
- return result;
-
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.h b/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.h
deleted file mode 100644
index 9bfee72..0000000
--- a/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef PS2_H
-#define PS2_H
-
-#include "libsys.h"
-
-// --------------------------------------------------
-// Types
-// --------------------------------------------------
-enum
-{
- ps2_type_unknown = 0,
- ps2_type_keyb,
- ps2_type_mouse
-};
-
-typedef struct _sps2_if_t
-{
- UINT32 type;
- volatile UINT32 *pCTRL;
- volatile UINT32 *pDATA;
-} ps2_if_t;
-
-// --------------------------------------------------
-// Constants
-// --------------------------------------------------
-#define PS2_MODULE_PREFIX 0x1000000
-#define PS2_SUCCESS LSYS_SUCCESS
-#define PS2_ERROR (LSYS_ERR_BASE | PS2_MODULE_PREFIX)
-#define PS2_ERR_TIMEOUT (PS2_ERROR | 0x0000001)
-#define PS2_ERR_PS2_PREFIX (PS2_ERROR | 0x0010000)
-
-// --------------------------------------------------
-// Functions
-// --------------------------------------------------
-UINT32 PS2_get_num_if(void);
-ps2_if_t *PS2_get_if(UINT32 port);
-UINT32 PS2_init(UINT32 port);
-void PS2_byte_write(UINT32 port, UINT8 byte);
-UINT32 PS2_byte_read(UINT32 port, UINT32 timeout_ms);
-UINT32 PS2_cmd(UINT32 port, UINT8 cmd, UINT32 ack_timeout_ms);
-void PS2_flush(UINT32 port);
-
-#endif // PS2_H
diff --git a/lib/CPUs/MIPS/bsp/examples/libsys/syscalls.c b/lib/CPUs/MIPS/bsp/examples/libsys/syscalls.c
deleted file mode 100644
index 040372b..0000000
--- a/lib/CPUs/MIPS/bsp/examples/libsys/syscalls.c
+++ /dev/null
@@ -1,86 +0,0 @@
-#include
-#include "libsys.h"
-#include "xcpt.h"
-
-/* 10 digits + 1 sign + 1 trailing nul */
-static char itoa_buf[12];
-
-char *itoa(int i)
-{
- char *pos = itoa_buf + sizeof(itoa_buf) - 1;
- unsigned int u;
- int negative = 0;
-
- if (i < 0)
- {
- negative = 1;
- u = ((unsigned int)(-(1+i))) + 1;
- }
- else
- {
- u = i;
- }
-
- *pos = 0;
-
- do
- {
- *--pos = '0' + (u % 10);
- u /= 10;
- } while (u);
-
- if (negative)
- {
- *--pos = '-';
- }
-
- return pos;
-}
-
-int syscalls_handler(struct xcptcontext * xcp)
-{
- int syscall_code;
- char *pStr, buf[33];
-
- syscall_code = xcp->regs[2];
-
- switch(syscall_code)
- {
- case 1: // print integer
- sputs(itoa(xcp->regs[4]));
- break;
-
- case 4: // print string
- pStr = (char*)xcp->regs[4];
- sputs(pStr);
- break;
-
- case 5: // read integer
- pStr = fgets(buf, sizeof(buf), stdin);
- xcp->regs[2] = atoi(pStr);
- break;
-
- case 8: // read string
- pStr = (char*)xcp->regs[4];
- fgets(pStr, xcp->regs[5], stdin);
- break;
-
- case 10: // exit
- _exit(0);
- break;
-
- default:
- sputs("\nUnknown syscall (");print_word(syscall_code);sputs(") at ");print_word(xcp->epc);sputs("\n");
- break;
- }
-
- xcp->epc += 4; // set return address to instruction after syscall
-
- return 0;
-}
-
-void syscalls_init(void)
-{
- xcpt_register(Syscall, syscalls_handler);
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/life.c b/lib/CPUs/MIPS/bsp/examples/life.c
deleted file mode 100644
index bba5a0e..0000000
--- a/lib/CPUs/MIPS/bsp/examples/life.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/* life.c - demonstrator for later Mips+LCD game of life
- *
- * 23.03.06 - MACRO-based version
- * 22.02.06 - new file
- */
-
-//#include "ks0108.h"
-
-#include
-#include
-#include
-#include "libsys.h"
-
-
-#define NX 200 // 70 // 128 // 48 // 128
-#define NY 150 // 31 // 64 // 27 // 64
-
-#define SCREEN_X 800
-#define SCREEN_Y 600
-
-#define SCALE_X (4)
-#define SCALE_Y (4)
-#define OFFSET_X ((SCREEN_X-(SCALE_X*NX))/2)
-#define OFFSET_Y ((SCREEN_Y-(SCALE_Y*NY))/2)
-
-// OCCUPIED must be uneven, EMPTY even.
-#define OCCUPIED 0x77771111
-#define EMPTY 0xeeee0000
-
-#define MATRIX( row, col ) (*(matrix + (NX*col) + row ))
-#define FUTURE( row, col ) (*(future + (NX*col) + row ))
-
-UINT32 *g_gx_buff;
-
-int clock_lfsr32()
-{
- return rand();
-}
-
-
-/* return a pseudo-random integer in the range 0..1023 */
-int random1023() {
- int tmp;
-
- tmp = clock_lfsr32();
- return tmp & 0x000003ff;
-}
-
-typedef struct _scolor_t
-{
- UINT8 r, g, b, a;
-} __attribute__ ((__packed__)) color_t;
-
-
-void DrawPixel(UINT32 x, UINT32 y, color_t *pColor)
-{
- int i, j;
- for (i=0; i < SCALE_Y; i++)
- for (j=0; j < SCALE_X; j++)
- g_gx_buff[(OFFSET_X+SCALE_X*x+j) + SCREEN_X*(OFFSET_Y+SCALE_Y*y+i)] = *((UINT32*)pColor);
-}
-
-
-/* MSB/LSB in y-Richtung vertauscht */
-void displayBoard1( int* matrix )
-{
- int x, y;
- int mask, accu;
- UINT32 color;
-
- for( x=0; x < NX; x++ )
- {
- mask = 0x80;
- accu = 0x00;
- for( y=0; y < NY; y++ )
- {
- color = (UINT32)-(MATRIX(x,y) & 0x1);
- DrawPixel(x, y, (color_t*)&color);
-// if (MATRIX( x, y ) != OCCUPIED)
-// {
-// accu |= mask;
-// }
-// mask = mask >> 1;
-
-// color = 0;
-// DrawPixel(x, (y>>3), (color_t*)&color);
-// if (mask == 0)
-// {
-// color = accu;
-// DrawPixel(x, (y>>3), (color_t*)&color);
-// mask = 0x80;
-// accu = 0x00;
-// }
- }
-// color = accu;
-// DrawPixel(x, (y>>3), (color_t*)&color);
-
- }
-// *(matrix-15) = 0xdead0000;
-// *(matrix-16) = *(matrix-16) + 1;
-}
-
-void initializeBoard( int* matrix ) {
- int x, y;
- for( x=0; x < NX; x++ ) {
- for( y=0; y < NY; y++ ) {
- int d = random1023();
- if (d > 920) MATRIX( x, y ) = OCCUPIED;
- else MATRIX( x, y ) = EMPTY;
- }
- }
-}
-
-
-int countNeighbors( int* matrix, int i, int j ) {
- int im = i-1;
- int ip = i+1;
-
- int jm = j-1;
- int jp = j+1;
-
- int n = 0;
- // wrap-around
- if (ip >= NX) ip = 0;
- if (jp >= NY) jp = 0;
-
- if (im < 0) im = NX-1;
- if (jm < 0) jm = NY-1;
-
- // check eight neighbors
- n += MATRIX(im, jm ) & 0x1; // nw
- n += MATRIX(im, j ) & 0x1; // west
- n += MATRIX(im, jp ) & 0x1; // sw
-
- n += MATRIX(i, jm ) & 0x1; // north
- // n += MATRIX(i, j ) & 0x1; // center
- n += MATRIX(i, jp ) & 0x1; // south
-
- n += MATRIX(ip, jm ) & 0x1; // ne
- n += MATRIX(ip, j ) & 0x1; // east
- n += MATRIX(ip, jp ) & 0x1; // se
-
- return n;
-}
-
-
-/**
- * the actual game of life algorithm: cell is born when three neighbors,
- * survives when exactly two live neighbors, dies otherwise.
- */
-void nextGeneration( int* matrix, int* future ) {
- int i, j;
- int lifes = 0;
-
- for( i=0; i < NX; i++ ) {
- for( j=0; j < NY; j++ ) {
- // count neighbors
- int n = countNeighbors( matrix, i, j );
-
- //if ((n != 0) && (random1023() > 990)) { // some slight random offset
- // if (random1023() > 500) FUTURE(i,j) = OCCUPIED;
- // else FUTURE(i,j) = EMPTY;
- //}
- // else if (n == 3) FUTURE(i,j) = OCCUPIED;
-
- if (n == 3) FUTURE(i,j) = OCCUPIED;
- else if ((n == 2) && (MATRIX(i,j) == OCCUPIED)) FUTURE(i,j) = OCCUPIED;
- else FUTURE(i,j) = EMPTY;
-
- if (FUTURE(i,j) == OCCUPIED) lifes++;
- }
- }
- // generation ++;
-
- // avoid extinction :-)
- if (lifes < 10) {
- // printf( "CREATING A NEW POPULATION\n\n\n" );
- initializeBoard( matrix );
- }
- else { // swap buffers: C PROHIBITS ASSIGNING TO ARRAY TYPES
- for( i=0; i < NX; i++ ) {
- for( j=0; j < NY; j++ ) {
- MATRIX(i,j) = FUTURE(i,j);
- }
- }
- }
-}
-
-void gx_init(void)
-{
- volatile UINT32 *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
- volatile UINT32 *pVGA_front = (UINT32*)SYS_VGA_FB_FRONT;
- volatile UINT32 *pVGA_back = (UINT32*)SYS_VGA_FB_BACK;
-
- sleep(500);
-
- g_gx_buff = (UINT32*)malloc(SCREEN_X*SCREEN_Y*sizeof(UINT32));
- memset(g_gx_buff, 0, SCREEN_X*SCREEN_Y*sizeof(UINT32));
- printf("g_gx_buff : %8.8X\n", (UINT32)g_gx_buff);
-
- *pVGA_ctrl |= SYS_VGA_BIT_MSTEN;
- *pVGA_front = (UINT32)g_gx_buff;
- *pVGA_back = (UINT32)g_gx_buff;
-
-}
-
-int main( int argc, char* argv[] ) {
-
- int* ptr, cnt = 0;
-
- int* matrix;
- int* future;
- volatile UINT32 *pBtn = (UINT32*)SYS_GPIO0;
-
- // lcdEnableDisplay( 1 );
- // lcdSetColor( 1 );
- // lcdSetPixel( 0, 0 );
- // lcdSetPixel( 3, 5 );
-
- // if we have stdlib:
- matrix = (void*) malloc( NX*NY*sizeof(int) );
- future = (void*) malloc( NX*NY*sizeof(int) );
-
-
- gx_init();
-
-// matrix = (void *) 0x00004000;
-// future = (void *) 0x00014000;
-
- // init_lfsr32( 0xcafebabe );
- // init_lfsr32( 0x13 );
-
- srand(clock());
- initializeBoard( matrix );
-
- while( 1 )
- {
-
- if (*pBtn)
- {
- srand(clock());
- initializeBoard( matrix );
- cnt = 0;
- }
- sputs("Generation #"); print_word(cnt++); sputs("\n");
- displayBoard1( matrix );
- nextGeneration( matrix, future );
- }
-
- // return 0
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/link/link.ld b/lib/CPUs/MIPS/bsp/examples/link/link.ld
deleted file mode 100644
index bf3b367..0000000
--- a/lib/CPUs/MIPS/bsp/examples/link/link.ld
+++ /dev/null
@@ -1,225 +0,0 @@
-/* Script for -z combreloc: combine and sort reloc sections */
-OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
- "elf32-littlemips")
-OUTPUT_ARCH(mips)
-ENTRY(_start)
-SEARCH_DIR("./libsys");
-SEARCH_DIR("/usr/local/mipsel-elf/lib:/usr/local/mipsel-elf/lib/eb");
-SEARCH_DIR("/usr/local/lib/gcc/mipsel-elf/4.3.3:/usr/local/lib/gcc/mipsel-elf/4.3.3/eb");
-
-stack_ptr = 0x7FFFEFF0;
-baudrate = 0x0D;
-sys_led_port = 0xA0000000;
-sys_uart_data = 0xA0010000;
-sys_uart_stat = 0xA0010004;
-sys_uart_baud = 0xA0010008;
-sys_timer_usec = 0xA000008;
-sys_timer_sec = 0xA000000C;
-
-STARTUP(startup.o)
-INPUT(kernel.o)
-
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- PROVIDE (__executable_start = 0x40000000); . = 0x40000000;
- .start __executable_start :
- {
- start = ALIGN(2);
- entry = ALIGN(2);
- _entry = ALIGN(2);
- __entry = ALIGN(2);
- *(.start)
- }
- /* Kernel text with low-level exception handler */
- .exc_vector __executable_start + 0x080 :
- {
- _exc_vect_start = .;
- *(.exc_vect)
- _exc_vect_end = .;
- }
- .init :
- {
- KEEP (*(.init))
- } =0
- .plt : { *(.plt) }
- .text :
- {
- _ftext = . ;
- *(.text .stub .text.* .gnu.linkonce.t.*)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(.mips16.fn.*) *(.mips16.call.*)
- } =0
- .fini :
- {
- KEEP (*(.fini))
- } =0
- PROVIDE (__etext = .);
- PROVIDE (_etext = .);
- PROVIDE (etext = .);
- .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
- .rodata1 : { *(.rodata1) }
- .sdata2 :
- {
- *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
- }
- .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
- .eh_frame_hdr : { *(.eh_frame_hdr) }
- .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
- . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
- /* Exception handling */
- .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
- /* Thread Local Storage sections */
- .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
- .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
- .preinit_array :
- {
- PROVIDE_HIDDEN (__preinit_array_start = .);
- KEEP (*(.preinit_array))
- PROVIDE_HIDDEN (__preinit_array_end = .);
- }
- .init_array :
- {
- PROVIDE_HIDDEN (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- PROVIDE_HIDDEN (__init_array_end = .);
- }
- .fini_array :
- {
- PROVIDE_HIDDEN (__fini_array_start = .);
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- PROVIDE_HIDDEN (__fini_array_end = .);
- }
- .ctors :
- {
- /* gcc uses crtbegin.o to find the start of
- the constructors, so we make sure it is
- first. Because this is a wildcard, it
- doesn't matter if the user does not
- actually link against crtbegin.o; the
- linker won't look for a file to match a
- wildcard. The wildcard also means that it
- doesn't matter which directory crtbegin.o
- is in. */
- KEEP (*crtbegin.o(.ctors))
- KEEP (*crtbegin?.o(.ctors))
- /* We don't want to include the .ctor section from
- the crtend.o file until after the sorted ctors.
- The .ctor section from the crtend file contains the
- end of ctors marker and it must be last */
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors))
- }
- .dtors :
- {
- KEEP (*crtbegin.o(.dtors))
- KEEP (*crtbegin?.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors))
- }
- .jcr : { KEEP (*(.jcr)) }
- .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
- . = DATA_SEGMENT_RELRO_END (0, .);
- .data :
- {
- _fdata = . ;
- *(.data .data.* .gnu.linkonce.d.*)
- SORT(CONSTRUCTORS)
- }
- .data1 : { *(.data1) }
- .got.plt : { *(.got.plt) }
- . = .;
- _gp = ALIGN(16) + 0x7ff0;
- .got : { *(.got) }
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
- .sdata :
- {
- *(.sdata .sdata.* .gnu.linkonce.s.*)
- }
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
- _edata = .; PROVIDE (edata = .);
- __bss_start = .;
- _fbss = .;
- .sbss :
- {
- *(.dynsbss)
- *(.sbss .sbss.* .gnu.linkonce.sb.*)
- *(.scommon)
- }
- .bss :
- {
- *(.dynbss)
- *(.bss .bss.* .gnu.linkonce.b.*)
- *(COMMON)
- /* Align here to ensure that the .bss section occupies space up to
- _end. Align after .bss to ensure correct alignment even if the
- .bss section disappears because there are no input sections.
- FIXME: Why do we need it? When there is no .bss section, we don't
- pad the .data section. */
- . = ALIGN(. != 0 ? 32 / 8 : 1);
- }
- . = ALIGN(32 / 8);
- . = ALIGN(32 / 8);
- _end = .; PROVIDE (end = .);
- . = DATA_SEGMENT_END (.);
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
- /* DWARF 3 */
- .debug_pubtypes 0 : { *(.debug_pubtypes) }
- .debug_ranges 0 : { *(.debug_ranges) }
- .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
- .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
- .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
- .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
- .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
- .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
- .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
- .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
- .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
- .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
- .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
- /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/lua_init.c b/lib/CPUs/MIPS/bsp/examples/lua_init.c
deleted file mode 100644
index 0edd3d5..0000000
--- a/lib/CPUs/MIPS/bsp/examples/lua_init.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "all.c"
diff --git a/lib/CPUs/MIPS/bsp/examples/lwl.c b/lib/CPUs/MIPS/bsp/examples/lwl.c
deleted file mode 100644
index 3905cf0..0000000
--- a/lib/CPUs/MIPS/bsp/examples/lwl.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "libsys.h"
-
-int non_aligned_load(UINT32* pMem)
-{
- UINT32 result;
- __asm__
- (
- "li $t0, 0x01234567\n"
- "li $t1, 0x89ABCDEF\n"
- "sw $t0, 0(%[pMem])\n"
- "sw $t1, 64(%[pMem])\n"
- "lw %[val], 0(%[pMem])\n"
- "lw %[val], 64(%[pMem])\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "li %[val], 0x55555555\n"
- "lw %[val], 0(%[pMem])\n"
- "lwl %[val], 65(%[pMem])\n"
- : [val] "=r" (result)
- : [pMem] "r" (pMem)
- );
- return result;
-}
-
-int main()
-{
- int buf[256], res, i;
-
- res = non_aligned_load(buf);
-
- return res;
-
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/mandelbrot.c b/lib/CPUs/MIPS/bsp/examples/mandelbrot.c
deleted file mode 100644
index ce7aa9d..0000000
--- a/lib/CPUs/MIPS/bsp/examples/mandelbrot.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// by Erik Wrenholt
-#include
-#include
-
-#define BAILOUT 16
-#define MAX_ITERATIONS 1000
-
-int mandelbrot(double x, double y)
-{
- double cr = y - 0.5;
- double ci = x;
- double zi = 0.0;
- double zr = 0.0;
- int i = 0;
-
- while(1) {
- i ++;
- double temp = zr * zi;
- double zr2 = zr * zr;
- double zi2 = zi * zi;
- zr = zr2 - zi2 + cr;
- zi = temp + temp + ci;
- if (zi2 + zr2 > BAILOUT)
- return i;
- if (i > MAX_ITERATIONS)
- return 0;
- }
-
-}
-
-int main (int argc, const char * argv[]) {
- struct timeval aTv;
- gettimeofday(&aTv, NULL);
- long init_time = aTv.tv_sec;
- long init_usec = aTv.tv_usec;
-
- int x,y;
- for (y = -39; y < 39; y++) {
- printf("\n");
- for (x = -39; x < 39; x++) {
- int i = mandelbrot(x/40.0, y/40.0);
- if (i==0)
- printf("*");
- else
- printf(" ");
- }
- }
- printf ("\n");
-
- gettimeofday(&aTv,NULL);
- double query_time = (aTv.tv_sec - init_time) + (double)(aTv.tv_usec - init_usec)/1000000.0;
- printf ("C Elapsed %0.2f\n", query_time);
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/mips_gfx.c b/lib/CPUs/MIPS/bsp/examples/mips_gfx.c
deleted file mode 100644
index ee06438..0000000
--- a/lib/CPUs/MIPS/bsp/examples/mips_gfx.c
+++ /dev/null
@@ -1,566 +0,0 @@
-#include
-#include
-#include
-#include "libsys.h"
-#include "mips_gfx.h"
-
-#define USE_HW_BLITTER
-
-// -------------------------------------------------------------
-// Functions
-// -------------------------------------------------------------
-void __gfx_block_set_8(UINT32* pDst, UINT32 value)
-{
- __asm__ volatile
- (
- "sw %[value], 0(%[pDst])\n"
- "sw %[value], 4(%[pDst])\n"
- "sw %[value], 8(%[pDst])\n"
- "sw %[value], 12(%[pDst])\n"
- "sw %[value], 16(%[pDst])\n"
- "sw %[value], 20(%[pDst])\n"
- "sw %[value], 24(%[pDst])\n"
- "sw %[value], 28(%[pDst])\n"
- :
- : [pDst] "r" (pDst), [value] "r" (value)
- );
-}
-
-void __gfx_block_copy_8(UINT32* pDst, UINT32* pSrc)
-{
- __asm__ volatile
- (
- ".set noreorder\n"
- ".set nomacro\n"
- "lw $s0, 0(%[pSrc])\n"
- "lw $s1, 4(%[pSrc])\n"
- "sw $s0, 0(%[pDst])\n"
- "lw $s0, 8(%[pSrc])\n"
- "sw $s1, 4(%[pDst])\n"
- "lw $s1, 12(%[pSrc])\n"
- "sw $s0, 8(%[pDst])\n"
- "lw $s0, 16(%[pSrc])\n"
- "sw $s1, 12(%[pDst])\n"
- "lw $s1, 20(%[pSrc])\n"
- "sw $s0, 16(%[pDst])\n"
- "lw $s0, 24(%[pSrc])\n"
- "sw $s1, 20(%[pDst])\n"
- "lw $s1, 28(%[pSrc])\n"
- "sw $s0, 24(%[pDst])\n"
- "sw $s1, 28(%[pDst])\n"
- ".set macro\n"
- ".set reorder\n"
- :
- : [pDst] "r" (pDst), [pSrc] "r" (pSrc)
- : "s0", "s1"
- );
-}
-
-void __gfx_copy_32(UINT32* pDst, UINT32* pSrc, UINT32 nblocks)
-{
- while (nblocks)
- {
- __gfx_block_copy_8(pDst, pSrc);
- pDst += 8;
- pSrc += 8;
- nblocks--;
- }
-
-}
-
-void GFX_DirtyRectSetClean(buf_t *pBuf)
-{
- pBuf->rect.xmin = pBuf->w;
- pBuf->rect.xmax = 0;
- pBuf->rect.ymin = pBuf->h;
- pBuf->rect.ymax = 0;
- pBuf->is_dirty = 0;
-}
-
-void GFX_DirtyRectInit(buf_t *pBuf, UINT32 w, UINT32 h)
-{
- pBuf->w = w;
- pBuf->h = h;
- pBuf->regs = (vga_hw_t*)SYS_VGA_CTRL;
- GFX_DirtyRectSetClean(pBuf);
-}
-
-void GFX_DirtyRectUpdate(buf_t *pBuf, UINT32 xmin, UINT32 xmax, UINT32 ymin, UINT32 ymax)
-{
-
- if (xmin < pBuf->rect.xmin)
- {
- pBuf->is_dirty = 1;
- pBuf->rect.xmin = xmin;
- }
-
- if (xmax > pBuf->rect.xmax)
- {
- pBuf->is_dirty = 1;
- pBuf->rect.xmax = xmax;
- }
-
- if (ymin < pBuf->rect.ymin)
- {
- pBuf->is_dirty = 1;
- pBuf->rect.ymin = ymin;
- }
-
- if (ymax > pBuf->rect.ymax)
- {
- pBuf->is_dirty = 1;
- pBuf->rect.ymax = ymax;
- }
-
- if (pBuf->is_dirty && ((pBuf->rect.xmax-pBuf->rect.xmin)%8))
- pBuf->rect.xmax = pBuf->rect.xmin + ((pBuf->rect.xmax-pBuf->rect.xmin)/8 + 1) * 8; // Make len_x multiple of 8
-
-}
-
-void GFX_DirtyRectCopy(buf_t *pBuf)
-{
- UINT32 xmin, xmax, ymin, ymax, x, y;
- UINT32 *pDst, *pDst_end;
- UINT32 *pSrc, *pSrc_end;
-
- xmin = pBuf->rect.xmin;
- xmax = pBuf->rect.xmax;
-
- ymin = pBuf->rect.ymin;
- ymax = pBuf->rect.ymax;
-
- ymin *= pBuf->w;
- ymax *= pBuf->w;
-
-#ifdef USE_HW_BLITTER
- pSrc = (UINT32*)&pBuf->pLast->pFB[xmin + ymin];
- pDst = (UINT32*)&pBuf->pFB[xmin + ymin];
-
- while (pBuf->regs->pVGA_ctrl & SYS_VGA_BIT_BLIT_BSY);
-
- pBuf->regs->pVGA_src0 = (UINT32)pSrc;
- pBuf->regs->pVGA_dst = (UINT32)pDst;
- pBuf->regs->pVGA_src0_dimx = (UINT32)4*pBuf->w;
- pBuf->regs->pVGA_dst_dimx = (UINT32)4*pBuf->w;
- pBuf->regs->pVGA_nx = (UINT32)(pBuf->rect.xmax-pBuf->rect.xmin);
- pBuf->regs->pVGA_ny = (UINT32)(pBuf->rect.ymax-pBuf->rect.ymin);
- pBuf->regs->pVGA_ctrl |= SYS_VGA_BIT_BLIT_REQ;
-
-#else
-
- if (!((xmax-xmin)%8))
- {
- for (y=ymin; y < ymax; y += pBuf->w)
- {
- pSrc = &pBuf->pLast->pFB[xmin + y];
- pSrc_end = &pBuf->pLast->pFB[xmax + y];
- pDst = &pBuf->pFB[xmin + y];
- pDst_end = &pBuf->pFB[xmax + y];
- while(pDst < pDst_end)
- {
- __gfx_block_copy_8(pDst, pSrc);
- pDst += 8;
- pSrc += 8;
- }
- }
- return;
- }
-
-// fprintf(stderr, "GFX_DirtyRectCopy(): Slow copy!\n");
- for (y=ymin; y < ymax; y += pBuf->w)
- {
- for (x=xmin; x < xmax; x++)
- {
- pBuf->pFB[x + y] = pBuf->pLast->pFB[x + y];
- }
- }
-#endif
-
-}
-
-void GFX_init(gfx_t *pObj)
-{
- int i;
- buf_t *pBuf;
- UINT32 w, h, fps;
-
- pObj->regs = (vga_hw_t*)SYS_VGA_CTRL;
-
- pObj->regs->pVGA_ctrl &= ~SYS_VGA_BIT_MSTEN;
-
- w = Screen_get_resx();
- h = Screen_get_resy();
- fps = Screen_get_fps();
-
- printf("VGA screen = %d x %d @ %d fps\n", w, h, fps);
-
- pObj->w = w;
- pObj->h = h;
-
- // Init background buffer
- pObj->pBG = (UINT32*)calloc(w * h, sizeof(buf_t));
-
- // Init framebuffers
- pObj->pBuf = (buf_t*)calloc(1, sizeof(buf_t));
- pBuf = pObj->pBuf;
- pBuf->pFB = (UINT32*)calloc((w+8) * h, sizeof(UINT32)); // w+8 because of dirty rectangle 8 byte min. x-size
- for (i=1; i < GFX_NUM_FRAME_BUFFERS; i++)
- {
-
- pBuf->pNext = (buf_t*)calloc(1, sizeof(buf_t));
- pBuf->pNext->pLast = pBuf;
- pBuf = pBuf->pNext;
- pBuf->pFB = (UINT32*)calloc((w+8) * h, sizeof(UINT32)); // w+8 because of dirty rectangle 8 byte min. x-size
- }
- pObj->pBuf->pLast = pBuf;
- pBuf->pNext = pObj->pBuf;
-
- pBuf = pObj->pBuf;
- for (i=0; i < GFX_NUM_FRAME_BUFFERS; i++)
- {
- GFX_DirtyRectInit(pBuf, w, h);
-
-// fprintf(stderr, "pBuf = %08X, pLast = %08X, pNext = %08X\n", pBuf, pBuf->pLast, pBuf->pNext);
- pBuf = pBuf->pNext;
- }
-
- pObj->regs->pVGA_front = (UINT32)pObj->pBuf->pLast->pFB;
- pObj->regs->pVGA_back = (UINT32)pObj->pBuf->pLast->pFB;
- pObj->regs->pVGA_ctrl |= SYS_VGA_BIT_MSTEN;
-
-
-}
-
-void GFX_set_background(gfx_t *pObj, UINT32 *pImage, UINT32 image_nx, UINT32 image_ny, UINT32 image_scale_x, UINT32 image_scale_y)
-{
-
- UINT32 off_x, off_y;
- UINT32 i, j;
- UINT32 *pDst, *pSrc;
- buf_t *pBuf;
-
- if (!pImage)
- return;
-
- off_x = (pObj->w-(image_scale_x*image_nx))/2;
- off_y = (pObj->h-(image_scale_y*image_ny))/2;
-
- pDst = ((UINT32*)pObj->pBG) + pObj->w*off_y + off_x;
- pSrc = pImage;
-
- for (i=0; i < image_ny*image_nx; i += 8)
- {
- __gfx_block_copy_8(pDst, pSrc);
- pDst += 8;
- pSrc += 8;
- }
-
- pBuf = pObj->pBuf;
-
- pDst = pBuf->pFB;
- pSrc = pObj->pBG;
-
- for (i=0; i < image_ny*image_nx; i += 8)
- {
- __gfx_block_copy_8(pDst, pSrc);
- pDst += 8;
- pSrc += 8;
- }
-
- do
- {
- GFX_DirtyRectUpdate(pBuf, 0, pObj->w, 0, pObj->h);
- pBuf = pBuf->pNext;
-
- } while(pBuf != pObj->pBuf);
-
-
-}
-
-void GFX_frame(gfx_t *pObj, UINT32 sync_mode)
-{
-
- // Wait until back buffer becomes front
- if (sync_mode == GFX_FRAME_SYNC)
- {
- while(pObj->regs->pVGA_front == (UINT32)pObj->pBuf->pFB);
- }
-
- GFX_copy_front2back(pObj);
-
- // Invalidate D-Cache after blitting has finished
- while (pObj->regs->pVGA_ctrl & SYS_VGA_BIT_BLIT_BSY);
-
- DCACHE_invalidate_all();
-
-}
-
-void GFX_show(gfx_t *pObj)
-{
-
- pObj->regs->pVGA_back = (UINT32)pObj->pBuf->pFB;
- pObj->pBuf = pObj->pBuf->pNext;
-
-}
-
-void GFX_copy_front2back(gfx_t *pObj)
-{
- buf_t *pBuf;
-
- pBuf = pObj->pBuf;
-
- // Lopp over all frame buffers, except front buffer
- while(pBuf != pObj->pBuf->pLast)
- {
- if (pBuf->is_dirty)
- {
-// fprintf(stderr, "Dirty rect [%08X]: w=%d, h=%d\n", (int)pBuf, pBuf->rect.xmax - pBuf->rect.xmin, pBuf->rect.ymax - pBuf->rect.ymin);
- GFX_DirtyRectCopy(pBuf);
- GFX_DirtyRectSetClean(pBuf);
- }
- pBuf = pBuf->pNext;
- }
-}
-
-void GFX_get_FB_front(gfx_t *pObj, UINT32 **ppFB)
-{
- *ppFB = pObj->pBuf->pLast->pFB;
-}
-
-void box_create(box_t *pObj, UINT32 w, UINT32 h)
-{
- pObj->w = w;
- pObj->h = h;
-}
-
-void GFX_restore(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy)
-{
- UINT32 xmin, xmax, ymin, ymax, x, y;
- UINT32 *pDst, *pDst_end;
- UINT32 *pSrc, *pSrc_end;
- buf_t *pBuf;
-
- xmin = posx;
- xmax = pBox->w + posx;
- if (xmax > pObj->w)
- xmax = pObj->w;
-
- ymin = posy;
- ymax = pBox->h + posy;
- if (ymax > pObj->h)
- ymax = pObj->h;
-
- pBuf = pObj->pBuf->pNext;
-
- // Lopp over all frame buffers, except current back buffer
- while(pBuf != pObj->pBuf)
- {
- GFX_DirtyRectUpdate(pBuf, xmin, xmax, ymin, ymax);
- pBuf = pBuf->pNext;
-
- }
- pBuf = pObj->pBuf;
-
- x = xmax - xmin + 1;
- if (x%2)
- x++;
- y = ymax - ymin + 1;
- if (y%2)
- y++;
-
- ymin *= pObj->w;
- ymax *= pObj->w;
-
-#ifdef USE_HW_BLITTER
- pSrc = (UINT32*)&pObj->pBG[xmin + ymin];
- pDst = (UINT32*)&pBuf->pFB[xmin + ymin];
-
- while (pObj->regs->pVGA_ctrl & SYS_VGA_BIT_BLIT_BSY);
-
- pObj->regs->pVGA_src0 = (UINT32)pSrc;
- pObj->regs->pVGA_dst = (UINT32)pDst;
- pObj->regs->pVGA_src0_dimx = (UINT32)4*pObj->w;
- pObj->regs->pVGA_dst_dimx = (UINT32)4*pObj->w;
- pObj->regs->pVGA_nx = (UINT32)x - 1;
- pObj->regs->pVGA_ny = (UINT32)y - 1;
- pObj->regs->pVGA_ctrl |= SYS_VGA_BIT_BLIT_REQ;
-
-#else
-
- if (!((xmax-xmin)%8))
- {
- for (y=ymin; y < ymax; y += pBuf->w)
- {
- pSrc = &pObj->pBG[xmin + y];
- pSrc_end = &pObj->pBG[xmax + y];
- pDst = &pBuf->pFB[xmin + y];
- pDst_end = &pBuf->pFB[xmax + y];
- while(pDst < pDst_end)
- {
- __gfx_block_copy_8(pDst, pSrc);
- pDst += 8;
- pSrc += 8;
- }
- }
- return;
- }
-
-// fprintf(stderr, "GFX_DirtyRectCopy(): Slow copy!\n");
- for (y=ymin; y < ymax; y += pBuf->w)
- {
- for (x=xmin; x < xmax; x++)
- {
- pBuf->pFB[x + y] = pObj->pBG[x + y];
- }
- }
-#endif
-
-}
-
-void GFX_box_draw(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy, UINT32 color)
-{
- UINT32 xmin, xmax, ymin, ymax, x, y;
- UINT32 *pFB, *pFB_end;
- buf_t *pBuf;
-
- xmin = posx;
- xmax = pBox->w + posx;
- if (xmax > pObj->w)
- xmax = pObj->w;
-
- ymin = posy;
- ymax = pBox->h + posy;
- if (ymax > pObj->h)
- ymax = pObj->h;
-
- pBuf = pObj->pBuf->pNext;
-
- // Lopp over all frame buffers, except current back buffer
- while(pBuf != pObj->pBuf)
- {
- GFX_DirtyRectUpdate(pBuf, xmin, xmax, ymin, ymax);
- pBuf = pBuf->pNext;
-
- }
- pBuf = pObj->pBuf;
-
- ymin *= pObj->w;
- ymax *= pObj->w;
-
- while (pObj->regs->pVGA_ctrl & SYS_VGA_BIT_BLIT_BSY);
-
- if (!((xmax-xmin)%8))
- {
- for (y=ymin; y < ymax; y += pObj->w)
- {
- pFB = &pBuf->pFB[xmin + y];
- pFB_end = &pBuf->pFB[xmax + y];
- while(pFB < pFB_end)
- {
- __gfx_block_set_8(pFB, color);
- pFB += 8;
- }
- }
- return;
- }
-
-// fprintf(stderr, "GFX_box_draw(): Slow copy!\n");
- for (y=ymin; y < ymax; y += pObj->w)
- {
- for (x=xmin; x < xmax; x++)
- {
- pBuf->pFB[x + y] = color;
- }
- }
-}
-
-void GFX_box_draw_bg(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy, UINT32 color)
-{
- UINT32 xmin, xmax, ymin, ymax, x, y;
- UINT32 *pFB, *pFB_end;
-
- xmin = posx;
- xmax = pBox->w + posx;
- if (xmax > pObj->w)
- xmax = pObj->w;
-
- ymin = posy;
- ymax = pBox->h + posy;
- if (ymax > pObj->h)
- ymax = pObj->h;
-
- ymin *= pObj->w;
- ymax *= pObj->w;
-
- while (pObj->regs->pVGA_ctrl & SYS_VGA_BIT_BLIT_BSY);
-
- if (!((xmax-xmin)%8))
- {
- for (y=ymin; y < ymax; y += pObj->w)
- {
- pFB = &pObj->pBG[xmin + y];
- pFB_end = &pObj->pBG[xmax + y];
- while(pFB < pFB_end)
- {
- __gfx_block_set_8(pFB, color);
- pFB += 8;
- }
- }
- return;
- }
-
-// fprintf(stderr, "GFX_box_draw_bg(): Slow copy!\n");
- for (y=ymin; y < ymax; y += pObj->w)
- {
- for (x=xmin; x < xmax; x++)
- {
- pObj->pBG[x + y] = color;
- }
- }
-}
-
-void GFX_box_draw_direct(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy, UINT32 color)
-{
- UINT32 xmin, xmax, ymin, ymax, x, y;
- UINT32 *pFB, *pFB_end;
- buf_t *pBuf;
-
- pBuf = pObj->pBuf->pLast;
-
- xmin = posx;
- xmax = pBox->w + posx;
- if (xmax > pObj->w)
- xmax = pObj->w;
-
- ymin = posy;
- ymax = pBox->h + posy;
- if (ymax > pObj->h)
- ymax = pObj->h;
-
- ymin *= pObj->w;
- ymax *= pObj->w;
-
- if (!((xmax-xmin)%8))
- {
- for (y=ymin; y < ymax; y += pObj->w)
- {
- pFB = &pBuf->pFB[xmin + y];
- pFB_end = &pBuf->pFB[xmax + y];
- while(pFB < pFB_end)
- {
- __gfx_block_set_8(pFB, color);
- pFB += 8;
- }
- }
- return;
- }
-
-// fprintf(stderr, "GFX_box_draw_direct(): Slow copy!\n");
- for (y=ymin; y < ymax; y += pObj->w)
- {
- for (x=xmin; x < xmax; x++)
- {
- pBuf->pFB[x + y] = color;
- }
- }
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/mips_gfx.h b/lib/CPUs/MIPS/bsp/examples/mips_gfx.h
deleted file mode 100644
index 1363e07..0000000
--- a/lib/CPUs/MIPS/bsp/examples/mips_gfx.h
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef GFX_H
-#define GFX_H
-
-#include "libsys.h"
-
-#define GFX_NUM_FRAME_BUFFERS 2
-#define GFX_FRAME_NOSYNC 0
-#define GFX_FRAME_SYNC 1
-
-// -------------------------------------------------------------
-// Types
-// -------------------------------------------------------------
-typedef struct _sbox_t
-{
- UINT32 w, h;
-} box_t;
-
-typedef struct _srect_t
-{
- UINT32 xmin, xmax;
- UINT32 ymin, ymax;
-} rect_t;
-
-typedef struct _svga_hw_t
-{
- UINT32 volatile pVGA_ctrl; // 0xA0030000 // R/W
- UINT32 volatile pVGA_ascii; // 0xA0030004 // R/W
- UINT32 volatile pVGA_posx; // 0xA0030008 // R/W
- UINT32 volatile pVGA_posy; // 0xA003000C // R/W
- UINT32 volatile pVGA_cgcol; // 0xA0030010 // R/W
- UINT32 volatile pVGA_res; // 0xA0030014 // RO
- UINT32 volatile pVGA_front; // 0xA0030018 // R/W
- UINT32 volatile pVGA_back; // 0xA003001C // R/W
- UINT32 volatile pVGA_src0; // 0xA0030020 // R/W
- UINT32 volatile pVGA_src0_last; // 0xA0030024 // R/W
- UINT32 volatile pVGA_src0_dimx; // 0xA0030028 // R/W
- UINT32 volatile pVGA_src0_res; // 0xA003002C // R/W
- UINT32 volatile pVGA_src1; // 0xA0030030 // R/W
- UINT32 volatile pVGA_src1_last; // 0xA0030034 // R/W
- UINT32 volatile pVGA_src1_dimx; // 0xA0030038 // R/W
- UINT32 volatile pVGA_src1_res; // 0xA003003C // R/W
- UINT32 volatile pVGA_src2; // 0xA0030040 // R/W
- UINT32 volatile pVGA_src2_last; // 0xA0030044 // R/W
- UINT32 volatile pVGA_src2_dimx; // 0xA0030048 // R/W
- UINT32 volatile pVGA_src2_res; // 0xA003004C // R/W
- UINT32 volatile pVGA_dst; // 0xA0030050 // R/W
- UINT32 volatile pVGA_dst_last; // 0xA0030054 // R/W
- UINT32 volatile pVGA_dst_dimx; // 0xA0030058 // R/W
- UINT32 volatile pVGA_dst_res; // 0xA003005C // R/W
- UINT32 volatile pVGA_nx; // 0xA0030060 // R/W
- UINT32 volatile pVGA_ny; // 0xA0030064 // R/W
-
-} vga_hw_t;
-
-typedef struct _sbuf_t
-{
- UINT32 *pFB;
- struct _sbuf_t *pNext;
- struct _sbuf_t *pLast;
- UINT32 is_dirty;
- rect_t rect;
- UINT32 w, h;
- vga_hw_t *regs;
-} buf_t;
-
-typedef struct _sgfx_t
-{
- UINT32 w, h;
- buf_t *pBuf;
- UINT32 *pBG;
- vga_hw_t *regs;
-
-} gfx_t;
-
-// -------------------------------------------------------------
-// Functions
-// -------------------------------------------------------------
-void __gfx_block_set_8(UINT32* pDst, UINT32 value);
-void __gfx_block_copy_8(UINT32* pDst, UINT32* pSrc);
-void __gfx_copy_32(UINT32* pDst, UINT32* pSrc, UINT32 nblocks);
-void GFX_init(gfx_t *pObj);
-void GFX_frame(gfx_t *pObj, UINT32 sync_mode);
-void GFX_show(gfx_t *pObj);
-void GFX_copy_front2back(gfx_t *pObj);
-void GFX_get_FB_front(gfx_t *pObj, UINT32 **ppFB);
-void box_create(box_t *pObj, UINT32 w, UINT32 h);
-void GFX_restore(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy);
-void GFX_box_draw(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy, UINT32 color);
-void GFX_box_draw_bg(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy, UINT32 color);
-
-#endif // GFX_H
diff --git a/lib/CPUs/MIPS/bsp/examples/mipsdis.c b/lib/CPUs/MIPS/bsp/examples/mipsdis.c
deleted file mode 100644
index d05e965..0000000
--- a/lib/CPUs/MIPS/bsp/examples/mipsdis.c
+++ /dev/null
@@ -1,625 +0,0 @@
-/* +----------------------------------------------------------------+ */
-/* | Copyright (c) 1994 Stanford University. | */
-/* | All Rights Reserved. | */
-/* | | */
-/* | This software is distributed with *ABSOLUTELY NO SUPPORT* | */
-/* | and *NO WARRANTY*. Use or reproduction of this code for | */
-/* | commerical gains is strictly prohibited. Otherwise, you | */
-/* | are given permission to use or modify this code as long | */
-/* | as you do not remove this notice. | */
-/* +----------------------------------------------------------------+ */
-/* --------------------------------------------------- */
-/* | Copyright (c) 1986 MIPS Computer Systems, Inc. | */
-/* | All Rights Reserved. | */
-/* --------------------------------------------------- */
-
-/*
- * Copyright 1985 by MIPS Computer Systems, Inc.
- */
-
-/* TORCH disassembler */
-/* derived from MIPS instruction dissassembler by PGL October 91 */
-
-#include
-#include
-#include "mips_dis.h"
-
-#define false 0
-#define true 1
-typedef int boolean;
-char *strcat();
-
-#define ZERO 0
-
-#define COMPILER_NAMES tdis_reg_names[0]
-#define HARDWARE_NAMES tdis_reg_names[1]
-#define ASSEMBLER_NAMES tdis_reg_names[2]
-#define DIS_REG_NAMES(x) tdis_reg_names[x]
-
-union extension_byte {
- unsigned char byte;
- struct { /* extension byte bits in little-endian order */
-#if (defined __MIPSEB || defined _MIPSEB || defined MIPSEB)
- unsigned reserved:1;
- unsigned dyn_nop:1;
- unsigned rs_boost:2;
- unsigned rt_boost:2;
- unsigned rd_boost:2;
-#elif (defined __MIPSEL || defined _MIPSEL || defined MIPSEL)
- unsigned rd_boost:2;
- unsigned rt_boost:2;
- unsigned rs_boost:2;
- unsigned dyn_nop:1;
- unsigned reserved:1;
-#endif /*MIPSEB*/
- } e;
-};
-
-#define blez_op_T blez_op
-#define blez_op_N (blez_op | 0x10)
-#define bgtz_op_T bgtz_op
-#define bgtz_op_N (bgtz_op | 0x10)
-#define beq_op_T beq_op
-#define beq_op_N (beq_op | 0x10)
-#define bne_op_T bne_op
-#define bne_op_N (bne_op | 0x10)
-#define bc_op_T bc_op
-#define bc_op_N (bc_op | 0x02)
-
-static char *op_name[64] = {
-/* 0 */ "special", "regimm","j", "jal", "beq", "bne", "blez", "bgtz",
-/* 8 */ "addi", "addiu","slti", "sltiu","andi", "ori", "xori", "lui",
-/*16 */ "cop0", "cop1", "cop2", "cop3", "beql","bnel","blezl","bgtzl",
-/*24 */ "op60", "op64", "op68", "op6c", "op70", "op74", "op78", "op7c",
-/*32 */ "lb", "lh", "lwl", "lw", "lbu", "lhu", "lwr", "ld",
-/*40 */ "sb", "sh", "swl", "sw", "opb0", "opb4", "swr", "sd",
-/*48 */ "lwc0", "lwc1", "lwc2", "lwc3", "ldc0", "ldc1", "ldc2", "ldc3",
-/*56 */ "swc0", "swc1", "swc2", "swc3", "sdc0", "sdc1", "sdc2", "sdc3"
-};
-
-static char *spec_name[64] = {
-/* 0*/ "sll", "spec01","srl", "sra", "sllv", "spec05","srlv","srav",
-/* 8*/ "jr", "jalr", "spec12","spec13","syscall","break","vcall","spec17",
-/*16*/ "mfhi", "mthi", "mflo", "mtlo", "spec24","spec25","spec26","spec27",
-/*24*/ "mult", "multu","div", "divu", "spec34","spec35","spec36","spec37",
-/*32*/ "add", "addu", "sub", "subu", "and", "or", "xor", "nor",
-/*40*/ "spec50","spec51","slt","sltu", "spec54","spec55","spec56","spec57",
-/*48*/ "spec60","spec61","spec62","spec63","spec64","spec65","spec66","spec67",
-/*56*/ "spec70","spec71","spec72","spec73","spec74","spec75","spec76","spec77"
-};
-
-static char *bcond_name[32] = {
- "bltz",
- "bgez",
- "bltzl",
- "bgezl",
- "bcond04",
- "bcond05",
- "bcond06",
- "bcond07",
- "tgei",
- "tgeiu",
- "tlti",
- "tltiu",
- "teqi",
- "bcond0d",
- "tnei",
- "bcond0f",
- "bltzal",
- "bgezal",
- "bltzall",
- "bgezall",
- "bcond14",
- "bcond15",
- "bcond16",
- "bcond17",
- "bcond18",
- "bcond19",
- "bcond1a",
- "bcond1b",
- "bcond1c",
- "bcond1d",
- "bcond1e",
- "bcond1f"
-};
-
-static char *cop1_name[64] = {
-/* 0 */ "add", "sub", "mul", "div", "sqrt", "abs", "mov", "neg",
-/* 8 */ "fop08","fop09","fop0a","fop0b","fop0c","fop0d","fop0e","fop0f",
-/*16 */ "fop10","fop11","fop12","fop13","fop14","fop15","fop16","fop17",
-/*24 */ "fop18","fop19","fop1a","fop1b","fop1c","fop1d","fop1e","fop1f",
-/*32 */ "cvt.s","cvt.d","cvt.e","fop23","cvt.w","fop25","fop26","fop27",
-/*40 */ "fop28","fop29","fop2a","fop2b","fop2c","fop2d","fop2e","fop2f",
-/*48 */ "c.f", "c.un","c.eq","c.ueq","c.olt","c.ult","c.ole","c.ule",
-/*56 */ "c.sf","c.ngle","c.seq","c.ngl","c.lt","c.nge","c.le","c.ngt"
-};
-
-static char *fmt_name[16] = {
- "s", "d", "e", "q",
- "w", "fmt5", "fmt6", "fmt7",
- "fmt8", "fmt9", "fmta", "fmtb",
- "fmtc", "fmtd", "fmte", "fmtf"
-};
-
-/* public */
-/* Three sets of commonly used register names */
-const char *tdis_reg_names[3][64] = {
- { /* compiler names */
- "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
- "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
- "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
- "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra",
- "zero.B","at.B","v0.B", "v1.B", "a0.B", "a1.B", "a2.B", "a3.B",
- "t0.B", "t1.B", "t2.B", "t3.B", "t4.B", "t5.B", "t6.B", "t7.B",
- "s0.B", "s1.B", "s2.B", "s3.B", "s4.B", "s5.B", "s6.B", "s7.B",
- "t8.B", "t9.B", "k0.B", "k1.B", "gp.B", "sp.B", "s8.B", "ra.B"
- },
- { /* hardware names */
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
- "r24", "r25", "r26", "r27", "gp", "sp", "r30", "r31",
- "r0.B", "r1.B", "r2.B", "r3.B", "r4.B", "r5.B", "r6.B", "r7.B",
- "r8.B", "r9.B", "r10.B","r11.B","r12.B","r13.B","r14.B","r15.B",
- "r16.B","r17.B","r18.B","r19.B","r20.B","r21.B","r22.B","r23.B",
- "r24.B","r25.B","r26.B","r27.B","gp.B", "sp.B", "r30.B","r31.B"
- },
- { /* assembler names */
- "$0", "$at", "$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", "$gp", "$sp", "$30", "$31",
- "$0.B", "$at.B","$2.B", "$3.B", "$4.B", "$5.B", "$6.B", "$7.B",
- "$8.B", "$9.B", "$10.B","$11.B","$12.B","$13.B","$14.B","$15.B",
- "$16.B","$17.B","$18.B","$19.B","$20.B","$21.B","$22.B","$23.B",
- "$24.B","$25.B","$26.B","$27.B","$gp.B","$sp.B","$30.B","$31.B"
- }
-};
-
-static char *c0_opname[64] = {
- "c0op0","tlbr","tlbwi","c0op3","c0op4","c0op5","tlbwr","c0op7",
- "tlbp","c0op9","c0op10","c0op11","c0op12","c0op13","c0op14","c0op15",
- "rfe","c0op17","c0op18","c0op19","c0op20","c0op21","c0op22","c0op23",
- "c0op24","c0op25","c0op26","c0op27","c0op28","c0op29","c0op30","c0op31",
- "c0op32","c0op33","c0op34","c0op35","c0op36","c0op37","c0op38","c0op39",
- "c0op40","c0op41","c0op42","c0op43","c0op44","c0op45","c0op46","c0op47",
- "c0op48","c0op49","c0op50","c0op51","c0op52","c0op53","c0op54","c0op55",
- "c0op56","c0op57","c0op58","c0op59","c0op60","c0op61","c0op62","c0op63"
-};
-
-static char *c0_reg[32] = {
- "index","random","tlblo","c0r3","context","c0r5","c0r6","c0r7",
- "badvaddr","c0r9","tlbhi","epcn","sr", "cause","epc", "c0r15",
- "c0r16","c0r17","c0r18","c0r19","c0r20","c0r21","c0r22","c0r23",
- "c0r24","c0r25","c0r26","c0r27","c0r28","c0r29","c0r30","c0r31"
-};
-
-/* Remember the options set by dis_init */
-//#define ADDR_DEFAULT "%#010x:\t"
-#define ADDR_DEFAULT 0
-//#define VALUE_DEFAULT "%#010x\t"
-#define VALUE_DEFAULT 0
-#define NAME_DEFAULT COMPILER_NAMES
-static struct {
- char *addr_format;
- char *value_format;
- const char **reg_names;
- int print_jal_targets;
-} save = {
- ADDR_DEFAULT,
- VALUE_DEFAULT,
- NAME_DEFAULT,
- true
-};
-
-/* Update regmask to reflect the use of this general-purpose (not fp)
- register, and return its name */
-static const char *
-register_name(ireg, boosted, regmask)
-unsigned ireg, *regmask;
-int boosted;
-{
- if (!boosted)
- *regmask |= (1 << ireg);
- return save.reg_names[boosted ? ireg + 32 : ireg];
-}
-
-/* public -- see dissassembler.h */
-int
-tdisasm(buffer, address, iword, ext, regmask, symbol_value, ls_register)
-char *buffer;
-unsigned char ext; /* extension byte */
-unsigned address, iword, *regmask, *symbol_value, *ls_register;
-{
- int return_value = 0;
- char *bufptr = buffer;
- boolean do_b_displacement = false;
- boolean do_loadstore = false;
- union mips_instruction i;
- union extension_byte e;
-
- *bufptr = 0;
- i.word = iword;
- e.byte = ext;
- *regmask = *symbol_value = *ls_register = 0;
-
- /* Put out the address and hex value of the instruction,
- leaving bufptr set at the end */
- if (save.addr_format) {
- sprintf(bufptr, save.addr_format, address);
- bufptr += strlen(bufptr);
- }
- if (save.value_format) {
- sprintf(bufptr, save.value_format, iword);
- bufptr += strlen(bufptr);
- }
-
- /* check for dynamic NOP */
- if (e.e.dyn_nop) {
- strcat(bufptr, "D.");
- bufptr += 2;
- }
-
- /* decode the instruction */
- switch (i.j_format.opcode) {
-
- case spec_op:
-
- if (i.word == 0x20) {
- strcat(bufptr, "nop");
- if (e.e.rd_boost)
- strcat(bufptr, ".B");
- bufptr += strlen(bufptr);
- break;
- } else if (i.r_format.func == addu_op && i.r_format.rt == ZERO) {
- sprintf(bufptr, "move%s\t%s,%s",
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rs, e.e.rs_boost, regmask));
- bufptr += strlen(bufptr);
- break;
- }
- strcat(bufptr, spec_name[i.r_format.func]);
- if (e.e.rd_boost)
- strcat(bufptr, ".B");
- bufptr += strlen(bufptr);
-
- switch (i.r_format.func) {
- case sll_op:
- case srl_op:
- case sra_op:
- sprintf(bufptr, "\t%s,%s,%d",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rt, e.e.rt_boost, regmask),
- i.r_format.re);
- break;
- case sllv_op:
- case srlv_op:
- case srav_op:
- sprintf(bufptr, "\t%s,%s,%s",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rt, e.e.rt_boost, regmask),
- register_name(i.r_format.rs, e.e.rs_boost, regmask));
- break;
- case mfhi_op:
- case mflo_op:
- sprintf(bufptr, "\t%s",
- register_name(i.r_format.rd, e.e.rd_boost, regmask));
- break;
- case jalr_op:
- return_value = 3;
- sprintf(bufptr, "\t%s,%s",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rs, e.e.rs_boost, regmask));
- *ls_register = i.r_format.rs;
- break;
- case jr_op:
- return_value = 3;
- *ls_register = i.r_format.rs;
- /* fall through */
- case mtlo_op:
- case mthi_op:
- sprintf(bufptr, "\t%s",
- register_name(i.r_format.rs, e.e.rs_boost, regmask));
- break;
- case mult_op:
- case multu_op:
- case div_op:
- case divu_op:
- sprintf(bufptr, "\t%s,%s",
- register_name(i.r_format.rs, e.e.rs_boost, regmask),
- register_name(i.r_format.rt, e.e.rt_boost, regmask));
- break;
- case syscall_op:
- break;
- case break_op:
- case vcall_op:
- {
- char *format = "\t%d";
- unsigned op2 = i.r_format.rd * 32 + i.r_format.re;
-
- if (op2)
- format = "\t%d,%d";
- sprintf(bufptr, format, i.r_format.rs*32+i.r_format.rt,
- op2);
- }
- break;
- default:
- sprintf(bufptr, "\t%s,%s,%s",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rs, e.e.rs_boost, regmask),
- register_name(i.r_format.rt, e.e.rt_boost, regmask));
- break;
- };
- break;
-
- case bcond_op:
- sprintf(bufptr, "%s%s\t%s,",
- bcond_name[i.i_format.rt],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rs, e.e.rs_boost, regmask));
- do_b_displacement = true;
- break;
-
- case blez_op_T:
- case bgtz_op_T:
- case blez_op_N:
- case bgtz_op_N:
- sprintf(bufptr, "%s%s\t%s,", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rs, e.e.rs_boost, regmask));
- do_b_displacement = true;
- break;
- case beq_op_T:
- case beq_op_N:
- if (i.i_format.rs == ZERO && i.i_format.rt == ZERO) {
- strcat(bufptr, "b");
- if (i.j_format.opcode == beq_op_T)
- strcat(bufptr, ".T");
- else
- strcat(bufptr, ".N");
- if (e.e.rd_boost)
- strcat(bufptr, ".B\t");
- else
- strcat(bufptr, "\t");
- do_b_displacement = true;
- break;
- }
- /* fall through */
- case bne_op_T:
- case bne_op_N:
- sprintf(bufptr, "%s%s\t%s,%s,", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rs, e.e.rs_boost, regmask),
- register_name(i.i_format.rt, e.e.rt_boost, regmask));
- do_b_displacement = true;
- break;
-
- case cop0_op:
- case cop1_op:
- case cop2_op:
- case cop3_op:
- {
- unsigned which_cop = i.j_format.opcode - cop0_op;
- char *f_or_r = "rf";
-
- switch (i.r_format.rs) {
- case bc_op_T:
- sprintf(bufptr, "bc%d%c.T%s\t", which_cop,
- "ft"[i.r_format.rt],
- e.e.rd_boost ? ".B" : "");
- do_b_displacement = true;
- break;
- case bc_op_N:
- sprintf(bufptr, "bc%d%c.N%s\t", which_cop,
- "ft"[i.r_format.rt],
- e.e.rd_boost ? ".B" : "");
- do_b_displacement = true;
- break;
- case mtc_op:
- if (which_cop == 0)
- sprintf(bufptr, "mtc%d%s\t%s,%s", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost,regmask),
- c0_reg[i.f_format.rd]);
- else
- sprintf(bufptr, "mtc%d%s\t%s,%c%d", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost,regmask),
- f_or_r[(which_cop == 1)],
- i.f_format.rd);
- break;
- case mfc_op:
- if (which_cop == 0)
- sprintf(bufptr, "mfc%d%s\t%s,%s", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost,regmask),
- c0_reg[i.f_format.rd]);
- else
- sprintf(bufptr, "mfc%d%s\t%s,%c%d", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost,regmask),
- f_or_r[(which_cop == 1)],
- i.f_format.rd);
- break;
- case cfc_op:
- sprintf(bufptr, "cfc%d%s\t%s,%c%d", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost, regmask),
- f_or_r[(which_cop == 1)],
- i.f_format.rd);
- break;
- case ctc_op:
- sprintf(bufptr, "ctc%d%s\t%s,%c%d", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost, regmask),
- f_or_r[(which_cop == 1)],
- i.f_format.rd);
- break;
- default:
- if (which_cop != 1)
- sprintf(bufptr, "c0%s\t%s", e.e.rd_boost ? ".B" : "",
- c0_opname[i.f_format.func]);
- else
- {
- sprintf(bufptr, "%s.%s%s\t",
- cop1_name[i.f_format.func],
- fmt_name[i.f_format.fmt],
- e.e.rd_boost ? ".B" : "");
- bufptr += strlen(bufptr);
- switch (i.f_format.func) {
- case fsqrt_op:
- case fabs_op:
- case fmov_op:
- case fcvts_op:
- case fcvtd_op:
- case fcvte_op:
- case fcvtw_op:
- sprintf(bufptr, "f%d,f%d",
- i.f_format.re,
- i.f_format.rd);
- break;
- case fcmp_op+0x0:
- case fcmp_op+0x1:
- case fcmp_op+0x2:
- case fcmp_op+0x3:
- case fcmp_op+0x4:
- case fcmp_op+0x5:
- case fcmp_op+0x6:
- case fcmp_op+0x7:
- case fcmp_op+0x8:
- case fcmp_op+0x9:
- case fcmp_op+0xa:
- case fcmp_op+0xb:
- case fcmp_op+0xc:
- case fcmp_op+0xd:
- case fcmp_op+0xe:
- case fcmp_op+0xf:
- sprintf(bufptr, "f%d,f%d",
- i.f_format.rd,
- i.f_format.rt);
- break;
- default:
- sprintf(bufptr, "f%d,f%d,f%d",
- i.f_format.re,
- i.f_format.rd,
- i.f_format.rt);
- break;
- } /* switch on func */
- }
- break; /* End of default */
- } /* switch on rs */
- }
- break; /* End of cop0, cop1, cop2, cop3 */
-
- case jal_op:
- case j_op:
- sprintf(bufptr, "%s%s\t", op_name[i.j_format.opcode],
- e.e.rd_boost ? ".B" : "");
- *symbol_value = (address & 0xF0000000) | i.j_format.target << 2;
- if (save.print_jal_targets)
- {
- bufptr += strlen(bufptr);
- sprintf(bufptr, "%#x", *symbol_value);
- }
- return_value = 1;
- break;
-
- case swc1_op:
- case sdc1_op:
- case lwc1_op:
- case ldc1_op:
- sprintf(bufptr, "%s%s\tf%d,", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- i.i_format.rt);
- do_loadstore = true;
- break;
-
- case lb_op:
- case lh_op:
- case lw_op:
- case ld_op:
- case lbu_op:
- case lhu_op:
- case sb_op:
- case sh_op:
- case sw_op:
- case sd_op:
- case lwl_op:
- case lwr_op:
- sprintf(bufptr, "%s%s\t%s,", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rt, e.e.rt_boost, regmask));
- do_loadstore = true;
- break;
-
- case ori_op:
- case xori_op:
- if (i.u_format.rs == ZERO) {
- sprintf(bufptr, "li%s\t%s,%d",
- e.e.rd_boost ? ".B" : "",
- register_name(i.u_format.rt, e.e.rt_boost, regmask),
- i.u_format.uimmediate);
- break;
- }
- /* fall through */
- case andi_op:
- sprintf(bufptr, "%s%s\t%s,%s,%#x", op_name[i.u_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.u_format.rt, e.e.rt_boost, regmask),
- register_name(i.u_format.rs, e.e.rs_boost, regmask),
- i.u_format.uimmediate);
- break;
- case lui_op:
- sprintf(bufptr, "%s%s\t%s,%#x", op_name[i.u_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.u_format.rt, e.e.rt_boost, regmask),
- i.u_format.uimmediate);
- break;
- case addi_op:
- case addiu_op:
- if (i.i_format.rs == ZERO) {
- short sign_extender = i.i_format.simmediate;
- sprintf(bufptr, "li%s\t%s,%d",
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rt, e.e.rt_boost, regmask),
- sign_extender);
- break;
- }
- /* fall through */
- default:
- {
- short sign_extender = i.i_format.simmediate;
- sprintf(bufptr, "%s%s\t%s,%s,%d", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rt, e.e.rt_boost, regmask),
- register_name(i.i_format.rs, e.e.rs_boost, regmask),
- sign_extender);
- }
- break;
- }
-
- /* Some instructions require more than just registers */
-
- if (do_loadstore)
- {
- short sign_extender = i.i_format.simmediate;
- *symbol_value = sign_extender;
- *ls_register = i.i_format.rs;
- bufptr += strlen(bufptr);
- sprintf(bufptr, "%d(%s)", sign_extender,
- register_name(i.i_format.rs, e.e.rs_boost, regmask));
- return_value = -1;
- }
- else if (do_b_displacement)
- {
- short sign_extender = i.i_format.simmediate;
- bufptr += strlen(bufptr);
- *symbol_value = 4 + address + ((((long)sign_extender & 0xFFFD0000) | (0x3FFFF & (sign_extender << 2))));
- sprintf(bufptr, "%#x", *symbol_value);
- return_value = 2;
- }
-
- return return_value;
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/mipsdis.h b/lib/CPUs/MIPS/bsp/examples/mipsdis.h
deleted file mode 100644
index 2e9aca4..0000000
--- a/lib/CPUs/MIPS/bsp/examples/mipsdis.h
+++ /dev/null
@@ -1,450 +0,0 @@
-/* ------------------------------------------------------------------ */
-/* | Copyright Unpublished, MIPS Computer Systems, Inc. All Rights | */
-/* | Reserved. This software contains proprietary and confidential | */
-/* | information of MIPS and its suppliers. Use, disclosure or | */
-/* | reproduction is prohibited without the prior express written | */
-/* | consent of MIPS. | */
-/* ------------------------------------------------------------------ */
-/* inst.h 4.2 */
-/*
- * inst.h -- instruction format defines
- */
-
-/**
- ** UPDATE - 19 Sept 89 by Michael Smith
- **
- ** Removed signed type to remove obnoxious C++ warning message.
- **/
-
-#ifdef LANGUAGE_C
-#ifdef MIPSEB
-union mips_instruction {
- unsigned word;
- unsigned char byte[4];
- struct {
- unsigned opcode : 6;
- unsigned target : 26;
- } j_format;
- struct {
- unsigned opcode : 6;
- unsigned rs : 5;
- unsigned rt : 5;
- unsigned simmediate : 16;
- } i_format;
- struct {
- unsigned opcode : 6;
- unsigned rs : 5;
- unsigned rt : 5;
- unsigned uimmediate : 16;
- } u_format;
- struct {
- unsigned opcode : 6;
- unsigned rs : 5;
- unsigned rt : 5;
- unsigned rd : 5;
- unsigned re : 5;
- unsigned func : 6;
- } r_format;
- struct {
- unsigned opcode : 6;
- unsigned : 1;
- unsigned fmt : 4;
- unsigned rt : 5;
- unsigned rd : 5;
- unsigned re : 5;
- unsigned func : 6;
- } f_format;
-};
-#endif
-
-#ifdef MIPSEL
-union mips_instruction {
- unsigned word;
- unsigned char byte[4];
- struct {
- unsigned target : 26;
- unsigned opcode : 6;
- } j_format;
- struct {
- unsigned simmediate : 16;
- unsigned rt : 5;
- unsigned rs : 5;
- unsigned opcode : 6;
- } i_format;
- struct {
- unsigned uimmediate : 16;
- unsigned rt : 5;
- unsigned rs : 5;
- unsigned opcode : 6;
- } u_format;
- struct {
- unsigned func : 6;
- unsigned re : 5;
- unsigned rd : 5;
- unsigned rt : 5;
- unsigned rs : 5;
- unsigned opcode : 6;
- } r_format;
- struct {
- unsigned func : 6;
- unsigned re : 5;
- unsigned rd : 5;
- unsigned rt : 5;
- unsigned fmt : 4;
- unsigned : 1;
- unsigned opcode : 6;
- } f_format;
-};
-#endif
-
-#define spec_op 0x00
-#define bcond_op 0x01
-#define j_op 0x02
-#define jal_op 0x03
-
-#define beq_op 0x04
-#define bne_op 0x05
-#define blez_op 0x06
-#define bgtz_op 0x07
-
-#define addi_op 0x08
-#define addiu_op 0x09
-#define slti_op 0x0A
-#define sltiu_op 0x0B
-
-#define andi_op 0x0C
-#define ori_op 0x0D
-#define xori_op 0x0E
-#define lui_op 0x0F
-
-#define lb_op 0x20
-#define lh_op 0x21
-#define lw_op 0x23
-#define lbu_op 0x24
-#define lhu_op 0x25
-#define ld_op 0x27
-#define sb_op 0x28
-#define sh_op 0x29
-#define sw_op 0x2B
-#define sd_op 0x2F
-#define lwl_op 0x22
-#define lwr_op 0x26
-#define swl_op 0x2a
-#define swr_op 0x2e
-
-/* Co-processor sub-opcodes */
-#define bc_op 0x08
-#define mfc_op 0x00
-#define cfc_op 0x02
-#define mtc_op 0x04
-#define ctc_op 0x06
-
-/* Co-processor 0 opcodes */
-#define cop0_op 0x10
-#define lwc0_op 0x30
-#define ldc0_op 0x34
-#define swc0_op 0x38
-#define sdc0_op 0x3c
-
-/* Co-processor 0 sub-opcodes */
-#define tlbr_op 0x1
-#define tlbwi_op 0x2
-#define tlbwr_op 0x6
-#define tlbp_op 0x8
-#define rfe_op 0x10
-
-/* Co-processor 1 opcodes */
-#define cop1_op 0x11
-#define lwc1_op 0x31
-#define ldc1_op 0x35
-#define swc1_op 0x39
-#define sdc1_op 0x3D
-
-/* Co-processor 1 sub-opcodes */
-#define fadd_op 0x00
-#define fsub_op 0x01
-#define fmpy_op 0x02
-#define fdiv_op 0x03
-#define fsqrt_op 0x04
-#define fabs_op 0x05
-#define fmov_op 0x06
-#define fneg_op 0x07
-#define fcvts_op 0x20
-#define fcvtd_op 0x21
-#define fcvte_op 0x22
-#define fcvtw_op 0x24
-#define fcmp_op 0x30
-#define s_fmt 0
-#define d_fmt 1
-#define e_fmt 2
-#define w_fmt 4
-
-/* Other coprocessor opcodes */
-#define cop2_op 0x12
-#define lwc2_op 0x32
-#define ldc2_op 0x36
-#define swc2_op 0x3a
-#define sdc2_op 0x3e
-
-#define cop3_op 0x13
-#define lwc3_op 0x33
-#define ldc3_op 0x37
-#define swc3_op 0x3b
-#define sdc3_op 0x3f
-
-
-/* bcond subopcodes */
-#define bltz_op 0x00
-#define bgez_op 0x01
-#define bltzal_op 0x10
-#define bgezal_op 0x11
-
-/* special subopcodes */
-#define sll_op 0x00
-#define srl_op 0x02
-#define sra_op 0x03
-#define sllv_op 0x04
-#define srlv_op 0x06
-#define srav_op 0x07
-#define jr_op 0x08
-#define jalr_op 0x09
-#define syscall_op 0x0C
-#define break_op 0x0D
-#define vcall_op 0x0E
-
-#define mfhi_op 0x10
-#define mthi_op 0x11
-#define mflo_op 0x12
-#define mtlo_op 0x13
-#define mult_op 0x18
-#define multu_op 0x19
-#define div_op 0x1A
-#define divu_op 0x1B
-
-#define add_op 0x20
-#define addu_op 0x21
-#define and_op 0x24
-#define or_op 0x25
-#define xor_op 0x26
-#define nor_op 0x27
-#define sub_op 0x22
-#define subu_op 0x23
-#define slt_op 0x2A
-#define sltu_op 0x2B
-
-#endif /* LANGUAGE_C */
-
-#ifdef LANGUAGE_PASCAL
-
-#ifdef MIPSEB
-type
- mips_instruction =
- packed record
- case cardinal of
- 0: (
- word: cardinal;
- );
- 1: (
- byte: packed array[0..3] of 0..255;
- );
- 2: (
- opcode: 0..63;
- target: 0..67108863;
- );
- 3: (
- opcode3: 0..63;
- rs: 0..31;
- rt: 0..31;
- simmediate: -32768..32767;
- );
- 4: (
- opcode4: 0..63;
- rs4: 0..63;
- rt4: 0..63;
- uimmediate: 0..65535;
- );
- 5: (
- opcode5: 0..63;
- rs5: 0..63;
- rt5: 0..63;
- rd5: 0..63;
- re5: 0..63;
- func: 0..63;
- );
- end {record};
-#endif
-
-#ifdef MIPSEL
-type
- mips_instruction =
- packed record
- case cardinal of
- 0: (
- word: cardinal;
- );
- 1: (
- byte: packed array[0..3] of 0..255;
- );
- 2: (
- target: 0..67108863;
- opcode: 0..63;
- );
- 3: (
- simmediate: -32768..32767;
- rt: 0..31;
- rs: 0..31;
- opcode3: 0..63;
- );
- 4: (
- uimmediate: 0..65535;
- rt4: 0..63;
- rs4: 0..63;
- opcode4: 0..63;
- );
- 5: (
- func: 0..63;
- re5: 0..63;
- rd5: 0..63;
- rt5: 0..63;
- rs5: 0..63;
- opcode5: 0..63;
- );
- end {record};
-#endif
-
-#define spec_op 16#00
-#define bcond_op 16#01
-#define j_op 16#02
-#define jal_op 16#03
-
-#define beq_op 16#04
-#define bne_op 16#05
-#define blez_op 16#06
-#define bgtz_op 16#07
-
-#define addi_op 16#08
-#define addiu_op 16#09
-#define slti_op 16#0A
-#define sltiu_op 16#0B
-
-#define andi_op 16#0C
-#define ori_op 16#0D
-#define xori_op 16#0E
-#define lui_op 16#0F
-
-#define lb_op 16#20
-#define lh_op 16#21
-#define lw_op 16#23
-#define lbu_op 16#24
-#define lhu_op 16#25
-#define ld_op 16#27
-#define sb_op 16#28
-#define sh_op 16#29
-#define sw_op 16#2B
-#define sd_op 16#2F
-#define lwl_op 16#22
-#define lwr_op 16#26
-#define swl_op 16#2a
-#define swr_op 16#2e
-
-/* Co-processor sub-opcodes */
-#define bc_op 16#08
-#define mfc_op 16#00
-#define cfc_op 16#02
-#define mtc_op 16#04
-#define ctc_op 16#06
-
-/* Co-processor 0 opcodes */
-#define cop0_op 16#10
-#define lwc0_op 16#30
-#define ldc0_op 16#34
-#define swc0_op 16#38
-#define sdc0_op 16#3c
-
-/* Co-processor 0 sub-opcodes */
-#define tlbr_op 16#1
-#define tlbwi_op 16#2
-#define tlbwr_op 16#6
-#define tlbp_op 16#8
-#define rfe_op 16#10
-
-/* Co-processor 1 opcodes */
-#define cop1_op 16#11
-#define lwc1_op 16#31
-#define ldc1_op 16#35
-#define swc1_op 16#39
-#define sdc1_op 16#3D
-
-/* Co-processor 1 sub-opcodes */
-#define fadd_op 16#00
-#define fsub_op 16#01
-#define fmpy_op 16#02
-#define fdiv_op 16#03
-#define fsqrt_op 16#04
-#define fabs_op 16#05
-#define fmov_op 16#06
-#define fneg_op 16#07
-#define fcvts_op 16#20
-#define fcvtd_op 16#21
-#define fcvte_op 16#22
-#define fcvtw_op 16#24
-#define fcmp_op 16#30
-#define s_fmt 0
-#define d_fmt 1
-#define e_fmt 2
-#define w_fmt 4
-
-/* Other coprocessor opcodes */
-#define cop2_op 16#12
-#define lwc2_op 16#32
-#define ldc2_op 16#36
-#define swc2_op 16#3a
-#define sdc2_op 16#3e
-
-#define cop3_op 16#13
-#define lwc3_op 16#33
-#define ldc3_op 16#37
-#define swc3_op 16#3b
-#define sdc3_op 16#3f
-
-
-/* bcond subopcodes */
-#define bltz_op 16#00
-#define bgez_op 16#01
-#define bltzal_op 16#10
-#define bgezal_op 16#11
-
-/* special subopcodes */
-#define sll_op 16#00
-#define srl_op 16#02
-#define sra_op 16#03
-#define sllv_op 16#04
-#define srlv_op 16#06
-#define srav_op 16#07
-#define jr_op 16#08
-#define jalr_op 16#09
-#define syscall_op 16#0C
-#define break_op 16#0D
-#define vcall_op 16#0E
-
-#define mfhi_op 16#10
-#define mthi_op 16#11
-#define mflo_op 16#12
-#define mtlo_op 16#13
-#define mult_op 16#18
-#define multu_op 16#19
-#define div_op 16#1A
-#define divu_op 16#1B
-
-#define add_op 16#20
-#define addu_op 16#21
-#define and_op 16#24
-#define or_op 16#25
-#define xor_op 16#26
-#define nor_op 16#27
-#define sub_op 16#22
-#define subu_op 16#23
-#define slt_op 16#2A
-#define sltu_op 16#2B
-
-#endif /* LANGUAGE_PASCAL */
diff --git a/lib/CPUs/MIPS/bsp/examples/paranoia.c b/lib/CPUs/MIPS/bsp/examples/paranoia.c
deleted file mode 100644
index 38f08e1..0000000
--- a/lib/CPUs/MIPS/bsp/examples/paranoia.c
+++ /dev/null
@@ -1,2302 +0,0 @@
-/*
- * paranoia.c,v 1.4 1995/08/23 19:26:32 joel Exp
- *
- * A C version of Kahan's Floating Point Test "Paranoia"
- *
- * Thos Sumner, UCSF, Feb. 1985
- * David Gay, BTL, Jan. 1986
- *
- * This is a rewrite from the Pascal version by
- *
- * B. A. Wichmann, 18 Jan. 1985
- *
- * (and does NOT exhibit good C programming style).
- *
- * Sun May 16 18:21:51 MDT 1993 Jeffrey Wheat (cassidy@cygnus.com)
- * Removed KR_headers defines, removed ANSI prototyping
- * Cleaned up and reformated code. Added special CYGNUS
- * "verbose" mode type messages (-DCYGNUS).
- * Note: This code is VERY NASTY.
- *
- * Adjusted to use Standard C headers 19 Jan. 1992 (dmg);
- * compile with -DKR_headers or insert
- * #define KR_headers
- * at the beginning if you have an old-style C compiler.
- *
- * (C) Apr 19 1983 in BASIC version by:
- * Professor W. M. Kahan,
- * 567 Evans Hall
- * Electrical Engineering & Computer Science Dept.
- * University of California
- * Berkeley, California 94720
- * USA
- *
- * converted to Pascal by:
- * B. A. Wichmann
- * National Physical Laboratory
- * Teddington Middx
- * TW11 OLW
- * UK
- *
- * converted to C by:
- *
- * David M. Gay and Thos Sumner
- * AT&T Bell Labs Computer Center, Rm. U-76
- * 600 Mountain Avenue University of California
- * Murray Hill, NJ 07974 San Francisco, CA 94143
- * USA USA
- *
- * with simultaneous corrections to the Pascal source (reflected
- * in the Pascal source available over netlib).
- * [A couple of bug fixes from dgh = sun!dhough incorporated 31 July 1986.]
- *
- * Reports of results on various systems from all the versions
- * of Paranoia are being collected by Richard Karpinski at the
- * same address as Thos Sumner. This includes sample outputs,
- * bug reports, and criticisms.
- *
- * You may copy this program freely if you acknowledge its source.
- * Comments on the Pascal version to NPL, please.
- *
- *
- * The C version catches signals from floating-point exceptions.
- * If signal(SIGFPE,...) is unavailable in your environment, you may
- * #define NOSIGNAL to comment out the invocations of signal.
- *
- * This source file is too big for some C compilers, but may be split
- * into pieces. Comments containing "SPLIT" suggest convenient places
- * for this splitting. At the end of these comments is an "ed script"
- * (for the UNIX(tm) editor ed) that will do this splitting.
- *
- * By #defining SINGLE_PRECISION when you compile this source, you may
- * obtain a single-precision C version of Paranoia.
- *
- * The following is from the introductory commentary from Wichmann's work:
- *
- * The BASIC program of Kahan is written in Microsoft BASIC using many
- * facilities which have no exact analogy in Pascal. The Pascal
- * version below cannot therefore be exactly the same. Rather than be
- * a minimal transcription of the BASIC program, the Pascal coding
- * follows the conventional style of block-structured languages. Hence
- * the Pascal version could be useful in producing versions in other
- * structured languages.
- *
- * Rather than use identifiers of minimal length (which therefore have
- * little mnemonic significance), the Pascal version uses meaningful
- * identifiers as follows [Note: A few changes have been made for C]:
- *
- *
- * BASIC C BASIC C BASIC C
- *
- * A J S StickyBit
- * A1 AInverse J0 NoErrors T
- * B Radix [Failure] T0 Underflow
- * B1 BInverse J1 NoErrors T2 ThirtyTwo
- * B2 RadixD2 [SeriousDefect] T5 OneAndHalf
- * B9 BMinusU2 J2 NoErrors T7 TwentySeven
- * C [Defect] T8 TwoForty
- * C1 CInverse J3 NoErrors U OneUlp
- * D [Flaw] U0 UnderflowThreshold
- * D4 FourD K PageNo U1
- * E0 L Milestone U2
- * E1 M V
- * E2 Exp2 N V0
- * E3 N1 V8
- * E5 MinSqEr O Zero V9
- * E6 SqEr O1 One W
- * E7 MaxSqEr O2 Two X
- * E8 O3 Three X1
- * E9 O4 Four X8
- * F1 MinusOne O5 Five X9 Random1
- * F2 Half O8 Eight Y
- * F3 Third O9 Nine Y1
- * F6 P Precision Y2
- * F9 Q Y9 Random2
- * G1 GMult Q8 Z
- * G2 GDiv Q9 Z0 PseudoZero
- * G3 GAddSub R Z1
- * H R1 RMult Z2
- * H1 HInverse R2 RDiv Z9
- * I R3 RAddSub
- * IO NoTrials R4 RSqrt
- * I3 IEEE R9 Random9
- *
- * SqRWrng
- *
- * All the variables in BASIC are true variables and in consequence,
- * the program is more difficult to follow since the "constants" must
- * be determined (the glossary is very helpful). The Pascal version
- * uses Real constants, but checks are added to ensure that the values
- * are correctly converted by the compiler.
- *
- * The major textual change to the Pascal version apart from the
- * identifiersis that named procedures are used, inserting parameters
- * wherehelpful. New procedures are also introduced. The
- * correspondence is as follows:
- *
- *
- * BASIC Pascal
- * lines
- *
- * 90- 140 Pause
- * 170- 250 Instructions
- * 380- 460 Heading
- * 480- 670 Characteristics
- * 690- 870 History
- * 2940-2950 Random
- * 3710-3740 NewD
- * 4040-4080 DoesYequalX
- * 4090-4110 PrintIfNPositive
- * 4640-4850 TestPartialUnderflow
- *
-*/
-
-#include
-#include
-
-/*
- * To compile this on host using only libm from newlib (and using host libc)
- * do:
- * gcc -g -DNEED_REENT -DCYGNUS paranoia.c .../newlib-1.6/newlib/libm.a
- */
-
-#ifdef NEED_REENT
-#include
-struct _reent libm_reent = _REENT_INIT(libm_reent);
-struct _reent *_impure_ptr = &libm_reent;
-#endif
-
-#ifndef NOSIGNAL
-#include
-#include
-#else /* NOSIGNAL */
-#define longjmp(e,v)
-#define setjmp(e) 0
-#define jmp_buf int
-#endif /* NOSIGNAL */
-
-#ifdef SINGLE_PRECISION
-#define FLOAT float
-#define FABS(x) (float)fabs((double)(x))
-#define FLOOR(x) (float)floor((double)(x))
-#define LOG(x) (float)log((double)(x))
-#define POW(x,y) (float)pow((double)(x),(double)(y))
-#define SQRT(x) (float)sqrt((double)(x))
-#else /* !SINGLE_PRECISION */
-#define FLOAT double
-#define FABS(x) fabs(x)
-#define FLOOR(x) floor(x)
-#define LOG(x) log(x)
-#define POW(x,y) pow(x,y)
-#define SQRT(x) sqrt(x)
-#endif /* SINGLE_PRECISION */
-
-jmp_buf ovfl_buf;
-extern double fabs (), floor (), log (), pow (), sqrt ();
-extern void exit ();
-typedef void (*Sig_type) ();
-FLOAT Sign (), Random ();
-extern void BadCond ();
-extern void SqXMinX ();
-extern void TstCond ();
-extern void notify ();
-extern int read ();
-extern void Characteristics ();
-extern void Heading ();
-extern void History ();
-extern void Instructions ();
-extern void IsYeqX ();
-extern void NewD ();
-extern void Pause ();
-extern void PrintIfNPositive ();
-extern void SR3750 ();
-extern void SR3980 ();
-extern void TstPtUf ();
-
-Sig_type sigsave;
-
-#define KEYBOARD 0
-
-FLOAT Radix, BInvrse, RadixD2, BMinusU2;
-
-/*Small floating point constants.*/
-FLOAT Zero = 0.0;
-FLOAT Half = 0.5;
-FLOAT One = 1.0;
-FLOAT Two = 2.0;
-FLOAT Three = 3.0;
-FLOAT Four = 4.0;
-FLOAT Five = 5.0;
-FLOAT Eight = 8.0;
-FLOAT Nine = 9.0;
-FLOAT TwentySeven = 27.0;
-FLOAT ThirtyTwo = 32.0;
-FLOAT TwoForty = 240.0;
-FLOAT MinusOne = -1.0;
-FLOAT OneAndHalf = 1.5;
-
-/*Integer constants*/
-int NoTrials = 20; /*Number of tests for commutativity. */
-#define False 0
-#define True 1
-
-/*
- * Definitions for declared types
- * Guard == (Yes, No);
- * Rounding == (Chopped, Rounded, Other);
- * Message == packed array [1..40] of char;
- * Class == (Flaw, Defect, Serious, Failure);
- */
-#define Yes 1
-#define No 0
-#define Chopped 2
-#define Rounded 1
-#define Other 0
-#define Flaw 3
-#define Defect 2
-#define Serious 1
-#define Failure 0
-typedef int Guard, Rounding, Class;
-typedef char Message;
-
-/* Declarations of Variables */
-int Indx;
-char ch[8];
-FLOAT AInvrse, A1;
-FLOAT C, CInvrse;
-FLOAT D, FourD;
-FLOAT E0, E1, Exp2, E3, MinSqEr;
-FLOAT SqEr, MaxSqEr, E9;
-FLOAT Third;
-FLOAT F6, F9;
-FLOAT H, HInvrse;
-int I;
-FLOAT StickyBit, J;
-FLOAT MyZero;
-FLOAT Precision;
-FLOAT Q, Q9;
-FLOAT R, Random9;
-FLOAT T, Underflow, S;
-FLOAT OneUlp, UfThold, U1, U2;
-FLOAT V, V0, V9;
-FLOAT W;
-FLOAT X, X1, X2, X8, Random1;
-FLOAT Y, Y1, Y2, Random2;
-FLOAT Z, PseudoZero, Z1, Z2, Z9;
-int ErrCnt[4];
-int fpecount;
-int Milestone;
-int PageNo;
-int M, N, N1;
-Guard GMult, GDiv, GAddSub;
-Rounding RMult, RDiv, RAddSub, RSqrt;
-int Break, Done, NotMonot, Monot, Anomaly, IEEE, SqRWrng, UfNGrad;
-
-/* Computed constants.
- * U1 gap below 1.0, i.e, 1.0 - U1 is next number below 1.0
- * U2 gap above 1.0, i.e, 1.0 + U2 is next number above 1.0
- */
-
-int batchmode; /* global batchmode test */
-
-/* program name and version variables and macro */
-char *temp;
-char *program_name;
-char *program_vers;
-
-#ifndef VERSION
-#define VERSION "1.1 [cygnus]"
-#endif /* VERSION */
-
-#define basename(cp) ((temp=(char *)strrchr((cp), '/')) ? temp+1 : (cp))
-
-#ifndef BATCHMODE
-# ifdef CYGNUS
-# define BATCHMODE
-# endif
-#endif
-
-/* floating point exception receiver */
-void
-_sigfpe (x)
-int x;
-{
- fpecount++;
- printf ("\n* * * FLOATING-POINT ERROR %d * * *\n", x);
- fflush (stdout);
- if (sigsave) {
-#ifndef NOSIGNAL
- signal (SIGFPE, sigsave);
-#endif /* NOSIGNAL */
- sigsave = 0;
- longjmp (ovfl_buf, 1);
- }
- exit (1);
-}
-
-#ifdef NOMAIN
-#define main paranoia
-#endif
-
-int
-main (argc, argv)
-int argc;
-char **argv;
-{
- /* First two assignments use integer right-hand sides. */
- Zero = 0;
- One = 1;
- Two = One + One;
- Three = Two + One;
- Four = Three + One;
- Five = Four + One;
- Eight = Four + Four;
- Nine = Three * Three;
- TwentySeven = Nine * Three;
- ThirtyTwo = Four * Eight;
- TwoForty = Four * Five * Three * Four;
- MinusOne = -One;
- Half = One / Two;
- OneAndHalf = One + Half;
- ErrCnt[Failure] = 0;
- ErrCnt[Serious] = 0;
- ErrCnt[Defect] = 0;
- ErrCnt[Flaw] = 0;
- PageNo = 1;
-
-#ifdef BATCHMODE
- batchmode = 1; /* run test in batchmode? */
-#else /* !BATCHMODE */
- batchmode = 0; /* run test interactively */
-#endif /* BATCHMODE */
-
-/*
- program_name = basename (argv[0]);
-*/
- program_vers = VERSION;
-
- printf ("%s version %s\n", "Paranoia", program_vers);
-
- /*=============================================*/
- Milestone = 0;
- /*=============================================*/
-#ifndef NOSIGNAL
- signal (SIGFPE, _sigfpe);
-#endif
-
- if (!batchmode) {
- Instructions ();
- Pause ();
- Heading ();
- Instructions ();
- Pause ();
- Heading ();
- Pause ();
- Characteristics ();
- Pause ();
- History ();
- Pause ();
- }
-
- /*=============================================*/
- Milestone = 7;
- /*=============================================*/
- printf ("Program is now RUNNING tests on small integers:\n");
- TstCond (Failure, (Zero + Zero == Zero) && (One - One == Zero)
- && (One > Zero) && (One + One == Two),
- "0+0 != 0, 1-1 != 0, 1 <= 0, or 1+1 != 2");
- Z = -Zero;
- if (Z != 0.0) {
- ErrCnt[Failure] = ErrCnt[Failure] + 1;
- printf ("Comparison alleges that -0.0 is Non-zero!\n");
- U1 = 0.001;
- Radix = 1;
- TstPtUf ();
- }
- TstCond (Failure, (Three == Two + One) && (Four == Three + One)
- && (Four + Two * (-Two) == Zero)
- && (Four - Three - One == Zero),
- "3 != 2+1, 4 != 3+1, 4+2*(-2) != 0, or 4-3-1 != 0");
- TstCond (Failure, (MinusOne == (0 - One))
- && (MinusOne + One == Zero) && (One + MinusOne == Zero)
- && (MinusOne + FABS (One) == Zero)
- && (MinusOne + MinusOne * MinusOne == Zero),
- "-1+1 != 0, (-1)+abs(1) != 0, or -1+(-1)*(-1) != 0");
- TstCond (Failure, Half + MinusOne + Half == Zero,
- "1/2 + (-1) + 1/2 != 0");
- /*=============================================*/
- Milestone = 10;
- /*=============================================*/
- TstCond (Failure, (Nine == Three * Three)
- && (TwentySeven == Nine * Three) && (Eight == Four + Four)
- && (ThirtyTwo == Eight * Four)
- && (ThirtyTwo - TwentySeven - Four - One == Zero),
- "9 != 3*3, 27 != 9*3, 32 != 8*4, or 32-27-4-1 != 0");
- TstCond (Failure, (Five == Four + One) &&
- (TwoForty == Four * Five * Three * Four)
- && (TwoForty / Three - Four * Four * Five == Zero)
- && (TwoForty / Four - Five * Three * Four == Zero)
- && (TwoForty / Five - Four * Three * Four == Zero),
- "5 != 4+1, 240/3 != 80, 240/4 != 60, or 240/5 != 48");
- if (ErrCnt[Failure] == 0) {
- printf ("-1, 0, 1/2, 1, 2, 3, 4, 5, 9, 27, 32 & 240 are O.K.\n");
- printf ("\n");
- }
- printf ("Searching for Radix and Precision.\n");
- W = One;
- do {
- W = W + W;
- Y = W + One;
- Z = Y - W;
- Y = Z - One;
- }
- while (MinusOne + FABS (Y) < Zero);
- /*.. now W is just big enough that |((W+1)-W)-1| >= 1 ...*/
- Precision = Zero;
- Y = One;
- do {
- Radix = W + Y;
- Y = Y + Y;
- Radix = Radix - W;
- }
- while (Radix == Zero);
- if (Radix < Two)
- Radix = One;
- printf ("Radix = %f .\n", Radix);
- if (Radix != 1) {
- W = One;
- do {
- Precision = Precision + One;
- W = W * Radix;
- Y = W + One;
- }
- while ((Y - W) == One);
- }
- /*... now W == Radix^Precision is barely too big to satisfy (W+1)-W == 1
- ...*/
- U1 = One / W;
- U2 = Radix * U1;
- printf ("Closest relative separation found is U1 = %.7e .\n\n", U1);
- printf ("Recalculating radix and precision\n ");
-
- /*save old values*/
- E0 = Radix;
- E1 = U1;
- E9 = U2;
- E3 = Precision;
-
- X = Four / Three;
- Third = X - One;
- F6 = Half - Third;
- X = F6 + F6;
- X = FABS (X - Third);
- if (X < U2)
- X = U2;
-
- /*... now X = (unknown no.) ulps of 1+...*/
- do {
- U2 = X;
- Y = Half * U2 + ThirtyTwo * U2 * U2;
- Y = One + Y;
- X = Y - One;
- }
- while (!((U2 <= X) || (X <= Zero)));
-
- /*... now U2 == 1 ulp of 1 + ... */
- X = Two / Three;
- F6 = X - Half;
- Third = F6 + F6;
- X = Third - Half;
- X = FABS (X + F6);
- if (X < U1)
- X = U1;
-
- /*... now X == (unknown no.) ulps of 1 -... */
- do {
- U1 = X;
- Y = Half * U1 + ThirtyTwo * U1 * U1;
- Y = Half - Y;
- X = Half + Y;
- Y = Half - X;
- X = Half + Y;
- }
- while (!((U1 <= X) || (X <= Zero)));
- /*... now U1 == 1 ulp of 1 - ... */
- if (U1 == E1)
- printf ("confirms closest relative separation U1 .\n");
- else
- printf ("gets better closest relative separation U1 = %.7e .\n", U1);
- W = One / U1;
- F9 = (Half - U1) + Half;
- Radix = FLOOR (0.01 + U2 / U1);
- if (Radix == E0)
- printf ("Radix confirmed.\n");
- else
- printf ("MYSTERY: recalculated Radix = %.7e .\n", Radix);
- TstCond (Defect, Radix <= Eight + Eight,
- "Radix is too big: roundoff problems");
- TstCond (Flaw, (Radix == Two) || (Radix == 10)
- || (Radix == One), "Radix is not as good as 2 or 10");
- /*=============================================*/
- Milestone = 20;
- /*=============================================*/
- TstCond (Failure, F9 - Half < Half,
- "(1-U1)-1/2 < 1/2 is FALSE, prog. fails?");
- X = F9;
- I = 1;
- Y = X - Half;
- Z = Y - Half;
- TstCond (Failure, (X != One)
- || (Z == Zero), "Comparison is fuzzy,X=1 but X-1/2-1/2 != 0");
- X = One + U2;
- I = 0;
- /*=============================================*/
- Milestone = 25;
- /*=============================================*/
- /*... BMinusU2 = nextafter(Radix, 0) */
- BMinusU2 = Radix - One;
- BMinusU2 = (BMinusU2 - U2) + One;
- /* Purify Integers */
- if (Radix != One) {
- X = -TwoForty * LOG (U1) / LOG (Radix);
- Y = FLOOR (Half + X);
- if (FABS (X - Y) * Four < One)
- X = Y;
- Precision = X / TwoForty;
- Y = FLOOR (Half + Precision);
- if (FABS (Precision - Y) * TwoForty < Half)
- Precision = Y;
- }
- if ((Precision != FLOOR (Precision)) || (Radix == One)) {
- printf ("Precision cannot be characterized by an Integer number\n");
- printf ("of significant digits but, by itself, this is a minor flaw.\n");
- }
- if (Radix == One)
- printf ("logarithmic encoding has precision characterized solely by U1.\n");
- else
- printf ("The number of significant digits of the Radix is %f .\n",
- Precision);
- TstCond (Serious, U2 * Nine * Nine * TwoForty < One,
- "Precision worse than 5 decimal figures ");
- /*=============================================*/
- Milestone = 30;
- /*=============================================*/
- /* Test for extra-precise subepressions */
- X = FABS (((Four / Three - One) - One / Four) * Three - One / Four);
- do {
- Z2 = X;
- X = (One + (Half * Z2 + ThirtyTwo * Z2 * Z2)) - One;
- }
- while (!((Z2 <= X) || (X <= Zero)));
- X = Y = Z = FABS ((Three / Four - Two / Three) * Three - One / Four);
- do {
- Z1 = Z;
- Z = (One / Two - ((One / Two - (Half * Z1 + ThirtyTwo * Z1 * Z1))
- + One / Two)) + One / Two;
- }
- while (!((Z1 <= Z) || (Z <= Zero)));
- do {
- do {
- Y1 = Y;
- Y = (Half - ((Half - (Half * Y1 + ThirtyTwo * Y1 * Y1)) + Half
- )) + Half;
- }
- while (!((Y1 <= Y) || (Y <= Zero)));
- X1 = X;
- X = ((Half * X1 + ThirtyTwo * X1 * X1) - F9) + F9;
- }
- while (!((X1 <= X) || (X <= Zero)));
- if ((X1 != Y1) || (X1 != Z1)) {
- BadCond (Serious, "Disagreements among the values X1, Y1, Z1,\n");
- printf ("respectively %.7e, %.7e, %.7e,\n", X1, Y1, Z1);
- printf ("are symptoms of inconsistencies introduced\n");
- printf ("by extra-precise evaluation of arithmetic subexpressions.\n");
- notify ("Possibly some part of this");
- if ((X1 == U1) || (Y1 == U1) || (Z1 == U1))
- printf (
- "That feature is not tested further by this program.\n");
- } else {
- if ((Z1 != U1) || (Z2 != U2)) {
- if ((Z1 >= U1) || (Z2 >= U2)) {
- BadCond (Failure, "");
- notify ("Precision");
- printf ("\tU1 = %.7e, Z1 - U1 = %.7e\n", U1, Z1 - U1);
- printf ("\tU2 = %.7e, Z2 - U2 = %.7e\n", U2, Z2 - U2);
- } else {
- if ((Z1 <= Zero) || (Z2 <= Zero)) {
- printf ("Because of unusual Radix = %f", Radix);
- printf (", or exact rational arithmetic a result\n");
- printf ("Z1 = %.7e, or Z2 = %.7e ", Z1, Z2);
- notify ("of an\nextra-precision");
- }
- if (Z1 != Z2 || Z1 > Zero) {
- X = Z1 / U1;
- Y = Z2 / U2;
- if (Y > X)
- X = Y;
- Q = -LOG (X);
- printf ("Some subexpressions appear to be calculated extra\n");
- printf ("precisely with about %g extra B-digits, i.e.\n",
- (Q / LOG (Radix)));
- printf ("roughly %g extra significant decimals.\n",
- Q / LOG (10.));
- }
- printf ("That feature is not tested further by this program.\n");
- }
- }
- }
- Pause ();
- /*=============================================*/
- Milestone = 35;
- /*=============================================*/
- if (Radix >= Two) {
- X = W / (Radix * Radix);
- Y = X + One;
- Z = Y - X;
- T = Z + U2;
- X = T - Z;
- TstCond (Failure, X == U2,
- "Subtraction is not normalized X=Y,X+Z != Y+Z!");
- if (X == U2)
- printf (
- "Subtraction appears to be normalized, as it should be.");
- }
- printf ("\nChecking for guard digit in *, /, and -.\n");
- Y = F9 * One;
- Z = One * F9;
- X = F9 - Half;
- Y = (Y - Half) - X;
- Z = (Z - Half) - X;
- X = One + U2;
- T = X * Radix;
- R = Radix * X;
- X = T - Radix;
- X = X - Radix * U2;
- T = R - Radix;
- T = T - Radix * U2;
- X = X * (Radix - One);
- T = T * (Radix - One);
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero))
- GMult = Yes;
- else {
- GMult = No;
- TstCond (Serious, False,
- "* lacks a Guard Digit, so 1*X != X");
- }
- Z = Radix * U2;
- X = One + Z;
- Y = FABS ((X + Z) - X * X) - U2;
- X = One - U2;
- Z = FABS ((X - U2) - X * X) - U1;
- TstCond (Failure, (Y <= Zero)
- && (Z <= Zero), "* gets too many final digits wrong.\n");
- Y = One - U2;
- X = One + U2;
- Z = One / Y;
- Y = Z - X;
- X = One / Three;
- Z = Three / Nine;
- X = X - Z;
- T = Nine / TwentySeven;
- Z = Z - T;
- TstCond (Defect, X == Zero && Y == Zero && Z == Zero,
- "Division lacks a Guard Digit, so error can exceed 1 ulp\n\
-or 1/3 and 3/9 and 9/27 may disagree");
- Y = F9 / One;
- X = F9 - Half;
- Y = (Y - Half) - X;
- X = One + U2;
- T = X / One;
- X = T - X;
- if ((X == Zero) && (Y == Zero) && (Z == Zero))
- GDiv = Yes;
- else {
- GDiv = No;
- TstCond (Serious, False,
- "Division lacks a Guard Digit, so X/1 != X");
- }
- X = One / (One + U2);
- Y = X - Half - Half;
- TstCond (Serious, Y < Zero,
- "Computed value of 1/1.000..1 >= 1");
- X = One - U2;
- Y = One + Radix * U2;
- Z = X * Radix;
- T = Y * Radix;
- R = Z / Radix;
- StickyBit = T / Radix;
- X = R - X;
- Y = StickyBit - Y;
- TstCond (Failure, X == Zero && Y == Zero,
- "* and/or / gets too many last digits wrong");
- Y = One - U1;
- X = One - F9;
- Y = One - Y;
- T = Radix - U2;
- Z = Radix - BMinusU2;
- T = Radix - T;
- if ((X == U1) && (Y == U1) && (Z == U2) && (T == U2))
- GAddSub = Yes;
- else {
- GAddSub = No;
- TstCond (Serious, False,
- "- lacks Guard Digit, so cancellation is obscured");
- }
- if (F9 != One && F9 - One >= Zero) {
- BadCond (Serious, "comparison alleges (1-U1) < 1 although\n");
- printf (" subtraction yields (1-U1) - 1 = 0 , thereby vitiating\n");
- printf (" such precautions against division by zero as\n");
- printf (" ... if (X == 1.0) {.....} else {.../(X-1.0)...}\n");
- }
- if (GMult == Yes && GDiv == Yes && GAddSub == Yes)
- printf (
- " *, /, and - appear to have guard digits, as they should.\n");
- /*=============================================*/
- Milestone = 40;
- /*=============================================*/
- Pause ();
- printf ("Checking rounding on multiply, divide and add/subtract.\n");
- RMult = Other;
- RDiv = Other;
- RAddSub = Other;
- RadixD2 = Radix / Two;
- A1 = Two;
- Done = False;
- do {
- AInvrse = Radix;
- do {
- X = AInvrse;
- AInvrse = AInvrse / A1;
- }
- while (!(FLOOR (AInvrse) != AInvrse));
- Done = (X == One) || (A1 > Three);
- if (!Done)
- A1 = Nine + One;
- }
- while (!(Done));
- if (X == One)
- A1 = Radix;
- AInvrse = One / A1;
- X = A1;
- Y = AInvrse;
- Done = False;
- do {
- Z = X * Y - Half;
- TstCond (Failure, Z == Half,
- "X * (1/X) differs from 1");
- Done = X == Radix;
- X = Radix;
- Y = One / X;
- }
- while (!(Done));
- Y2 = One + U2;
- Y1 = One - U2;
- X = OneAndHalf - U2;
- Y = OneAndHalf + U2;
- Z = (X - U2) * Y2;
- T = Y * Y1;
- Z = Z - X;
- T = T - X;
- X = X * Y2;
- Y = (Y + U2) * Y1;
- X = X - OneAndHalf;
- Y = Y - OneAndHalf;
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T <= Zero)) {
- X = (OneAndHalf + U2) * Y2;
- Y = OneAndHalf - U2 - U2;
- Z = OneAndHalf + U2 + U2;
- T = (OneAndHalf - U2) * Y1;
- X = X - (Z + U2);
- StickyBit = Y * Y1;
- S = Z * Y2;
- T = T - Y;
- Y = (U2 - Y) + StickyBit;
- Z = S - (Z + U2 + U2);
- StickyBit = (Y2 + U2) * Y1;
- Y1 = Y2 * Y1;
- StickyBit = StickyBit - Y2;
- Y1 = Y1 - Half;
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero)
- && (StickyBit == Zero) && (Y1 == Half)) {
- RMult = Rounded;
- printf ("Multiplication appears to round correctly.\n");
- } else if ((X + U2 == Zero) && (Y < Zero) && (Z + U2 == Zero)
- && (T < Zero) && (StickyBit + U2 == Zero)
- && (Y1 < Half)) {
- RMult = Chopped;
- printf ("Multiplication appears to chop.\n");
- } else
- printf ("* is neither chopped nor correctly rounded.\n");
- if ((RMult == Rounded) && (GMult == No))
- notify ("Multiplication");
- } else
- printf ("* is neither chopped nor correctly rounded.\n");
- /*=============================================*/
- Milestone = 45;
- /*=============================================*/
- Y2 = One + U2;
- Y1 = One - U2;
- Z = OneAndHalf + U2 + U2;
- X = Z / Y2;
- T = OneAndHalf - U2 - U2;
- Y = (T - U2) / Y1;
- Z = (Z + U2) / Y2;
- X = X - OneAndHalf;
- Y = Y - T;
- T = T / Y1;
- Z = Z - (OneAndHalf + U2);
- T = (U2 - OneAndHalf) + T;
- if (!((X > Zero) || (Y > Zero) || (Z > Zero) || (T > Zero))) {
- X = OneAndHalf / Y2;
- Y = OneAndHalf - U2;
- Z = OneAndHalf + U2;
- X = X - Y;
- T = OneAndHalf / Y1;
- Y = Y / Y1;
- T = T - (Z + U2);
- Y = Y - Z;
- Z = Z / Y2;
- Y1 = (Y2 + U2) / Y2;
- Z = Z - OneAndHalf;
- Y2 = Y1 - Y2;
- Y1 = (F9 - U1) / F9;
- if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero)
- && (Y2 == Zero) && (Y2 == Zero)
- && (Y1 - Half == F9 - Half)) {
- RDiv = Rounded;
- printf ("Division appears to round correctly.\n");
- if (GDiv == No)
- notify ("Division");
- } else if ((X < Zero) && (Y < Zero) && (Z < Zero) && (T < Zero)
- && (Y2 < Zero) && (Y1 - Half < F9 - Half)) {
- RDiv = Chopped;
- printf ("Division appears to chop.\n");
- }
- }
- if (RDiv == Other)
- printf ("/ is neither chopped nor correctly rounded.\n");
- BInvrse = One / Radix;
- TstCond (Failure, (BInvrse * Radix - Half == Half),
- "Radix * ( 1 / Radix ) differs from 1");
- /*=============================================*/
- Milestone = 50;
- /*=============================================*/
- TstCond (Failure, ((F9 + U1) - Half == Half)
- && ((BMinusU2 + U2) - One == Radix - One),
- "Incomplete carry-propagation in Addition");
- X = One - U1 * U1;
- Y = One + U2 * (One - U2);
- Z = F9 - Half;
- X = (X - Half) - Z;
- Y = Y - One;
- if ((X == Zero) && (Y == Zero)) {
- RAddSub = Chopped;
- printf ("Add/Subtract appears to be chopped.\n");
- }
- if (GAddSub == Yes) {
- X = (Half + U2) * U2;
- Y = (Half - U2) * U2;
- X = One + X;
- Y = One + Y;
- X = (One + U2) - X;
- Y = One - Y;
- if ((X == Zero) && (Y == Zero)) {
- X = (Half + U2) * U1;
- Y = (Half - U2) * U1;
- X = One - X;
- Y = One - Y;
- X = F9 - X;
- Y = One - Y;
- if ((X == Zero) && (Y == Zero)) {
- RAddSub = Rounded;
- printf ("Addition/Subtraction appears to round correctly.\n");
- if (GAddSub == No)
- notify ("Add/Subtract");
- } else
- printf ("Addition/Subtraction neither rounds nor chops.\n");
- } else
- printf ("Addition/Subtraction neither rounds nor chops.\n");
- } else
- printf ("Addition/Subtraction neither rounds nor chops.\n");
- S = One;
- X = One + Half * (One + Half);
- Y = (One + U2) * Half;
- Z = X - Y;
- T = Y - X;
- StickyBit = Z + T;
- if (StickyBit != Zero) {
- S = Zero;
- BadCond (Flaw, "(X - Y) + (Y - X) is non zero!\n");
- }
- StickyBit = Zero;
- if ((GMult == Yes) && (GDiv == Yes) && (GAddSub == Yes)
- && (RMult == Rounded) && (RDiv == Rounded)
- && (RAddSub == Rounded) && (FLOOR (RadixD2) == RadixD2)) {
- printf ("Checking for sticky bit.\n");
- X = (Half + U1) * U2;
- Y = Half * U2;
- Z = One + Y;
- T = One + X;
- if ((Z - One <= Zero) && (T - One >= U2)) {
- Z = T + Y;
- Y = Z - X;
- if ((Z - T >= U2) && (Y - T == Zero)) {
- X = (Half + U1) * U1;
- Y = Half * U1;
- Z = One - Y;
- T = One - X;
- if ((Z - One == Zero) && (T - F9 == Zero)) {
- Z = (Half - U1) * U1;
- T = F9 - Z;
- Q = F9 - Y;
- if ((T - F9 == Zero) && (F9 - U1 - Q == Zero)) {
- Z = (One + U2) * OneAndHalf;
- T = (OneAndHalf + U2) - Z + U2;
- X = One + Half / Radix;
- Y = One + Radix * U2;
- Z = X * Y;
- if (T == Zero && X + Radix * U2 - Z == Zero) {
- if (Radix != Two) {
- X = Two + U2;
- Y = X / Two;
- if ((Y - One == Zero))
- StickyBit = S;
- } else
- StickyBit = S;
- }
- }
- }
- }
- }
- }
- if (StickyBit == One)
- printf ("Sticky bit apparently used correctly.\n");
- else
- printf ("Sticky bit used incorrectly or not at all.\n");
- TstCond (Flaw, !(GMult == No || GDiv == No || GAddSub == No ||
- RMult == Other || RDiv == Other || RAddSub == Other),
- "lack(s) of guard digits or failure(s) to correctly round or chop\n\
-(noted above) count as one flaw in the final tally below");
- /*=============================================*/
- Milestone = 60;
- /*=============================================*/
- printf ("\n");
- printf ("Does Multiplication commute? ");
- printf ("Testing on %d random pairs.\n", NoTrials);
- Random9 = SQRT (3.0);
- Random1 = Third;
- I = 1;
- do {
- X = Random ();
- Y = Random ();
- Z9 = Y * X;
- Z = X * Y;
- Z9 = Z - Z9;
- I = I + 1;
- }
- while (!((I > NoTrials) || (Z9 != Zero)));
- if (I == NoTrials) {
- Random1 = One + Half / Three;
- Random2 = (U2 + U1) + One;
- Z = Random1 * Random2;
- Y = Random2 * Random1;
- Z9 = (One + Half / Three) * ((U2 + U1) + One) - (One + Half /
- Three) * ((U2 + U1) + One);
- }
- if (!((I == NoTrials) || (Z9 == Zero)))
- BadCond (Defect, "X * Y == Y * X trial fails.\n");
- else
- printf (" No failures found in %d integer pairs.\n", NoTrials);
- /*=============================================*/
- Milestone = 70;
- /*=============================================*/
- printf ("\nRunning test of square root(x).\n");
- TstCond (Failure, (Zero == SQRT (Zero))
- && (-Zero == SQRT (-Zero))
- && (One == SQRT (One)), "Square root of 0.0, -0.0 or 1.0 wrong");
- MinSqEr = Zero;
- MaxSqEr = Zero;
- J = Zero;
- X = Radix;
- OneUlp = U2;
- SqXMinX (Serious);
- X = BInvrse;
- OneUlp = BInvrse * U1;
- SqXMinX (Serious);
- X = U1;
- OneUlp = U1 * U1;
- SqXMinX (Serious);
- if (J != Zero)
- Pause ();
- printf ("Testing if sqrt(X * X) == X for %d Integers X.\n", NoTrials);
- J = Zero;
- X = Two;
- Y = Radix;
- if ((Radix != One))
- do {
- X = Y;
- Y = Radix * Y;
- }
- while (!((Y - X >= NoTrials)));
- OneUlp = X * U2;
- I = 1;
- while (I <= NoTrials) {
- X = X + One;
- SqXMinX (Defect);
- if (J > Zero)
- break;
- I = I + 1;
- }
- printf ("Test for sqrt monotonicity.\n");
- I = -1;
- X = BMinusU2;
- Y = Radix;
- Z = Radix + Radix * U2;
- NotMonot = False;
- Monot = False;
- while (!(NotMonot || Monot)) {
- I = I + 1;
- X = SQRT (X);
- Q = SQRT (Y);
- Z = SQRT (Z);
- if ((X > Q) || (Q > Z))
- NotMonot = True;
- else {
- Q = FLOOR (Q + Half);
- if ((I > 0) || (Radix == Q * Q))
- Monot = True;
- else if (I > 0) {
- if (I > 1)
- Monot = True;
- else {
- Y = Y * BInvrse;
- X = Y - U1;
- Z = Y + U1;
- }
- } else {
- Y = Q;
- X = Y - U2;
- Z = Y + U2;
- }
- }
- }
- if (Monot)
- printf ("sqrt has passed a test for Monotonicity.\n");
- else {
- BadCond (Defect, "");
- printf ("sqrt(X) is non-monotonic for X near %.7e .\n", Y);
- }
- /*=============================================*/
- Milestone = 80;
- /*=============================================*/
- MinSqEr = MinSqEr + Half;
- MaxSqEr = MaxSqEr - Half;
- Y = (SQRT (One + U2) - One) / U2;
- SqEr = (Y - One) + U2 / Eight;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- SqEr = Y + U2 / Eight;
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- Y = ((SQRT (F9) - U2) - (One - U2)) / U1;
- SqEr = Y + U1 / Eight;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- SqEr = (Y + One) + U1 / Eight;
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- OneUlp = U2;
- X = OneUlp;
- for (Indx = 1; Indx <= 3; ++Indx) {
- Y = SQRT ((X + U1 + X) + F9);
- Y = ((Y - U2) - ((One - U2) + X)) / OneUlp;
- Z = ((U1 - X) + F9) * Half * X * X / OneUlp;
- SqEr = (Y + Half) + Z;
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- SqEr = (Y - Half) + Z;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- if (((Indx == 1) || (Indx == 3)))
- X = OneUlp * Sign (X) * FLOOR (Eight / (Nine * SQRT (OneUlp)));
- else {
- OneUlp = U1;
- X = -OneUlp;
- }
- }
- /*=============================================*/
- Milestone = 85;
- /*=============================================*/
- SqRWrng = False;
- Anomaly = False;
- RSqrt = Other; /* ~dgh */
- if (Radix != One) {
- printf ("Testing whether sqrt is rounded or chopped.\n");
- D = FLOOR (Half + POW (Radix, One + Precision - FLOOR (Precision)));
- /* ... == Radix^(1 + fract) if (Precision == Integer + fract. */
- X = D / Radix;
- Y = D / A1;
- if ((X != FLOOR (X)) || (Y != FLOOR (Y))) {
- Anomaly = True;
- } else {
- X = Zero;
- Z2 = X;
- Y = One;
- Y2 = Y;
- Z1 = Radix - One;
- FourD = Four * D;
- do {
- if (Y2 > Z2) {
- Q = Radix;
- Y1 = Y;
- do {
- X1 = FABS (Q + FLOOR (Half - Q / Y1) * Y1);
- Q = Y1;
- Y1 = X1;
- }
- while (!(X1 <= Zero));
- if (Q <= One) {
- Z2 = Y2;
- Z = Y;
- }
- }
- Y = Y + Two;
- X = X + Eight;
- Y2 = Y2 + X;
- if (Y2 >= FourD)
- Y2 = Y2 - FourD;
- }
- while (!(Y >= D));
- X8 = FourD - Z2;
- Q = (X8 + Z * Z) / FourD;
- X8 = X8 / Eight;
- if (Q != FLOOR (Q))
- Anomaly = True;
- else {
- Break = False;
- do {
- X = Z1 * Z;
- X = X - FLOOR (X / Radix) * Radix;
- if (X == One)
- Break = True;
- else
- Z1 = Z1 - One;
- }
- while (!(Break || (Z1 <= Zero)));
- if ((Z1 <= Zero) && (!Break))
- Anomaly = True;
- else {
- if (Z1 > RadixD2)
- Z1 = Z1 - Radix;
- do {
- NewD ();
- }
- while (!(U2 * D >= F9));
- if (D * Radix - D != W - D)
- Anomaly = True;
- else {
- Z2 = D;
- I = 0;
- Y = D + (One + Z) * Half;
- X = D + Z + Q;
- SR3750 ();
- Y = D + (One - Z) * Half + D;
- X = D - Z + D;
- X = X + Q + X;
- SR3750 ();
- NewD ();
- if (D - Z2 != W - Z2)
- Anomaly = True;
- else {
- Y = (D - Z2) + (Z2 + (One - Z) * Half);
- X = (D - Z2) + (Z2 - Z + Q);
- SR3750 ();
- Y = (One + Z) * Half;
- X = Q;
- SR3750 ();
- if (I == 0)
- Anomaly = True;
- }
- }
- }
- }
- }
- if ((I == 0) || Anomaly) {
- BadCond (Failure, "Anomalous arithmetic with Integer < ");
- printf ("Radix^Precision = %.7e\n", W);
- printf (" fails test whether sqrt rounds or chops.\n");
- SqRWrng = True;
- }
- }
- if (!Anomaly) {
- if (!((MinSqEr < Zero) || (MaxSqEr > Zero))) {
- RSqrt = Rounded;
- printf ("Square root appears to be correctly rounded.\n");
- } else {
- if ((MaxSqEr + U2 > U2 - Half) || (MinSqEr > Half)
- || (MinSqEr + Radix < Half))
- SqRWrng = True;
- else {
- RSqrt = Chopped;
- printf ("Square root appears to be chopped.\n");
- }
- }
- }
- if (SqRWrng) {
- printf ("Square root is neither chopped nor correctly rounded.\n");
- printf ("Observed errors run from %.7e ", MinSqEr - Half);
- printf ("to %.7e ulps.\n", Half + MaxSqEr);
- TstCond (Serious, MaxSqEr - MinSqEr < Radix * Radix,
- "sqrt gets too many last digits wrong");
- }
- /*=============================================*/
- Milestone = 90;
- /*=============================================*/
- Pause ();
- printf ("Testing powers Z^i for small Integers Z and i.\n");
- N = 0;
- /* ... test powers of zero. */
- I = 0;
- Z = -Zero;
- M = 3;
- Break = False;
- do {
- X = One;
- SR3980 ();
- if (I <= 10) {
- I = 1023;
- SR3980 ();
- }
- if (Z == MinusOne)
- Break = True;
- else {
- Z = MinusOne;
- /* .. if(-1)^N is invalid, replace MinusOne by One. */
- I = -4;
- }
- }
- while (!Break);
- PrintIfNPositive ();
- N1 = N;
- N = 0;
- Z = A1;
- M = (int) FLOOR (Two * LOG (W) / LOG (A1));
- Break = False;
- do {
- X = Z;
- I = 1;
- SR3980 ();
- if (Z == AInvrse)
- Break = True;
- else
- Z = AInvrse;
- }
- while (!(Break));
- /*=============================================*/
- Milestone = 100;
- /*=============================================*/
- /* Powers of Radix have been tested, */
- /* next try a few primes */
- M = NoTrials;
- Z = Three;
- do {
- X = Z;
- I = 1;
- SR3980 ();
- do {
- Z = Z + Two;
- }
- while (Three * FLOOR (Z / Three) == Z);
- }
- while (Z < Eight * Three);
- if (N > 0) {
- printf ("Errors like this may invalidate financial calculations\n");
- printf ("\tinvolving interest rates.\n");
- }
- PrintIfNPositive ();
- N += N1;
- if (N == 0)
- printf ("... no discrepancies found.\n");
- if (N > 0)
- Pause ();
- else
- printf ("\n");
- /*=============================================*/
- Milestone = 110;
- /*=============================================*/
- printf ("Seeking Underflow thresholds UfThold and E0.\n");
- D = U1;
- if (Precision != FLOOR (Precision)) {
- D = BInvrse;
- X = Precision;
- do {
- D = D * BInvrse;
- X = X - One;
- }
- while (X > Zero);
- }
- Y = One;
- Z = D;
- /* ... D is power of 1/Radix < 1. */
- do {
- C = Y;
- Y = Z;
- Z = Y * Y;
- }
- while ((Y > Z) && (Z + Z > Z));
- Y = C;
- Z = Y * D;
- do {
- C = Y;
- Y = Z;
- Z = Y * D;
- }
- while ((Y > Z) && (Z + Z > Z));
- if (Radix < Two)
- HInvrse = Two;
- else
- HInvrse = Radix;
- H = One / HInvrse;
- /* ... 1/HInvrse == H == Min(1/Radix, 1/2) */
- CInvrse = One / C;
- E0 = C;
- Z = E0 * H;
- /* ...1/Radix^(BIG Integer) << 1 << CInvrse == 1/C */
- do {
- Y = E0;
- E0 = Z;
- Z = E0 * H;
- }
- while ((E0 > Z) && (Z + Z > Z));
- UfThold = E0;
- E1 = Zero;
- Q = Zero;
- E9 = U2;
- S = One + E9;
- D = C * S;
- if (D <= C) {
- E9 = Radix * U2;
- S = One + E9;
- D = C * S;
- if (D <= C) {
- BadCond (Failure, "multiplication gets too many last digits wrong.\n");
- Underflow = E0;
- Y1 = Zero;
- PseudoZero = Z;
- Pause ();
- }
- } else {
- Underflow = D;
- PseudoZero = Underflow * H;
- UfThold = Zero;
- do {
- Y1 = Underflow;
- Underflow = PseudoZero;
- if (E1 + E1 <= E1) {
- Y2 = Underflow * HInvrse;
- E1 = FABS (Y1 - Y2);
- Q = Y1;
- if ((UfThold == Zero) && (Y1 != Y2))
- UfThold = Y1;
- }
- PseudoZero = PseudoZero * H;
- }
- while ((Underflow > PseudoZero)
- && (PseudoZero + PseudoZero > PseudoZero));
- }
- /* Comment line 4530 .. 4560 */
- if (PseudoZero != Zero) {
- printf ("\n");
- Z = PseudoZero;
- /* ... Test PseudoZero for "phoney- zero" violates */
- /* ... PseudoZero < Underflow or PseudoZero < PseudoZero + PseudoZero
- ... */
- if (PseudoZero <= Zero) {
- BadCond (Failure, "Positive expressions can underflow to an\n");
- printf ("allegedly negative value\n");
- printf ("PseudoZero that prints out as: %g .\n", PseudoZero);
- X = -PseudoZero;
- if (X <= Zero) {
- printf ("But -PseudoZero, which should be\n");
- printf ("positive, isn't; it prints out as %g .\n", X);
- }
- } else {
- BadCond (Flaw, "Underflow can stick at an allegedly positive\n");
- printf ("value PseudoZero that prints out as %g .\n", PseudoZero);
- }
- TstPtUf ();
- }
- /*=============================================*/
- Milestone = 120;
- /*=============================================*/
- if (CInvrse * Y > CInvrse * Y1) {
- S = H * S;
- E0 = Underflow;
- }
- if (!((E1 == Zero) || (E1 == E0))) {
- BadCond (Defect, "");
- if (E1 < E0) {
- printf ("Products underflow at a higher");
- printf (" threshold than differences.\n");
- if (PseudoZero == Zero)
- E0 = E1;
- } else {
- printf ("Difference underflows at a higher");
- printf (" threshold than products.\n");
- }
- }
- printf ("Smallest strictly positive number found is E0 = %g .\n", E0);
- Z = E0;
- TstPtUf ();
- Underflow = E0;
- if (N == 1)
- Underflow = Y;
- I = 4;
- if (E1 == Zero)
- I = 3;
- if (UfThold == Zero)
- I = I - 2;
- UfNGrad = True;
- switch (I) {
- case 1:
- UfThold = Underflow;
- if ((CInvrse * Q) != ((CInvrse * Y) * S)) {
- UfThold = Y;
- BadCond (Failure, "Either accuracy deteriorates as numbers\n");
- printf ("approach a threshold = %.17e\n", UfThold);;
- printf (" coming down from %.17e\n", C);
- printf (" or else multiplication gets too many last digits wrong.\n");
- }
- Pause ();
- break;
-
- case 2:
- BadCond (Failure, "Underflow confuses Comparison, which alleges that\n");
- printf ("Q == Y while denying that |Q - Y| == 0; these values\n");
- printf ("print out as Q = %.17e, Y = %.17e .\n", Q, Y2);
- printf ("|Q - Y| = %.17e .\n", FABS (Q - Y2));
- UfThold = Q;
- break;
-
- case 3:
- X = X;
- break;
-
- case 4:
- if ((Q == UfThold) && (E1 == E0)
- && (FABS (UfThold - E1 / E9) <= E1)) {
- UfNGrad = False;
- printf ("Underflow is gradual; it incurs Absolute Error =\n");
- printf ("(roundoff in UfThold) < E0.\n");
- Y = E0 * CInvrse;
- Y = Y * (OneAndHalf + U2);
- X = CInvrse * (One + U2);
- Y = Y / X;
- IEEE = (Y == E0);
- }
- }
- if (UfNGrad) {
- printf ("\n");
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf)) {
- printf ("Underflow / UfThold failed!\n");
- R = H + H;
- } else
- R = SQRT (Underflow / UfThold);
- sigsave = 0;
- if (R <= H) {
- Z = R * UfThold;
- X = Z * (One + R * H * (One + H));
- } else {
- Z = UfThold;
- X = Z * (One + H * H * (One + H));
- }
- if (!((X == Z) || (X - Z != Zero))) {
- BadCond (Flaw, "");
- printf ("X = %.17e\n\tis not equal to Z = %.17e .\n", X, Z);
- Z9 = X - Z;
- printf ("yet X - Z yields %.17e .\n", Z9);
- printf (" Should this NOT signal Underflow, ");
- printf ("this is a SERIOUS DEFECT\nthat causes ");
- printf ("confusion when innocent statements like\n");;
- printf (" if (X == Z) ... else");
- printf (" ... (f(X) - f(Z)) / (X - Z) ...\n");
- printf ("encounter Division by Zero although actually\n");
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf))
- printf ("X / Z fails!\n");
- else
- printf ("X / Z = 1 + %g .\n", (X / Z - Half) - Half);
- sigsave = 0;
- }
- }
- printf ("The Underflow threshold is %.17e, %s\n", UfThold,
- " below which");
- printf ("calculation may suffer larger Relative error than ");
- printf ("merely roundoff.\n");
- Y2 = U1 * U1;
- Y = Y2 * Y2;
- Y2 = Y * U1;
- if (Y2 <= UfThold) {
- if (Y > E0) {
- BadCond (Defect, "");
- I = 5;
- } else {
- BadCond (Serious, "");
- I = 4;
- }
- printf ("Range is too narrow; U1^%d Underflows.\n", I);
- }
- /*=============================================*/
- Milestone = 130;
- /*=============================================*/
- Y = -FLOOR (Half - TwoForty * LOG (UfThold) / LOG (HInvrse)) / TwoForty;
- Y2 = Y + Y;
- printf ("Since underflow occurs below the threshold\n");
- printf ("UfThold = (%.17e) ^ (%.17e)\nonly underflow ", HInvrse, Y);
- printf ("should afflict the expression\n\t(%.17e) ^ (%.17e);\n",
- HInvrse, Y2);
- printf ("actually calculating yields:");
- if (setjmp (ovfl_buf)) {
- sigsave = 0;
- BadCond (Serious, "trap on underflow.\n");
- } else {
- sigsave = _sigfpe;
- V9 = POW (HInvrse, Y2);
- sigsave = 0;
- printf (" %.17e .\n", V9);
- if (!((V9 >= Zero) && (V9 <= (Radix + Radix + E9) * UfThold))) {
- BadCond (Serious, "this is not between 0 and underflow\n");
- printf (" threshold = %.17e .\n", UfThold);
- } else if (!(V9 > UfThold * (One + E9)))
- printf ("This computed value is O.K.\n");
- else {
- BadCond (Defect, "this is not between 0 and underflow\n");
- printf (" threshold = %.17e .\n", UfThold);
- }
- }
- /*=============================================*/
- Milestone = 140;
- /*=============================================*/
- printf ("\n");
- /* ...calculate Exp2 == exp(2) == 7.389056099... */
- X = Zero;
- I = 2;
- Y = Two * Three;
- Q = Zero;
- N = 0;
- do {
- Z = X;
- I = I + 1;
- Y = Y / (I + I);
- R = Y + Q;
- X = Z + R;
- Q = (Z - X) + R;
- }
- while (X > Z);
- Z = (OneAndHalf + One / Eight) + X / (OneAndHalf * ThirtyTwo);
- X = Z * Z;
- Exp2 = X * X;
- X = F9;
- Y = X - U1;
- printf ("Testing X^((X + 1) / (X - 1)) vs. exp(2) = %.17e as X -> 1.\n",
- Exp2);
- for (I = 1;;) {
- Z = X - BInvrse;
- Z = (X + One) / (Z - (One - BInvrse));
- Q = POW (X, Z) - Exp2;
- if (FABS (Q) > TwoForty * U2) {
- N = 1;
- V9 = (X - BInvrse) - (One - BInvrse);
- BadCond (Defect, "Calculated");
- printf (" %.17e for\n", POW (X, Z));
- printf ("\t(1 + (%.17e) ^ (%.17e);\n", V9, Z);
- printf ("\tdiffers from correct value by %.17e .\n", Q);
- printf ("\tThis much error may spoil financial\n");
- printf ("\tcalculations involving tiny interest rates.\n");
- break;
- } else {
- Z = (Y - X) * Two + Y;
- X = Y;
- Y = Z;
- Z = One + (X - F9) * (X - F9);
- if (Z > One && I < NoTrials)
- I++;
- else {
- if (X > One) {
- if (N == 0)
- printf ("Accuracy seems adequate.\n");
- break;
- } else {
- X = One + U2;
- Y = U2 + U2;
- Y += X;
- I = 1;
- }
- }
- }
- }
- /*=============================================*/
- Milestone = 150;
- /*=============================================*/
- printf ("Testing powers Z^Q at four nearly extreme values.\n");
- N = 0;
- Z = A1;
- Q = FLOOR (Half - LOG (C) / LOG (A1));
- Break = False;
- do {
- X = CInvrse;
- Y = POW (Z, Q);
- IsYeqX ();
- Q = -Q;
- X = C;
- Y = POW (Z, Q);
- IsYeqX ();
- if (Z < One)
- Break = True;
- else
- Z = AInvrse;
- }
- while (!(Break));
- PrintIfNPositive ();
- if (N == 0)
- printf (" ... no discrepancies found.\n");
- printf ("\n");
-
- /*=============================================*/
- Milestone = 160;
- /*=============================================*/
- Pause ();
- printf ("Searching for Overflow threshold:\n");
- printf ("This may generate an error.\n");
- Y = -CInvrse;
- V9 = HInvrse * Y;
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf)) {
- I = 0;
- V9 = Y;
- goto overflow;
- }
- do {
- V = Y;
- Y = V9;
- V9 = HInvrse * Y;
- }
- while (V9 < Y);
- I = 1;
- overflow:
- sigsave = 0;
- Z = V9;
- printf ("Can `Z = -Y' overflow?\n");
- printf ("Trying it on Y = %.17e .\n", Y);
- V9 = -Y;
- V0 = V9;
- if (V - Y == V + V0)
- printf ("Seems O.K.\n");
- else {
- printf ("finds a ");
- BadCond (Flaw, "-(-Y) differs from Y.\n");
- }
- if (Z != Y) {
- BadCond (Serious, "");
- printf ("overflow past %.17e\n\tshrinks to %.17e .\n", Y, Z);
- }
- if (I) {
- Y = V * (HInvrse * U2 - HInvrse);
- Z = Y + ((One - HInvrse) * U2) * V;
- if (Z < V0)
- Y = Z;
- if (Y < V0)
- V = Y;
- if (V0 - V < V0)
- V = V0;
- } else {
- V = Y * (HInvrse * U2 - HInvrse);
- V = V + ((One - HInvrse) * U2) * Y;
- }
- printf ("Overflow threshold is V = %.17e .\n", V);
- if (I)
- printf ("Overflow saturates at V0 = %.17e .\n", V0);
- else
- printf ("There is no saturation value because \
-the system traps on overflow.\n");
- V9 = V * One;
- printf ("No Overflow should be signaled for V * 1 = %.17e\n", V9);
- V9 = V / One;
- printf (" nor for V / 1 = %.17e .\n", V9);
- printf ("Any overflow signal separating this * from the one\n");
- printf ("above is a DEFECT.\n");
- /*=============================================*/
- Milestone = 170;
- /*=============================================*/
- if (!(-V < V && -V0 < V0 && -UfThold < V && UfThold < V)) {
- BadCond (Failure, "Comparisons involving ");
- printf ("+-%g, +-%g\nand +-%g are confused by Overflow.",
- V, V0, UfThold);
- }
- /*=============================================*/
- Milestone = 175;
- /*=============================================*/
- printf ("\n");
- for (Indx = 1; Indx <= 3; ++Indx) {
- switch (Indx) {
- case 1:
- Z = UfThold;
- break;
- case 2:
- Z = E0;
- break;
- case 3:
- Z = PseudoZero;
- break;
- }
- if (Z != Zero) {
- V9 = SQRT (Z);
- Y = V9 * V9;
- if (Y / (One - Radix * E9) < Z
- || Y > (One + Radix * E9) * Z) { /* dgh: + E9 --> * E9 */
- if (V9 > U1)
- BadCond (Serious, "");
- else
- BadCond (Defect, "");
- printf ("Comparison alleges that what prints as Z = %.17e\n", Z);
- printf (" is too far from sqrt(Z) ^ 2 = %.17e .\n", Y);
- }
- }
- }
- /*=============================================*/
- Milestone = 180;
- /*=============================================*/
- for (Indx = 1; Indx <= 2; ++Indx) {
- if (Indx == 1)
- Z = V;
- else
- Z = V0;
- V9 = SQRT (Z);
- X = (One - Radix * E9) * V9;
- V9 = V9 * X;
- if (((V9 < (One - Two * Radix * E9) * Z) || (V9 > Z))) {
- Y = V9;
- if (X < W)
- BadCond (Serious, "");
- else
- BadCond (Defect, "");
- printf ("Comparison alleges that Z = %17e\n", Z);
- printf (" is too far from sqrt(Z) ^ 2 (%.17e) .\n", Y);
- }
- }
- /*=============================================*/
- Milestone = 190;
- /*=============================================*/
- Pause ();
- X = UfThold * V;
- Y = Radix * Radix;
- if (X * Y < One || X > Y) {
- if (X * Y < U1 || X > Y / U1)
- BadCond (Defect, "Badly");
- else
- BadCond (Flaw, "");
-
- printf (" unbalanced range; UfThold * V = %.17e\n\t%s\n",
- X, "is too far from 1.\n");
- }
- /*=============================================*/
- Milestone = 200;
- /*=============================================*/
- for (Indx = 1; Indx <= 5; ++Indx) {
- X = F9;
- switch (Indx) {
- case 2:
- X = One + U2;
- break;
- case 3:
- X = V;
- break;
- case 4:
- X = UfThold;
- break;
- case 5:
- X = Radix;
- }
- Y = X;
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf))
- printf (" X / X traps when X = %g\n", X);
- else {
- V9 = (Y / X - Half) - Half;
- if (V9 == Zero)
- continue;
- if (V9 == -U1 && Indx < 5)
- BadCond (Flaw, "");
- else
- BadCond (Serious, "");
- printf (" X / X differs from 1 when X = %.17e\n", X);
- printf (" instead, X / X - 1/2 - 1/2 = %.17e .\n", V9);
- }
- sigsave = 0;
- }
- /*=============================================*/
- Milestone = 210;
- /*=============================================*/
- MyZero = Zero;
- printf ("\n");
- printf ("What message and/or values does Division by Zero produce?\n");
-#ifndef BATCHMODE
- printf ("This can interupt your program. You can ");
- printf ("skip this part if you wish.\n");
- printf ("Do you wish to compute 1 / 0? ");
- fflush (stdout);
- read (KEYBOARD, ch, 8);
- if ((ch[0] == 'Y') || (ch[0] == 'y')) {
-#endif /* !BATCHMODE */
- sigsave = _sigfpe;
- printf (" Trying to compute 1 / 0 produces ...");
- if (!setjmp (ovfl_buf))
- printf (" %.7e .\n", One / MyZero);
- sigsave = 0;
-#ifndef BATCHMODE
- } else
- printf ("O.K.\n");
- printf ("\nDo you wish to compute 0 / 0? ");
- fflush (stdout);
- read (KEYBOARD, ch, 80);
- if ((ch[0] == 'Y') || (ch[0] == 'y')) {
-#endif /* !BATCHMODE */
- sigsave = _sigfpe;
- printf ("\n Trying to compute 0 / 0 produces ...");
- if (!setjmp (ovfl_buf))
- printf (" %.7e .\n", Zero / MyZero);
- sigsave = 0;
-#ifndef BATCHMODE
- } else
- printf ("O.K.\n");
-#endif /* !BATCHMODE */
- /*=============================================*/
- Milestone = 220;
- /*=============================================*/
-
- Pause ();
- printf ("\n");
- {
- static char *msg[] =
- {
- "FAILUREs encountered =",
- "SERIOUS DEFECTs discovered =",
- "DEFECTs discovered =",
- "FLAWs discovered ="};
- int i;
- for (i = 0; i < 4; i++)
- if (ErrCnt[i])
- printf ("The number of %-29s %d.\n",
- msg[i], ErrCnt[i]);
- }
-
- printf ("\n");
- if ((ErrCnt[Failure] + ErrCnt[Serious] + ErrCnt[Defect]
- + ErrCnt[Flaw]) > 0) {
- if ((ErrCnt[Failure] + ErrCnt[Serious] + ErrCnt[
- Defect] == 0) && (ErrCnt[Flaw] > 0)) {
- printf ("The arithmetic diagnosed seems ");
- printf ("Satisfactory though flawed.\n");
- }
- if ((ErrCnt[Failure] + ErrCnt[Serious] == 0)
- && (ErrCnt[Defect] > 0)) {
- printf ("The arithmetic diagnosed may be Acceptable\n");
- printf ("despite inconvenient Defects.\n");
- }
- if ((ErrCnt[Failure] + ErrCnt[Serious]) > 0) {
- printf ("The arithmetic diagnosed has ");
- printf ("unacceptable Serious Defects.\n");
- }
- if (ErrCnt[Failure] > 0) {
- printf ("Potentially fatal FAILURE may have spoiled this");
- printf (" program's subsequent diagnoses.\n");
- }
- } else {
-
- printf ("No failures, defects nor flaws have been discovered.\n");
- if (!((RMult == Rounded) && (RDiv == Rounded)
- && (RAddSub == Rounded) && (RSqrt == Rounded)))
- printf ("The arithmetic diagnosed seems Satisfactory.\n");
- else {
- if (StickyBit >= One &&
- (Radix - Two) * (Radix - Nine - One) == Zero) {
- printf ("Rounding appears to conform to ");
- printf ("the proposed IEEE standard P");
- if ((Radix == Two) &&
- ((Precision - Four * Three * Two) *
- (Precision - TwentySeven -
- TwentySeven + One) == Zero))
- printf ("754");
- else
- printf ("854");
- if (IEEE)
- printf (".\n");
- else {
- printf (",\nexcept for possibly Double Rounding");
- printf (" during Gradual Underflow.\n");
- }
- }
- printf ("The arithmetic diagnosed appears to be Excellent!\n");
- }
- }
-
- if (fpecount)
- printf ("\nA total of %d floating point exceptions were registered.\n",
- fpecount);
- printf ("END OF TEST.\n");
- return 0;
-}
-
-FLOAT
-Sign (X)
- FLOAT X;
-{
- return X >= 0. ? 1.0 : -1.0;
-}
-
-void
-Pause ()
-{
-#ifndef BATCHMODE
- char ch[8];
-
- printf ("\nTo continue, press RETURN");
- fflush (stdout);
- read (KEYBOARD, ch, 8);
-#endif /* !BATCHMODE */
-#ifndef CYGNUS
- printf ("\nDiagnosis resumes after milestone Number %d", Milestone);
- printf (" Page: %d\n\n", PageNo);
- ++Milestone;
- ++PageNo;
-#endif /* !CYGNUS */
-}
-
-void
-TstCond (K, Valid, T)
- int K, Valid;
- char *T;
-{
-#ifdef CYGNUS
- printf ("TEST: %s\n", T);
-#endif /* CYGNUS */
- if (!Valid) {
- BadCond (K, T);
- printf (".\n");
- }
-#ifdef CYGNUS
- printf ("PASS: %s\n", T);
-#endif /* CYGNUS */
-}
-
-void
-BadCond (K, T)
- int K;
- char *T;
-{
- static char *msg[] =
- {"FAILURE", "SERIOUS DEFECT", "DEFECT", "FLAW"};
-
- ErrCnt[K] = ErrCnt[K] + 1;
-#ifndef CYGNUS
- printf ("%s: %s", msg[K], T);
-#else
- printf ("ERROR: Severity: %s: %s", msg[K], T);
-#endif /* CYGNUS */
-}
-
-/*
- * Random computes
- * X = (Random1 + Random9)^5
- * Random1 = X - FLOOR(X) + 0.000005 * X;
- * and returns the new value of Random1
-*/
-FLOAT
-Random ()
-{
- FLOAT X, Y;
-
- X = Random1 + Random9;
- Y = X * X;
- Y = Y * Y;
- X = X * Y;
- Y = X - FLOOR (X);
- Random1 = Y + X * 0.000005;
- return (Random1);
-}
-
-void
-SqXMinX (ErrKind)
- int ErrKind;
-{
- FLOAT XA, XB;
-
- XB = X * BInvrse;
- XA = X - XB;
- SqEr = ((SQRT (X * X) - XB) - XA) / OneUlp;
- if (SqEr != Zero) {
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- J = J + 1.0;
- BadCond (ErrKind, "\n");
- printf ("sqrt( %.17e) - %.17e = %.17e\n", X * X, X, OneUlp * SqEr);
- printf ("\tinstead of correct value 0 .\n");
- }
-}
-
-void
-NewD ()
-{
- X = Z1 * Q;
- X = FLOOR (Half - X / Radix) * Radix + X;
- Q = (Q - X * Z) / Radix + X * X * (D / Radix);
- Z = Z - Two * X * D;
- if (Z <= Zero) {
- Z = -Z;
- Z1 = -Z1;
- }
- D = Radix * D;
-}
-
-void
-SR3750 ()
-{
- if (!((X - Radix < Z2 - Radix) || (X - Z2 > W - Z2))) {
- I = I + 1;
- X2 = SQRT (X * D);
- Y2 = (X2 - Z2) - (Y - Z2);
- X2 = X8 / (Y - Half);
- X2 = X2 - Half * X2 * X2;
- SqEr = (Y2 + Half) + (Half - X2);
- if (SqEr < MinSqEr)
- MinSqEr = SqEr;
- SqEr = Y2 - X2;
- if (SqEr > MaxSqEr)
- MaxSqEr = SqEr;
- }
-}
-
-void
-IsYeqX ()
-{
- if (Y != X) {
- if (N <= 0) {
- if (Z == Zero && Q <= Zero)
- printf ("WARNING: computing\n");
- else
- BadCond (Defect, "computing\n");
- printf ("\t(%.17e) ^ (%.17e)\n", Z, Q);
- printf ("\tyielded %.17e;\n", Y);
- printf ("\twhich compared unequal to correct %.17e ;\n",
- X);
- printf ("\t\tthey differ by %.17e .\n", Y - X);
- }
- N = N + 1; /* ... count discrepancies. */
- }
-}
-
-void
-SR3980 ()
-{
- do {
- Q = (FLOAT) I;
- Y = POW (Z, Q);
- IsYeqX ();
- if (++I > M)
- break;
- X = Z * X;
- }
- while (X < W);
-}
-
-void
-PrintIfNPositive ()
-{
- if (N > 0)
- printf ("Similar discrepancies have occurred %d times.\n", N);
-}
-
-void
-TstPtUf ()
-{
- N = 0;
- if (Z != Zero) {
- printf ("Since comparison denies Z = 0, evaluating ");
- printf ("(Z + Z) / Z should be safe.\n");
- sigsave = _sigfpe;
- if (setjmp (ovfl_buf))
- goto very_serious;
- Q9 = (Z + Z) / Z;
- printf ("What the machine gets for (Z + Z) / Z is %.17e .\n",
- Q9);
- if (FABS (Q9 - Two) < Radix * U2) {
- printf ("This is O.K., provided Over/Underflow");
- printf (" has NOT just been signaled.\n");
- } else {
- if ((Q9 < One) || (Q9 > Two)) {
- very_serious:
- N = 1;
- ErrCnt[Serious] = ErrCnt[Serious] + 1;
- printf ("This is a VERY SERIOUS DEFECT!\n");
- } else {
- N = 1;
- ErrCnt[Defect] = ErrCnt[Defect] + 1;
- printf ("This is a DEFECT!\n");
- }
- }
- sigsave = 0;
- V9 = Z * One;
- Random1 = V9;
- V9 = One * Z;
- Random2 = V9;
- V9 = Z / One;
- if ((Z == Random1) && (Z == Random2) && (Z == V9)) {
- if (N > 0)
- Pause ();
- } else {
- N = 1;
- BadCond (Defect, "What prints as Z = ");
- printf ("%.17e\n\tcompares different from ", Z);
- if (Z != Random1)
- printf ("Z * 1 = %.17e ", Random1);
- if (!((Z == Random2)
- || (Random2 == Random1)))
- printf ("1 * Z == %g\n", Random2);
- if (!(Z == V9))
- printf ("Z / 1 = %.17e\n", V9);
- if (Random2 != Random1) {
- ErrCnt[Defect] = ErrCnt[Defect] + 1;
- BadCond (Defect, "Multiplication does not commute!\n");
- printf ("\tComparison alleges that 1 * Z = %.17e\n",
- Random2);
- printf ("\tdiffers from Z * 1 = %.17e\n", Random1);
- }
- Pause ();
- }
- }
-}
-
-void
-notify (s)
- char *s;
-{
- printf ("%s test appears to be inconsistent...\n", s);
- printf (" PLEASE NOTIFY KARPINKSI!\n");
-}
-
-void
-msglist (s)
- char **s;
-{
- while (*s)
- printf ("%s\n", *s++);
-}
-
-void
-Instructions ()
-{
- static char *instr[] =
- {
- "Lest this program stop prematurely, i.e. before displaying\n",
- " `END OF TEST',\n",
- "try to persuade the computer NOT to terminate execution when an",
- "error like Over/Underflow or Division by Zero occurs, but rather",
- "to persevere with a surrogate value after, perhaps, displaying some",
- "warning. If persuasion avails naught, don't despair but run this",
- "program anyway to see how many milestones it passes, and then",
- "amend it to make further progress.\n",
- "Answer questions with Y, y, N or n (unless otherwise indicated).\n",
- 0};
-
- msglist (instr);
-}
-
-void
-Heading ()
-{
- static char *head[] =
- {
- "Users are invited to help debug and augment this program so it will",
- "cope with unanticipated and newly uncovered arithmetic pathologies.\n",
- "Please send suggestions and interesting results to",
- "\tRichard Karpinski",
- "\tComputer Center U-76",
- "\tUniversity of California",
- "\tSan Francisco, CA 94143-0704, USA\n",
- "In doing so, please include the following information:",
-#ifdef SINGLE_PRECISION
- "\tPrecision:\tsingle;",
-#else /* !SINGLE_PRECISION */
- "\tPrecision:\tdouble;",
-#endif /* SINGLE_PRECISION */
- "\tVersion:\t10 February 1989;",
- "\tComputer:\n",
- "\tCompiler:\n",
- "\tOptimization level:\n",
- "\tOther relevant compiler options:",
- 0};
-
- msglist (head);
-}
-
-void
-Characteristics ()
-{
- static char *chars[] =
- {
- "Running this program should reveal these characteristics:",
- " Radix = 1, 2, 4, 8, 10, 16, 100, 256 ...",
- " Precision = number of significant digits carried.",
- " U2 = Radix/Radix^Precision = One Ulp",
- "\t(OneUlpnit in the Last Place) of 1.000xxx .",
- " U1 = 1/Radix^Precision = One Ulp of numbers a little less than 1.0 .",
- " Adequacy of guard digits for Mult., Div. and Subt.",
- " Whether arithmetic is chopped, correctly rounded, or something else",
- "\tfor Mult., Div., Add/Subt. and Sqrt.",
- " Whether a Sticky Bit used correctly for rounding.",
- " UnderflowThreshold = an underflow threshold.",
- " E0 and PseudoZero tell whether underflow is abrupt, gradual, or fuzzy.",
- " V = an overflow threshold, roughly.",
- " V0 tells, roughly, whether Infinity is represented.",
- " Comparisions are checked for consistency with subtraction",
- "\tand for contamination with pseudo-zeros.",
- " Sqrt is tested. Y^X is not tested.",
- " Extra-precise subexpressions are revealed but NOT YET tested.",
- " Decimal-Binary conversion is NOT YET tested for accuracy.",
- 0};
-
- msglist (chars);
-}
-
-void
-History ()
-{ /* History */
- /* Converted from Brian Wichmann's Pascal version to C by Thos Sumner,
- with further massaging by David M. Gay. */
-
- static char *hist[] =
- {
- "The program attempts to discriminate among",
- " FLAWs, like lack of a sticky bit,",
- " Serious DEFECTs, like lack of a guard digit, and",
- " FAILUREs, like 2+2 == 5 .",
- "Failures may confound subsequent diagnoses.\n",
- "The diagnostic capabilities of this program go beyond an earlier",
- "program called `MACHAR', which can be found at the end of the",
- "book `Software Manual for the Elementary Functions' (1980) by",
- "W. J. Cody and W. Waite. Although both programs try to discover",
- "the Radix, Precision and range (over/underflow thresholds)",
- "of the arithmetic, this program tries to cope with a wider variety",
- "of pathologies, and to say how well the arithmetic is implemented.",
- "\nThe program is based upon a conventional radix representation for",
- "floating-point numbers, but also allows logarithmic encoding",
- "as used by certain early WANG machines.\n",
- "BASIC version of this program (C) 1983 by Prof. W. M. Kahan;",
- "see source comments for more history.",
- 0};
-
- msglist (hist);
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/phrasen.c b/lib/CPUs/MIPS/bsp/examples/phrasen.c
deleted file mode 100644
index 08abf97..0000000
--- a/lib/CPUs/MIPS/bsp/examples/phrasen.c
+++ /dev/null
@@ -1,298 +0,0 @@
-#include
-#include
-#include "libsys.h"
-
-struct substantive
-{
- char *subst;
- int sex;
-};
-
-struct verben
-{
- char *verb_k;
- char *verb_gr;
- int art;
-};
-
-struct adjektive
-{
- char *adj;
-};
-
- char *art[4]={"er","ie","as","en"};
-
-char getch(void)
-{
- return _getchar();
-}
-
-void randomize(void)
-{
- srand(clock());
-}
-
-struct substantive namen[]=
-{
- {"Gerhard Schröder",1},{"Helmut Kohl",1},{"Rudolf Scharping",1},
- {"Claudia Nolte",2}, {"Johannes Rau",1},{"Wolfgang Schäuble",1},
- {"Joschka Fischer",1},{"Toni Blair",1},{"Kleopatra",2},
- {"Claudia Schiffer",2},{"Hannelore Kohl",2},{"Konrad Adenauer",1},
- {"Michael Jackson",1},{"Karl Marx",1}, {"Helmut Kohl",1},{"Heino",1},
- {"Gerhard Schröder",1},{"Donald Duck",1},{"Madonna",2},{"Jesus",1},
- {"Gott",1},{"Sheryl Crow",2},{"Verona Feldbusch",2},{"Pipi Langstrumpf",2},
- {"Bill Gates",1},{"Bill Clinton",1},{"Cleopatra",2},{"Winnetou",1},
- {"Käpt'n Blaubär",1},{"Rita Süssmuth",2},{"Boris Becker",1},
- {"Lilo Wanders",2},{"Queen Elizabeth",2},{"Lady Di",2},{"Steffi Graf",2},
- {"Frank Zappa",1},{"Dolly Buster",2},{"Mao Tse Tung",1},{"Ghandi",1},
- {"Dalai Lama",1},{"Teufel",1},{"Lenin",1},{"Edmund Stoiber",1},
- {"Ludwig van Beethoven",1},{"Wolfgang Amadeus Mozart",1},
- {"Richard Wagner",1},{"Erich Honecker",1},{"Adam Riese",1},
- {"Bill Clinton",1},{"Josef Stalin",1},{"Willy Brandt",1},
- {"John F. Kennedy",1},{"E.T.",1},{"Donald Duck",1},{"Lothar Matthäus",1},
- {"Hans Dietrich Genscher",1},{"Franz Josef Strauss",1},{"Sting",1},
- {"Hermann Hesse",1},{"Albert Einstein",1},{"Max Planck",1},
- {"Tom Jones",1},{"Heidi Kabel",2},{"Homer Simpson",1},{"Zeus",1},
- {"Helmut Schmidt",1},{"Antje Vollmer",2},{"Politiker",1},{"Papst",1},
- {"Bundeskanzler",1},{"Arzt",1},{"Friseuse",2},{"Teufel",1},
- {"Sandmännchen",3},{"Mutter",2},{"Vater",1},{"Säufer",1},{"Student",1},
- {"Bauer",1},{"Leiche",2},{"Polizist",1},{"Patientin",2},{"Bäcker",1},
- {"Wirt",1}, {"Schlachter",1},{"Baby",3},{"Reporter",1},{"Politiker",1},
- {"Beamtin",2},{"Oma",2},{"Putzfrau",2},{"Blinde",2},{"Wahnsinnige",2},
- {"Mörder",1},{"Psychiater",1},{"Prinz Charles",1},{"Onkel",1},{"Tante",2}
-};
-
-struct substantive sachen[]=
-{
- {"Haus",3},{"Buch",3},{"Fahrrad",3},{"Schule",2},{"Auto",3},{"Nase",2},
- {"Mund",1},{"Kopf",1},{"Kaffee",1},{"Telephon",3},{"Tasse",2},{"Katze",2},
- {"Hund",1},{"Maus",2},{"Stuhl",1},{"Mann",1},{"Frau",2},{"Kind",3},
- {"Idiotin",2},{"Lampe",2},{"Panzer",1},{"Klavier",3},{"Gitarre",2},
- {"Straße",2},{"Wasser",3},{"Luft",2},{"Feuer",3},{"Erde",2},{"Mond",1},
- {"Sonne",2},{"Bild",3},{"Stadt",2},{"Land",3},{"Fluss",1},
- {"Bundeskanzler",1},{"Ball",1},{"Hut",1},{"Hose",2},{"Hemd",3},{"Tod",1},
- {"Geld",3},{"Tisch",1},{"Hand",2},{"Baum",1},{"Bier",3},{"Ratte",2},
- {"Esel",1},{"Musik",2},{"Blech",3},{"Dose",2},{"Zahn",1},{"Humor",1},
- {"Unterhose",2},{"Gift",3},{"Gesicht",3},{"Fuß",1},{"Auge",3},{"Warze",2},
- {"Ohr",3},{"Kanone",2},{"Milch",2},{"Messer",3},{"Papier",3},{"Haar",3},
- {"Welt",2},{"Motor",1},{"Langeweile",2},{"Grab",3},{"Schnaps",1},
- {"Vogel",1},{"Fisch",1},{"Meer",3},{"Banane",2},{"Brot",3},
- {"Sitzung",2},{"Labor",3},{"Kurzschluß",1},{"Lüge",2},{"Axt",2},
- {"Abstimmung",2},{"Toilette",2},{"Zigarette",2},{"Winter",1},
- {"Torte",2},{"Bahnhof",1},{"Sarg",1},{"Imbiss",1},{"Mund",1},{"Seife",2},
- {"Fernseher",1},{"Flasche",2},{"Eimer",1},{"Uhr",2},{"Irrenhaus",3},
- {"Wüste",2},{"Klumpen",1},{"Glück",3},{"Schiff",3},{"Käse",1},{"Quark",1},
- {"Sommer",1},{"Witz",1},{"Idee",2},{"Nacht",2},{"Dreck",1},{"Meer",3},
- {"Blut",3},{"Herz",3},{"Apfel",1},{"Banane",2},{"Mist",1},{"Atom",3},
- {"Note",2},{"Gehirn",3},{"Gefühl",3},{"Bombe",2},{"Vakuum",3},
- {"Zahl",2},{"Wort",3},{"Programm",3},{"Computer",1},{"Orient",1},
- {"Gabelstapler",1}
-};
-
-struct adjektive ad[]=
-{
- {"schön"},{"doof"},{"gut"},{"schlecht"},{"gelb"},{"grün"},{"rot"},
- {"blau"},{"schnell"},{"lang"},{"kurz"},{"hell"},{"düster"},{"sanft"},
- {"hart"},{"langsam"},{"bitter"},{"süß"},{"kaputt"},{"nett"},{"groß"},
- {"klein"},{"leicht"},{"schwer"},{"dick"},{"dünn"},{"rund"},{"eckig"},
- {"heiß"},{"kalt"},{"schlau"},{"elektrisch"},{"nass"},{"trocken"},{"ratlos"},
- {"abartig"},{"genial"},{"bestechlich"},{"irr"},{"steif"},{"angespannt"},
- {"laut"},{"leis"},{"warm"},{"wütend"},{"sauber"},{"schmutzig"},{"arm"},
- {"ätzend"},{"langweilig"},{"interessant"},{"erfahren"},{"abgewählt"},
- {"durchgeknallt"},{"angenehm"},{"widerwärtig"},{"willig"},{"mutig"},
- {"schwach"},{"stark"},{"nervend"},{"spießig"},{"alt"},{"neu"},{"spitz"},
- {"stumpf"},{"teuflisch"},{"scharf"},{"lecker"},{"übelriechend"},{"halb"},
- {"ganz"},{"bleich"},{"peinlich"},{"taktlos"},{"gewieft"},{"windig"},
- {"größenwahnsinnig"},{"verrückt"},{"uralt"},{"aalglatt"},{"korrekt"},
- {"kompetent"},{"einfühlsam"},{"tot"},{"schleimig"},{"gestört"},{"hohl"},
- {"beknackt"},{"nackt"},{"barfüßig"},{"schwitzend"},{"laufend"},{"knackig"},
- {"unverschämt"},{"schläfrig"},{"wohlgeformt"},{"kugelförmig"},{"rauh"},
- {"degeneriert"},{"ekelhaft"},{"brutal"},{"gemein"},{"aggressiv"},
- {"aufdringlich"},{"betroffen"},{"geliebt"},{"gehasst"},{"beharrlich"},
- {"unmenschlich"},{"verblödet"},{"wichtig"},{"gigantisch"},{"winzig"},
- {"witzig"},{"komisch"},{"pervers"},{"fett"},{"stinkend"},{"lausig"},
- {"wendig"},{"breit"},{"locker"},{"einzigartig"},{"sterbend"},{"munter"},
- {"ungepflegt"},{"eisern"},{"echt"},{"besser"},{"wild"},{"ächzend"},
- {"frohlockend"},{"unscheinbar"},{"nebulös"},{"skandalös"},{"obzön"},
- {"beschränkt"},{"genervt"},{"hilflos"},{"unwürdig"},{"geleckt"},
- {"betrunken"},{"unwürdig"},{"bissig"},{"verkalkt"},{"senil"},
- {"jungfräulich"},{"ausgeleiert"},{"beleibt"},{"nachtragend"},{"errötend"},
- {"kahl"},{"würgend"},{"abwesend"},{"ruhig"},{"albern"},{"trostlos"},
- {"salzig"},{"lachend"},{"merkwürdig"},{"behaart"},{"leblos"},{"aufgeblasen"},
- {"frech"},{"kopflos"},{"schmierig"}
-};
-
-struct verben verb[]=
-{
- {"geht","gehen",6},{"steht","stehen",2},{"sitzt","sitzen",2},
- {"spielt","spielen",7},{"singt","singen",2},{"trinkt","trinken",3},
- {"redet","reden",2}, {"liebt","lieben",7},{"schläft","schlafen",2},
- {"ißt","essen",3},{"lacht","lachen",2},{"tötet","töten",7},
- {"lügt","lügen",2},{"fliegt","fliegen",2},{"überfährt","überfahren",7},
- {"sieht","sehen",3},{"hört","hören",3},{"spricht","sprechen",2},
- {"berechnet","rechnen",3},{"schwimmt","schwimmen",2},
- {"zerschneidet","zerschnitten werden",3},{"raucht","rauchen",3},
- {"spaltet","spalten",3},{"verbrennt","verbrennen",2},{"ist","sein",2},
- {"hat","haben",1},{"zerbricht","zerbrechen",3},{"muss","müssen",4},
- {"kann","können",4},{"darf","dürfen",4},{"will","wollen",5},
- {"klaut","klauen",1},{"soll","sollen",4},{"studiert","studieren",3},
- {"reibt","reiben",3},{"liest","lesen",2},{"irrt","irren",2},
- {"spendiert","spendieren",1},{"schlägt","schlagen",3},{"fragt","fragen",7},
- {"zerstört","zerstören",1},{"erschießt","sich erschießen",1},
- {"überlegt","überlegen",2},{"trifft","treffen",7},{"leckt","lecken",1},
- {"wirft","werfen",1},{"vergiftet","vergiftet werden",1},
- {"öffnet","öffnen",1},{"schreit","schreien",2},{"sprengt","explodieren",3},
- {"erwürgt","würgen",7},{"arbeitet","arbeiten",2},{"erlegt","erlegen",1},
- {"putzt","putzen",1},{"stirbt","sterben",2}, {"kauft","kaufen",1},
- {"brüllt","brüllen",2},{"versteht","es verstehen",7},
- {"zertritt","zertreten werden",1},{"verendet","verenden",2},
- {"labert","labern",2},{"kratzt","kratzen",1},{"wird","nichts werden",2},
- {"entkleidet","sich entkleiden",7},{"verbiegt","sich verbiegen",1},
- {"verschenkt","es verschenken",7},{"vergisst","es vergessen",1},
- {"ergreift","greifen",1},{"baut","bauen",1},{"betet","beten",},
- {"rollt","rollen",3},{"bleibt","bleiben",2},{"wäscht","sich waschen",1},
- {"heiratet","heiraten",7},{"hebt","heben",1},{"denkt","nachdenken",2}
-};
-
-void end_sach_aus(void);
-void nam_aus(void);
-void end_nam_aus(void);
-void adj_aus(void);
-int verb_aus_k(void);
-int verb_aus_gr(void);
-int zufall(int);
-
-int main()
-{
- int vindx;
- int rem=0;
- char end;
-
- setbuf(stdout, NULL);
- randomize();
- printf("\n\t\t************************");
- printf("\n\t\t* DER ELEKTRISCHE POET *");
- printf("\n\t\t************************\n");
- printf("\n\tCopyright by J. Ahrensfeld & T. Burr");
- printf("\n\n\tFür die Texte ist Ihr Computer verantwortlich :-)\n");
- printf("\n\tZum beenden des Programmes 'x' eingeben!\n");
- printf("\n\tWeiter mit beliebiger Taste!\n");
- end = getch();
-
- while(end != 'x')
- {
- if(rem >= 10)
- {
- printf("\n\n\tZum beenden des Programmes 'x' eingeben!\n");
- rem = 0;
- if(getch() == 'x')
- break;
- }
- printf("\n\n");
- nam_aus();
-
- vindx=verb_aus_k();
-
- switch (vindx)
- {
- case 1: end_sach_aus(); break;
-
- case 2: adj_aus(); break;
-
- case 3: end_sach_aus(); break;
-
- case 4: verb_aus_gr(); break;
-
- case 5: verb_aus_gr(); break;
-
- case 6: adj_aus(); break;
-
- case 7: end_nam_aus(); break;
- }
-
- printf(".");
- end = getch();
- rem++;
-
- }
- printf("\n\n\tDas ist das Ende!");
- return 0;
-}
-
-int zufall(int max)
-{
-
- return (rand()%max);
-}
-
-void adj_aus(void)
-{
- printf("%s", ad[zufall((sizeof(ad)/sizeof(*ad)))].adj);
- return;
-}
-
-void end_sach_aus(void)
-{
- int index;
-
- index = zufall(sizeof(sachen)/sizeof(*sachen));
- if (sachen[index].sex==1)
- printf("d%s", art[3]);
- else
- printf("d%s", art[(sachen[index].sex)-1]);
- printf(" ");
- adj_aus();
- if (sachen[index].sex==1)
- printf("en %s", sachen[index].subst);
- else
- printf("e %s", sachen[index].subst);
- return;
-}
-
-void nam_aus(void)
-{
- int index;
-
- index = zufall(sizeof(namen)/sizeof(*namen));
- printf("D%s", art[(namen[index].sex)-1]);
- printf(" ");
- adj_aus();
- printf("e %s " ,namen[index].subst);
- return;
-}
-
-void end_nam_aus(void)
-{
- int index;
-
- index = zufall(sizeof(namen)/sizeof(*namen));
- if (namen[index].sex==1)
- printf("d%s", art[3]);
- else
- printf("d%s", art[(namen[index].sex)-1]);
- printf(" ");
- adj_aus();
- if (namen[index].sex==1)
- printf("en %s", namen[index].subst);
- else
- printf("e %s", namen[index].subst);
- return;
-}
-
-int verb_aus_k(void)
-{
- int index;
-
- index = zufall(sizeof(verb)/sizeof(*verb));
- printf("%s ", verb[index].verb_k);
- return (verb[index].art);
-}
-
-int verb_aus_gr(void)
-{
- int index;
-
- index = zufall(sizeof(verb)/sizeof(*verb));
- printf("%s", verb[index].verb_gr);
- return index;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/pi.h b/lib/CPUs/MIPS/bsp/examples/pi.h
deleted file mode 100644
index 5cfed9b..0000000
--- a/lib/CPUs/MIPS/bsp/examples/pi.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* +++Date last modified: 05-Jul-1997 */
-
-#ifndef PI__H
-#define PI__H
-
-#ifndef PI
- #define PI (4*atan(1))
-#endif
-
-#define deg2rad(d) ((d)*PI/180)
-#define rad2deg(r) ((r)*180/PI)
-
-#endif /* PI__H */
diff --git a/lib/CPUs/MIPS/bsp/examples/queens.c b/lib/CPUs/MIPS/bsp/examples/queens.c
deleted file mode 100644
index f9735e6..0000000
--- a/lib/CPUs/MIPS/bsp/examples/queens.c
+++ /dev/null
@@ -1,856 +0,0 @@
-/*
-** Queens.c -- Find solutions to the Eight-Queens chess problem.
-** Roberto Sierra 7/25/93 Version 1.1
-** 3/19/84 Version 1.0
-**
-** Description:
-** This program finds all the possible ways that N queens can
-** be placed on an NxN chessboard so that the queens cannot
-** capture one another -- that is, so that no rank, file or
-** diagonal is occupied by more than one queen. By default,
-** the program prints the first solution it finds. You can
-** use the -a option to print all solutions, or the -c option
-** just to count them. The program allows the chess board
-** to be from 1x1 (trivial case) to 100x100. Warning: the
-** larger the chess board, the longer it typically takes to
-** find each solution, even though there may be more of them.
-**
-** This is a terrific example of the utility of recursion. The
-** algorithm uses recursion to drastically limit the number
-** of board positions that are tested. The program is able
-** to find all 8x8 queen solutions in a fraction of a second
-** (not counting print time). The code makes no attempt to
-** eliminate symmetrical solutions, so the number of solutions
-** reported will always be higher than the actual number of
-** distinct solutions.
-**
-**
-** Usage:
-** Queens [-ac] n
-**
-** n number of queens (rows and columns).
-** An integer from 1 to 100.
-** -a Find (and print) all solutions.
-** -c Count all solutions, but do not print them.
-**
-** The output is sent to stdout. All errors messages are
-** sent to stderr. If a problem arises, the return code is -1.
-**
-**
-** Examples:
-**
-** Queens 8 ## Show an 8x8 solution
-** 8 queens on a 8x8 board...
-** Q - - - - - - -
-** - - - - Q - - -
-** - - - - - - - Q
-** - - - - - Q - -
-** - - Q - - - - -
-** - - - - - - Q -
-** - Q - - - - - -
-** - - - Q - - - -
-**
-** Queens -c 8 ## Count all 8x8 solutions
-** 8 queens on a 8x8 board...
-** ...there are 92 solutions.
-**
-** Queens -a 4 ## Show all 4x4 solutions
-** 4 queens on a 4x4 board...
-**
-** Solution #1:
-** - Q - -
-** - - - Q
-** Q - - -
-** - - Q -
-**
-** Solution #2:
-** - - Q -
-** Q - - -
-** - - - Q
-** - Q - -
-**
-** ...there are 2 solutions.
-**
-**
-** Build Instructions:
-** You'll need an ANSI C compiler (or the willingness to edit
-** the program a bit). If you've got Gnu C, then you can
-** compile and load the program as follows:
-**
-** gcc Queens.c -ansi -o Queens
-**
-** [If you're using MPW on the Mac, define '-d MPW' on the
-** compile line so that background processing will occur.]
-**
-**
-** Algorithm:
-** In a 1984 Byte article, I ran across an interesting letter
-** from a high school student who was attempting to solve the
-** Eight Queens problem using a BASIC interpreter. He had
-** developed a program which placed eight queens successively
-** on all sixty-four squares, testing for conflicts at each
-** iteration. Of course, such a program would require 64^8
-** iterations (about 2.8x10^14 iterations). Even in C on a,
-** fast CPU, this could take months or years. Byte's answer was
-** to alter the loops so that the queens resided on separate
-** ranks, thereby reducing the number of iterations required
-** to find all solutions to 8^8 iterations (about 16 million).
-** More reasonable, but still requiring a chunk of CPU time.
-**
-** I puzzled about this problem a bit, and came to realize that
-** this was still wasting a lot of CPU cycles. Though I'm sure
-** others have come up with good algorithms, I decided to come
-** up with my own, with a particular eye on efficiency. The
-** resulting algorithm finds all 8x8 solutions in a fraction
-** of a second (there are 92 solutions, including rotations).
-** On a Sun 4, it'll find all 365,596 solutions on a 14x14 board
-** in a bit over 2 minutes (printing them out requires extra
-** time, of course). Even Byte's solution would require 14^14
-** iterations (about 10^16) which would take aeons.
-**
-** My algorithm works as follows:
-** (1) Place a queen in the top left corner.
-** (2) Place another queen immediately below.
-** (3) Test for conflicts. If the second queen conflicts (it
-** does at first), then move it one square to the right.
-** (4) Loop step 3 until there are no conflicts. Place
-** the next queen on the board and recurse.
-** (5) If any queen reaches the right edge of the board,
-** remove it and 'pop' to the previous recursion level.
-** (6) Now repeat these steps recursively until all eight
-** queens (or however many) have been placed without
-** conflict -- the result is a solution to the problem,
-** which is counted and optionally printed.
-**
-** Because conflicts are tested as the recursion proceeds,
-** this has the effect of 'pruning' the recursion so that
-** a large number of board positions are not even attempted.
-** The result is that the algorithm runs in reasonable time.
-**
-** I used a few tricks to make the test-for-conflict code
-** extremely efficient -- there is no 'inner' loop to search
-** along ranks, files, or diagonals. A series of arrays are
-** maintained instead which indicate which queen currently
-** 'owns' each rank, file or diagonal. This makes the
-** algorithm really fly, though the code is a little hard to
-** read. Lastly, pointer arithmetic is used to reduce the
-** number of implicit multiplications used in array addressing.
-**
-**
-** Contact:
-** For queries regarding this program, contact Roberto Sierra
-** at any of the following addresses:
-**
-** Roberto Sierra
-** bert@netcom.com (preferred address)
-** 73557.2101@compuserve.com
-**
-** Tempered MicroDesigns
-** P.O. Box 170638
-** San Francisco, CA 94117
-**
-**
-** Fine Print:
-** This program is in the public domain and can be used for
-** any purpose whatsoever, including commercial application.
-** [I'd like to hear what you do with it, though.]
-** Absolutely no warranty or liability is implied or extended
-** by the author.
-**
-**
-** Modification History:
-** PRS 3/19/84 v1.0 -- Original version.
-** PRS 7/25/93 v1.1 -- ANSIfied the code. More efficient pointers.
-**
-*/
-
-/***************************************************************/
-/* Timer options. You MUST uncomment one of the options below */
-/* or compile, for example, with the '-DUNIX' option. */
-/***************************************************************/
-/* #define Amiga */
-/* #define UNIX */
-/* #define UNIX_Old */
-/* #define VMS */
-/* #define BORLAND_C */
-/* #define MSC */
-/* #define MAC */
-/* #define IPSC */
-/* #define FORTRAN_SEC */
-/* #define GTODay */
-/* #define CTimer */
-/* #define UXPM */
-/* #define MAC_TMgr */
-/* #define PARIX */
-/* #define POSIX */
-/* #define WIN32 */
-/* #define POSIX1 */
-/***********************/
-
-#include /* Need standard I/O functions */
-#include /* Need exit() routine interface */
-#include /* Need strcmp() interface */
-#ifdef MPW /* Macintosh MPW ONLY */
-#include /* Need cursor control interfaces */
-#endif
-
-#define MAXQUEENS 100 /* Maximum number of queens */
-#define MAXRANKS MAXQUEENS /* Maximum number of ranks (rows) */
-#define MAXFILES MAXQUEENS /* Maximum number of files (columns) */
-#define MAXDIAGS (MAXRANKS+MAXFILES-1) /* Maximum number of diagonals */
-#define EMPTY (MAXQUEENS+1) /* Marks unoccupied file or diagonal */
-
-/* GLOBAL VARIABLES */
-
-int queens; /* Number of queens to place */
-int ranks; /* Number of ranks (rows) */
-int files; /* Number of files (columns) */
-int printing = 1; /* TRUE if printing positions */
-int findall = 0; /* TRUE if finding all solutions */
-
-unsigned long solutions = 0; /* Number of solutions found */
-int queen[MAXRANKS]; /* File on which each queen is located */
-int file[MAXFILES]; /* Which queen 'owns' each file */
-int fordiag[MAXDIAGS]; /* Which queen 'owns' forward diagonals */
-int bakdiag[MAXDIAGS]; /* Which queen 'owns' reverse diagonals */
-char *progname = 0; /* The name of this program */
-
-
-
-
-
-/***********************/
-/**** ROUTINES ****/
-/***********************/
-
-/* Internal prototypes */
-//void main(int argc,char **argv); /* Main program */
-void find(int level); /* Algorithm to find solutions */
-void pboard(void); /* Print a solution */
-void run_queens(int argc,char **argv);
-
-
-
-
-/*---------------------- main() ---------------------------
-** MAIN program. The main purpose of this routine is
-** to deal with decoding the command line arguments,
-** initializing the various arrays, and starting the
-** recursive search routine.
-*/
-int main(void)
-{
- char *args[] = {"queens", "-c", "12"};
- run_queens(3, args);
-}
-
-void run_queens(int argc,char **argv)
-{
- register int i; /* Loop variable */
- register char *p; /* Pointer to argument */
- double starttime, benchtime, dtime();
-
-#ifdef MPW /* Macintosh MPW ONLY */
- InitCursorCtl(0); /* Enable cursor control */
-#endif
-
- progname = argv[0]; /* The name of the program */
-
- /**** DECODE COMMAND LINE ARGUMENTS ****/
-
- for (i=1; i MAXQUEENS) { /* N can't be too large */
- fprintf(stderr,"%s: can't have more than %d queens\n",
- progname, MAXQUEENS);
- exit(-1);
- }
- } /* End of argument test */
- } /* End of argument scan loop */
- if (queens == 0) {
- fprintf(stderr,"%s: missing queens argument\n",progname);
- fprintf(stderr,"usage: %s [-ac] queens\n",progname);
- exit(-1);
- }
-
-
- ranks = files = queens; /* NxN board for N queens */
- printf("%d queen%s on a %dx%d board...\n",
- queens, queens>1? "s" : "", ranks, files);
- fflush(stdout);
-
- starttime = dtime();
-
- /* Initialization */
- solutions = 0; /* No solutions yet */
- for (i=0; i= level && /* No queen on the file? */
- *fdp >= level && *bdp >= level /* No queens on diagonals? */
- ) {
- queen[level] = f; /* Note new position of queen */
- *fp = *fdp = *bdp = level; /* Place queen on file & diags */
- find(level+1); /* This level OK, recurse to next */
- *fp = *fdp = *bdp = EMPTY; /* Remove queen from file & diags */
- } /* End of conflict test */
- } /* End of file loop */
- } /* End if (level == queens) */
-} /* End of find() */
-
-
-
-
-/*------------------------- pboard() -----------------------
-** This routines prints the board for a particular solution.
-** The output is sent to stdout.
-*/
-
-void pboard(void)
-{
- register int i,j; /* Rank/File indices */
-
- if (findall) { /* Only if searching for all */
- printf("\nSolution #%lu:\n",solutions); /* Print solution number */
- }
- for (i=0; i
-#define HZ 50
-
-double dtime()
-{
- double q;
-
- struct tt
- {
- long days;
- long minutes;
- long ticks;
- } tt;
-
- DateStamp(&tt);
-
- q = ((double)(tt.ticks + (tt.minutes * 60L * 50L))) / (double)HZ;
-
- return q;
-}
-#endif
-
-/*****************************************************/
-/* UNIX dtime(). This is the preferred UNIX timer. */
-/* Provided by: Markku Kolkka, mk59200@cc.tut.fi */
-/* HP-UX Addition by: Bo Thide', bt@irfu.se */
-/*****************************************************/
-#ifdef UNIX
-#include
-#include
-
-#ifdef hpux
-#include
-#define getrusage(a,b) syscall(SYS_getrusage,a,b)
-#endif
-
-struct rusage rusage;
-
-double dtime()
-{
- double q;
-
- getrusage(RUSAGE_SELF,&rusage);
-
- q = (double)(rusage.ru_utime.tv_sec);
- q = q + (double)(rusage.ru_utime.tv_usec) * 1.0e-06;
-
- return q;
-}
-#endif
-
-/***************************************************/
-/* UNIX_Old dtime(). This is the old UNIX timer. */
-/* Make sure HZ is properly defined in param.h !! */
-/***************************************************/
-#ifdef UNIX_Old
-#include
-#include
-#include
-
-#ifndef HZ
-#define HZ 60
-#endif
-
-struct tms tms;
-
-double dtime()
-{
- double q;
-
- times(&tms);
-
- q = (double)(tms.tms_utime) / (double)HZ;
-
- return q;
-}
-#endif
-
-/*********************************************************/
-/* VMS dtime() for VMS systems. */
-/* Provided by: RAMO@uvphys.phys.UVic.CA */
-/* Some people have run into problems with this timer. */
-/*********************************************************/
-#ifdef VMS
-#include time
-
-#ifndef HZ
-#define HZ 100
-#endif
-
-struct tbuffer_t
- {
- int proc_user_time;
- int proc_system_time;
- int child_user_time;
- int child_system_time;
- };
-
-struct tbuffer_t tms;
-
-double dtime()
-{
- double q;
-
- times(&tms);
-
- q = (double)(tms.proc_user_time) / (double)HZ;
-
- return q;
-}
-#endif
-
-/******************************/
-/* BORLAND C dtime() for DOS */
-/******************************/
-#ifdef BORLAND_C
-#include
-#include
-#include
-
-#define HZ 100
-struct time tnow;
-
-double dtime()
-{
- double q;
-
- gettime(&tnow);
-
- q = 60.0 * (double)(tnow.ti_min);
- q = q + (double)(tnow.ti_sec);
- q = q + (double)(tnow.ti_hund)/(double)HZ;
-
- return q;
-}
-#endif
-
-/**************************************/
-/* Microsoft C (MSC) dtime() for DOS */
-/**************************************/
-#ifdef MSC
-#include
-#include
-
-#define HZ CLOCKS_PER_SEC
-clock_t tnow;
-
-double dtime()
-{
- double q;
-
- tnow = clock();
-
- q = (double)tnow / (double)HZ;
-
- return q;
-}
-#endif
-
-/*************************************/
-/* Macintosh (MAC) Think C dtime() */
-/*************************************/
-#ifdef MAC
-#include
-
-#define HZ 60
-
-double dtime()
-{
- double q;
-
- q = (double)clock() / (double)HZ;
-
- return q;
-}
-#endif
-
-/************************************************************/
-/* iPSC/860 (IPSC) dtime() for i860. */
-/* Provided by: Dan Yergeau, yergeau@gloworm.Stanford.EDU */
-/************************************************************/
-#ifdef IPSC
-extern double dclock();
-
-double dtime()
-{
- double q;
-
- q = dclock();
-
- return q;
-}
-#endif
-
-/**************************************************/
-/* FORTRAN dtime() for Cray type systems. */
-/* This is the preferred timer for Cray systems. */
-/**************************************************/
-#ifdef FORTRAN_SEC
-
-fortran double second();
-
-double dtime()
-{
- double q;
-
- second(&q);
-
- return q;
-}
-#endif
-
-/***********************************************************/
-/* UNICOS C dtime() for Cray UNICOS systems. Don't use */
-/* unless absolutely necessary as returned time includes */
-/* 'user+system' time. Provided by: R. Mike Dority, */
-/* dority@craysea.cray.com */
-/***********************************************************/
-#ifdef CTimer
-#include
-
-double dtime()
-{
- double q;
- clock_t clock(void);
-
- q = (double)clock() / (double)CLOCKS_PER_SEC;
-
- return q;
-}
-#endif
-
-/********************************************/
-/* Another UNIX timer using gettimeofday(). */
-/* However, getrusage() is preferred. */
-/********************************************/
-#ifdef GTODay
-#include
-
-struct timeval tnow;
-
-double dtime()
-{
- double q;
-
- gettimeofday(&tnow,NULL);
- q = (double)tnow.tv_sec + (double)tnow.tv_usec * 1.0e-6;
-
- return q;
-}
-#endif
-
-/*****************************************************/
-/* Fujitsu UXP/M timer. */
-/* Provided by: Mathew Lim, ANUSF, M.Lim@anu.edu.au */
-/*****************************************************/
-#ifdef UXPM
-#include
-#include
-struct tmsu rusage;
-
-double dtime()
-{
- double q;
-
- timesu(&rusage);
-
- q = (double)(rusage.tms_utime) * 1.0e-06;
-
- return q;
-}
-#endif
-
-/**********************************************/
-/* Macintosh (MAC_TMgr) Think C dtime() */
-/* requires Think C Language Extensions or */
-/* #include in the prefix */
-/* provided by Francis H Schiffer 3rd (fhs) */
-/* skipschiffer@genie.geis.com */
-/**********************************************/
-#ifdef MAC_TMgr
-#include
-#include
-
-static TMTask mgrTimer;
-static Boolean mgrInited = false;
-static double mgrClock;
-
-#define RMV_TIMER RmvTime( (QElemPtr)&mgrTimer )
-#define MAX_TIME 1800000000L
-/* MAX_TIME limits time between calls to */
-/* dtime( ) to no more than 30 minutes */
-/* this limitation could be removed by */
-/* creating a completion routine to sum */
-/* 30 minute segments (fhs 1994 feb 9) */
-
-static void Remove_timer( )
-{
- RMV_TIMER;
- mgrInited = false;
-}
-
-double dtime( )
-{
- if( mgrInited ) {
- RMV_TIMER;
- mgrClock += (MAX_TIME + mgrTimer.tmCount)*1.0e-6;
- } else {
- if( _atexit( &Remove_timer ) == 0 ) mgrInited = true;
- mgrClock = 0.0;
- }
-
- if ( mgrInited )
- {
- mgrTimer.tmAddr = NULL;
- mgrTimer.tmCount = 0;
- mgrTimer.tmWakeUp = 0;
- mgrTimer.tmReserved = 0;
- InsTime( (QElemPtr)&mgrTimer );
- PrimeTime( (QElemPtr)&mgrTimer, -MAX_TIME );
- }
- return( mgrClock );
-}
-#endif
-
-/***********************************************************/
-/* Parsytec GCel timer. */
-/* Provided by: Georg Wambach, gw@informatik.uni-koeln.de */
-/***********************************************************/
-#ifdef PARIX
-#include
-
-double dtime()
-{
- double q;
-
- q = (double) (TimeNowHigh()) / (double) CLK_TCK_HIGH;
-
- return q;
-}
-#endif
-
-/************************************************/
-/* Sun Solaris POSIX dtime() routine */
-/* Provided by: Case Larsen, CTLarsen.lbl.gov */
-/************************************************/
-#ifdef POSIX
-#include
-#include
-#include
-
-#ifdef __hpux
-#include
-#endif
-
-struct rusage rusage;
-
-double dtime()
-{
- double q;
-
- getrusage(RUSAGE_SELF,&rusage);
-
- q = (double)(rusage.ru_utime.tv_sec);
- q = q + (double)(rusage.ru_utime.tv_nsec) * 1.0e-09;
-
- return q;
-}
-#endif
-
-
-/****************************************************/
-/* Windows NT (32 bit) dtime() routine */
-/* Provided by: Piers Haken, piersh@microsoft.com */
-/****************************************************/
-#ifdef WIN32
-#include
-
-double dtime(void)
-{
- double q;
-
- q = (double)GetTickCount() * 1.0e-03;
-
- return q;
-}
-#endif
-
-/*****************************************************/
-/* Time according to POSIX.1 - */
-/* Ref: "POSIX Programmer's Guide" O'Reilly & Assoc.*/
-/*****************************************************/
-#ifdef POSIX1
-#define _POSIX_SOURCE 1
-#include
-#include
-#include
-
-struct tms tms;
-
-double dtime()
-{
- double q;
- times(&tms);
- q = (double)tms.tms_utime / (double)CLK_TCK;
- return q;
-}
-#endif
-
-/*-------- End of queens.c, Say goodnight Linda! --------*/
diff --git a/lib/CPUs/MIPS/bsp/examples/r3.c b/lib/CPUs/MIPS/bsp/examples/r3.c
deleted file mode 100644
index adba0bc..0000000
--- a/lib/CPUs/MIPS/bsp/examples/r3.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- * IOCCC Raytracer by Anders Gavare.
- *
- * The raytracer was one of the winners of the 17th IOCCC.
- *
- * NOTE: This is the UNOBFUSCATED version of the raytracer I used
- * during development, not the actual entry sent to the contest.
- *
- *
- * How to build:
- * cc r3.c -o r3 (plus optimization flags)
- *
- * How to run:
- * ./r3 > ray.ppm
- * or
- * ./r3 | xv -
- */
-#include "libsys.h"
-UINT32 *pP;
-
-xsize = 800;
-ysize = 600;
-An = 1;
-
-camera_X = 0;
-camera_Y = -10;
-camera_Z = -7;
-
-scale = 1296;
-RootOfScale = 36;
-maxcolor = 255;
-
-MaxDepth=9;
-_=1<<15;
-
-/*
-double sphere_x[44] = {
- -15,-15,-15,-15, // I
- -8,-8,-10,-6,-10,-6, // O
- -1,-1, 1,1, // C
- 6, 6, 8,8, // C
- 13,13,15,15, // C
- -11,-11,-11,-11,-9,-9,-7,-7, // r
- 0,0,-2,-2,-2,2,2,2, // a
- 7,7,9,9,11,11, // y
- };
-double sphere_z[44] = {
- 3,0,-3,-6, // I
- -6, 3,0,0,-3,-3, // O
- 0,-3,-6, 3, // C
- 0,-3,-6, 3, // C
- 0,-3,-6, 3, // C
- -11,-13,-15,-17,-11,-15,-13,-17, // r
- -11,-15,-13,-15,-17,-13,-15,-17, // a
- -11,-13,-15,-17,-11,-13, // y
- };
-*/
-
-/* Common return variable: */
-return_var;
-return_var2;
-return_var3;
-return_var4;
-
-
-get_sphere_coordinates(b)
-{
- return_var = "1111886:6:??AAFFHHMMOO55557799@@>>>BBBGGIIKK"[b]-64;
- return_var3 = "C@=::C@@==@=:C@=:C@=:C531/513/5131/31/531/53"[b]-64;
-
-/* return_var = sphere_x[b]; */
- return_var2 = b<22? 9 : 0;
-/* return_var3 = sphere_z[b]; */
- return_var4 = 2;
-}
-
-
-/* sqroot(x) returns the square root of x in return_var */
-sqroot_sub(x, mask, guess)
-{
- mask?
- (
- guess ^= mask,
- guess*guess > x ?
- ( guess ^= mask )
- :
- 0,
- sqroot_sub(x, mask/2, guess)
- )
- :
- ( return_var = guess );
-}
-
-
-sqroot(x)
-{
- sqroot_sub(x, _, 0);
-}
-
-
-/*
- * hit_sphere():
- *
- * returns where on a sphere we hit
- * Returns distance in hit_sphere_q. (Negative return
- * value if we didn't hit anything.)
- */
-hit_sphere_q;
-hit_sphere(objnr, x, y, z,
- dx, dy, dz,
- a, b)
-{
- get_sphere_coordinates(objnr);
- x -= return_var*scale;
- y -= return_var2*scale;
- z -= return_var3*scale;
-
- /*
- * Solve the following equation:
- *
- * q^2 (dx^2+dy^2+dz^2) + q * 2(x*dx+y*dy+z*dz)
- * + x^2+y^2+z^2 - r^2 = 0
- *
- * We assume that |dx,dy,dz| is 1.
- *
- * q^2 + a q + b = 0
- *
- * The solution is (of course)
- *
- * q = -a/2 +- sqrt(a^2/4 - b)
- */
-
- b = x*x/scale+y*y/scale+z*z/scale-return_var4*return_var4*scale;
-
- /* a = 2*(...), and then divide by -2 */
- a = -x*dx/scale-y*dy/scale-z*dz/scale;
-
- hit_sphere_q =
- (
- (b = a*a/scale - b) >= 0 ?
- (
-/* b = scale*sqrt((double)b/(double)scale), */
-/* sqroot(b*scale), */
-
-/* sqroot_sub(b, _, 0),
- b = return_var * RootOfScale,
-*/
- sqroot_sub(b*scale, _, 0),
- b = return_var,
-
- /*
- * Return the lowest q (a+b or a-b) which is more
- * than 0. Return negative if neither
- * a+b or a-b is more than 0.
- */
-
- a + (a>b? -b : b)
- )
- :
- -1.0
- );
-}
-
-
-/*
- * find_closest():
- *
- * find_closest() scans objects and returns an index
- * to the object which was closest (has the lowest 'q').
- * x,y,z,dx,dy,dz are scaled.
- * find_closest_i is the index number of the found object,
- * -1 if none was found. find_closest_q is the distance
- * (scaled).
- */
-find_closest_i; /* index ("sphere number") */
-find_closest_q; /* distance (scaled) */
-find_closest(objnr, x, y, z,
- dx, dy, dz, notindex)
-{
- /* Initialize find_closest_i on first call: */
- find_closest_i =
- !objnr ? -1 : find_closest_i;
-
- objnr < 44 ?
- (
- hit_sphere(objnr, x,y,z, dx,dy,dz, 0,0),
- (hit_sphere_q > 0 && objnr!=notindex &&
- (hit_sphere_q0 && find_closest_i >= 0?
- (
- /* find_closest_i and _q are the object
- number and distance of the object we
- hit. */
-
- orig_x += dir_x*find_closest_q/scale,
- orig_y += dir_y*find_closest_q/scale,
- orig_z += dir_z*find_closest_q/scale,
-
- /*
- * Calculate color (diffuse light):
- * (Note: use nZ as a temp variable while
- * calculating nY)
- */
- get_sphere_coordinates(find_closest_i),
- nX = orig_x - return_var*scale,
- nY = orig_y - return_var2*scale,
- nZ = orig_z - return_var3*scale,
-
- tmpcol = (-2*nX -2*nY + nZ) / 3, /* sqrt(9), */
- /* Set return_var to the length of the normal
- vector (in this case the sphere radius) */
-/* return_var = sqrt(nX*nX + nY*nY +nZ*nZ), */
- sqroot(nX*nX + nY*nY +nZ*nZ),
-// return_var = return_var4*scale,
- /* divide by return_var to get the color */
-// tmpcol = return_var!=0? tmpcol*scale/return_var : 0,
- tmpcol /= return_var4,
-
- /* color is now -1..1 */
- tmpcol *= tmpcol, /* square the color 1..-1 => 1..1 */
- tmpcol *= 200,
- tmpcol /= (scale*scale),
-/* tmpcol += 5, */
-
- closest_i_saved = find_closest_i,
-
- /* Mirror: out = in - 2*(-normal)*cos v
- where v is the angle between in and
- -normal */
-
- /* -normal: (normalized to len=1.0) */
-/* return_var = sqrt(nX*nX + nY*nY + nZ*nZ), */
- return_var!=0?
- (
- nX = -nX * scale / return_var,
- nY = -nY * scale / return_var,
- nZ = -nZ * scale / return_var
- ) : 0,
-
- /* use return_var as a temp variable,
- calculate cosinus between the vectors */
- return_var = (dir_x*nX + dir_y*nY + dir_z*nZ)/scale,
-/*
- dir_x -= 2 * nX * return_var / scale,
- dir_y -= 2 * nY * return_var / scale,
- dir_z -= 2 * nZ * return_var / scale,
-*/
- dir_x -= nX * return_var / (scale/2),
- dir_y -= nY * return_var / (scale/2),
- dir_z -= nZ * return_var / (scale/2),
-
- trace_ray(orig_x, orig_y, orig_z,
- dir_x, dir_y, dir_z,
- depth-1, find_closest_i, 0,0),
-
- trace_ray_R /= 2,
- trace_ray_G /= 2,
- trace_ray_B /= 2,
-/*
- closest_i_saved &= 7,
- !closest_i_saved? (closest_i_saved++) : 0,
-*/
-/*
- closest_i_saved = closest_i_saved<4? closest_i_saved+1 : 7,
-*/
-/*
- tvinga gråskalor: closest_i_saved = 7,
-*/
-closest_i_saved = closest_i_saved<22? 7 :
- (
- closest_i_saved<30 ? 1 :
- (
- closest_i_saved<38 ? 2 :
- (
- closest_i_saved<44 ? 4 :
- (
- closest_i_saved == 44 ? 6 :
- 3
- )
- )
- )
- ),
-
- trace_ray_R += closest_i_saved & 1 ? tmpcol : 0,
- trace_ray_G += closest_i_saved & 2 ? tmpcol : 0,
- trace_ray_B += closest_i_saved & 4 ? tmpcol : 0
- )
- :
- (
- /* If we didn't hit anything, set the color anyway: */
-
- depth==MaxDepth? /* True if this is a ray originating
- from the camera */
- (
- orig_z += 2,
- dir_z = orig_z > 0? orig_z / 8 : orig_z / 20
- )
- : 0,
-
- /*
- * Colors according to Horizon_1 in gimp:
- * At top of sky: 13,92,146 (light blue)
- * At bottom sky: 255,255,255 (white)
- * Top of ground: 213,168,111 (light brown)
- * Bottom of ground: 103, 55, 26 (brown)
- */
-
- dir_z > 0?
- (
- trace_ray_B = dir_z * dir_z / scale,
- trace_ray_R = 255 - 250 * trace_ray_B / scale,
- trace_ray_G = 255 - 150 * trace_ray_B / scale,
- trace_ray_B = 255 - 100 * trace_ray_B / scale
- )
- :
- (
- trace_ray_B = dir_z * dir_z / scale,
- trace_ray_B < scale/5?
- (
- trace_ray_R = 255 - 210 * trace_ray_B / scale,
- trace_ray_G = 255 - 435 * trace_ray_B / scale,
- trace_ray_B = 255 - 720 * trace_ray_B / scale
- )
- :
- (
- trace_ray_B -= scale/5,
- trace_ray_R = 213 - 110 * trace_ray_B / scale,
- trace_ray_G = 168 - 113 * trace_ray_B / scale,
- trace_ray_B = 111 - 85 * trace_ray_B / scale
- )
- ),
-
- depth!=MaxDepth?
- (
- trace_ray_R /= 2,
- trace_ray_G /= 2,
- trace_ray_B /= 2
- )
- : 0
- );
-
- trace_ray_R = trace_ray_R<0? 0 : trace_ray_R>maxcolor? maxcolor: trace_ray_R;
- trace_ray_G = trace_ray_G<0? 0 : trace_ray_G>maxcolor? maxcolor : trace_ray_G;
- trace_ray_B = trace_ray_B<0? 0 : trace_ray_B>maxcolor? maxcolor : trace_ray_B;
-}
-
-
-/*
- * do_pixels_in_line():
- *
- * the horizontal "for loop"
- */
-R; G; B;
-dpil_helper(x,y, a,b)
-{
- trace_ray(
- scale*camera_X + scale*40*(An*x+a)/xsize/An - scale*20,
- scale*camera_Y,
- scale*camera_Z - scale*30*(An*y+b)/ysize/An + scale*15,
- 0, scale, 0, MaxDepth, -1, 0,0);
-
- R += trace_ray_R;
- G += trace_ray_G;
- B += trace_ray_B;
-
- ++a
-#include "snipmath.h"
-
-#undef rad2deg /* These are macros defined in PI.H */
-#undef deg2rad
-
-double rad2deg(double rad)
-{
- return (180.0 * rad / (PI));
-}
-
-double deg2rad(double deg)
-{
- return (PI * deg / 180.0);
-}
-
-#ifdef TEST
-
-#include
-
-main()
-{
- double X;
-
- for (X = 0.0; X <= 360.0; X += 45.0)
- printf("%3.0f degrees = %.12f radians\n", X, deg2rad(X));
- puts("");
- for (X = 0.0; X <= (2 * PI + 1e-6); X += (PI / 6))
- printf("%.12f radians = %3.0f degrees\n", X, rad2deg(X));
- return 0;
-}
-
-#endif /* TEST */
diff --git a/lib/CPUs/MIPS/bsp/examples/random.c b/lib/CPUs/MIPS/bsp/examples/random.c
deleted file mode 100644
index c5f6615..0000000
--- a/lib/CPUs/MIPS/bsp/examples/random.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* random.c
-
- Author: Numerical recipes (ran1, gaussian), Jon Hamkins (others)
- Revised by: Jon Hamkins
- Date: 4-16-98
-*/
-
-#include
-
-#define IA 16807
-#define IM 2147483647
-#define AM (1.0/IM)
-#define IQ 127773
-#define IR 2836
-#define NTAB 32
-#define NDIV (1+(IM-1)/NTAB)
-#define EPS 1.2e-14
-#define RNMX (1.0-EPS)
-/* From Numerical Recipes, p. 280, modified from float to double */
-/* returns a uniform deviate in (0,1) */
-double ran1(long *idum)
-{
- int j;
- long k;
- static long iy=0;
- static long iv[NTAB];
- double temp;
-
- if (*idum <=0 || !iy) {
- if (-(*idum) < 1) *idum=1;
- else *idum = -(*idum);
- for (j=NTAB+7; j>=0; j--) {
- k=(*idum)/IQ;
- *idum=IA*(*idum-k*IQ)-IR*k;
- if (*idum < 0) *idum += IM;
- if (j < NTAB) iv[j] = *idum;
- }
- iy = iv[0];
- }
- k=(*idum)/IQ;
- *idum=IA*(*idum-k*IQ)-IR*k;
- if (*idum < 0) *idum += IM;
- j=iy/NDIV;
- iy=iv[j];
- iv[j] = *idum;
- if ((temp=AM*iy) > RNMX) return RNMX;
- else return temp;
-}
-#undef IA
-#undef IM
-#undef AM
-#undef IQ
-#undef IR
-#undef NTAB
-#undef NDIV
-#undef EPS
-#undef RNMX
-
-/* Generate a N(0,1) r.v. */
-double gaussian(long *idum)
-{
- static int iset=0;
- static double gset;
- double fac,r,v1,v2;
- double ran1();
- if (iset == 0) {
- do {
- v1=2.0*ran1(idum)-1.0;
- v2=2.0*ran1(idum)-1.0;
- r=v1*v1+v2*v2;
- } while (r >= 1.0 || r == 0.0);
- fac=sqrt(-2.0*log(r)/r);
- gset=v1*fac;
- iset=1;
- return v2*fac;
- } else {
- iset=0;
- return gset;
- }
-}
-
-/* generate a random bit */
-int random_bit(long *idum)
-{
- return((ran1(idum)<0.5) ? 0 : 1);
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/random.h b/lib/CPUs/MIPS/bsp/examples/random.h
deleted file mode 100644
index 673d6af..0000000
--- a/lib/CPUs/MIPS/bsp/examples/random.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/* random.h */
-
-/* functions provided by random.c */
-extern double ran1(long *idum);
-extern double gaussian(long *idum);
-extern int random_bit(long *idum);
diff --git a/lib/CPUs/MIPS/bsp/examples/regdef.h b/lib/CPUs/MIPS/bsp/examples/regdef.h
deleted file mode 100644
index 60c6c2a..0000000
--- a/lib/CPUs/MIPS/bsp/examples/regdef.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1985 MIPS Computer Systems, Inc.
- * Copyright (C) 1994, 95, 99, 2003 by Ralf Baechle
- * Copyright (C) 1990 - 1992, 1999 Silicon Graphics, Inc.
- */
-#ifndef _ASM_REGDEF_H
-#define _ASM_REGDEF_H
-
-/*
- * Symbolic register names for 32 bit ABI
- */
-#define zero $0 /* wired zero */
-#define AT $1 /* assembler temp - uppercase because of ".set at" */
-#define v0 $2 /* return value */
-#define v1 $3
-#define a0 $4 /* argument registers */
-#define a1 $5
-#define a2 $6
-#define a3 $7
-#define t0 $8 /* caller saved */
-#define t1 $9
-#define t2 $10
-#define t3 $11
-#define t4 $12
-#define t5 $13
-#define t6 $14
-#define t7 $15
-#define s0 $16 /* callee saved */
-#define s1 $17
-#define s2 $18
-#define s3 $19
-#define s4 $20
-#define s5 $21
-#define s6 $22
-#define s7 $23
-#define t8 $24 /* caller saved */
-#define t9 $25
-#define jp $25 /* PIC jump register */
-#define k0 $26 /* kernel scratch */
-#define k1 $27
-#define gp $28 /* global pointer */
-#define sp $29 /* stack pointer */
-#define fp $30 /* frame pointer */
-#define s8 $30 /* same like fp! */
-#define ra $31 /* return address */
-
-/* CP0 registers */
-#define CP0_INDEX $0 /* R3000 available */
-#define CP0_RANDOM $1 /* R3000 available */
-#define CP0_ENTRYLO $2 /* R3000 available */
-#define CP0_CONTEXT $4 /* R3000 available */
-#define CP0_BADDR $8 /* R3000 available */
-#define CP0_ENTRYHI $10 /* R3000 available */
-#define CP0_SR $12 /* R3000 available */
-#define CP0_CR $13 /* R3000 available */
-#define CP0_EPC $14 /* R3000 available */
-#define CP0_PRID $15 /* R3000 available */
-
-/* Status register masks */
-#define SR_MASK_IEC 0x00000001
-#define SR_MASK_KUC 0x00000002
-#define SR_MASK_IEP 0x00000004
-#define SR_MASK_KUP 0x00000008
-#define SR_MASK_IEO 0x00000010
-#define SR_MASK_KUO 0x00000020
-#define SR_MASK_IM 0x0000FF00
-#define SR_MASK_DS 0x00FF0000
-#define SR_MASK_RE 0x01000000
-#define SR_MASK_CU 0xF0000000
-
-/* Cause register masks */
-#define CR_MASK_EXC 0x0000007C
-#define CR_MASK_IP 0x0000FF00
-#define CR_MASK_CE 0x40000000
-#define CR_MASK_BD 0x80000000
-
-#endif /* _ASM_REGDEF_H */
diff --git a/lib/CPUs/MIPS/bsp/examples/richards_benchmark.c b/lib/CPUs/MIPS/bsp/examples/richards_benchmark.c
deleted file mode 100644
index f1fdfd0..0000000
--- a/lib/CPUs/MIPS/bsp/examples/richards_benchmark.c
+++ /dev/null
@@ -1,408 +0,0 @@
-
-/* C version of the systems programming language benchmark
-** Author: M. J. Jordan Cambridge Computer Laboratory.
-**
-** Modified by: M. Richards, Nov 1996
-** to be ANSI C and runnable on 64 bit machines + other minor changes
-** Modified by: M. Richards, 20 Oct 1998
-** made minor corrections to improve ANSI compliance (suggested
-** by David Levine)
-**
-** Compile with, say
-**
-** gcc -o bench bench.c
-**
-** or
-**
-** gcc -o bench100 -Dbench100 bench.c (for a version that obeys
-** the main loop 100x more often)
-*/
-
-#include
-#include
-
-#ifdef SMALL_PROBLEM_SIZE
-#define Count 1000*1000
-#define Qpktcountval 2326389
-#define Holdcountval 930555
-#else
-#define Count 10000*1000
-#define Qpktcountval 23263894
-#define Holdcountval 9305557
-#endif
-
-
-#define TRUE 1
-#define FALSE 0
-#define MAXINT 32767
-
-#define BUFSIZE 3
-#define I_IDLE 1
-#define I_WORK 2
-#define I_HANDLERA 3
-#define I_HANDLERB 4
-#define I_DEVA 5
-#define I_DEVB 6
-#define PKTBIT 1
-#define WAITBIT 2
-#define HOLDBIT 4
-#define NOTPKTBIT !1
-#define NOTWAITBIT !2
-#define NOTHOLDBIT 0XFFFB
-
-#define S_RUN 0
-#define S_RUNPKT 1
-#define S_WAIT 2
-#define S_WAITPKT 3
-#define S_HOLD 4
-#define S_HOLDPKT 5
-#define S_HOLDWAIT 6
-#define S_HOLDWAITPKT 7
-
-#define K_DEV 1000
-#define K_WORK 1001
-
-struct packet
-{
- struct packet *p_link;
- int p_id;
- int p_kind;
- int p_a1;
- char p_a2[4];
-};
-
-struct task
-{
- struct task *t_link;
- int t_id;
- int t_pri;
- struct packet *t_wkq;
- int t_state;
- struct task *(*t_fn)(struct packet *);
- long t_v1;
- long t_v2;
-};
-
-char alphabet[28] = "0ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-struct task *tasktab[11] = {0,0,0,0,0,0,0,0,0,0,0};
-struct task *tasklist = 0;
-struct task *tcb;
-long taskid;
-long v1;
-long v2;
-int qpktcount = 0;
-int holdcount = 0;
-int tracing = 1;
-int layout = 0;
-
-void append(struct packet *pkt, struct packet *ptr);
-
-void createtask(int id,
- int pri,
- struct packet *wkq,
- int state,
- struct task *(*fn)(struct packet *),
- long v1,
- long v2)
-{
- struct task *t = (struct task *)malloc(sizeof(struct task));
-
- tasktab[id] = t;
- t->t_link = tasklist;
- t->t_id = id;
- t->t_pri = pri;
- t->t_wkq = wkq;
- t->t_state = state;
- t->t_fn = fn;
- t->t_v1 = v1;
- t->t_v2 = v2;
- tasklist = t;
-}
-
-struct packet *pkt(struct packet *link, int id, int kind)
-{
- int i;
- struct packet *p = (struct packet *)malloc(sizeof(struct packet));
-
- for (i=0; i<=BUFSIZE; i++)
- p->p_a2[i] = 0;
-
- p->p_link = link;
- p->p_id = id;
- p->p_kind = kind;
- p->p_a1 = 0;
-
- return (p);
-}
-
-void trace(char a)
-{
- if ( --layout <= 0 )
- {
- printf("\n");
- layout = 50;
- }
-
- printf("%c", a);
-}
-
-void schedule()
-{
- while ( tcb != 0 )
- {
- struct packet *pkt;
- struct task *newtcb;
-
- pkt=0;
-
- switch ( tcb->t_state )
- {
- case S_WAITPKT:
- pkt = tcb->t_wkq;
- tcb->t_wkq = pkt->p_link;
- tcb->t_state = tcb->t_wkq == 0 ? S_RUN : S_RUNPKT;
-
- case S_RUN:
- case S_RUNPKT:
- taskid = tcb->t_id;
- v1 = tcb->t_v1;
- v2 = tcb->t_v2;
- if (tracing==TRUE) trace(taskid+'0');
-
- newtcb = (*(tcb->t_fn))(pkt);
- tcb->t_v1 = v1;
- tcb->t_v2 = v2;
- tcb = newtcb;
- break;
-
- case S_WAIT:
- case S_HOLD:
- case S_HOLDPKT:
- case S_HOLDWAIT:
- case S_HOLDWAITPKT:
- tcb = tcb->t_link;
- break;
-
- default:
- return;
- }
- }
-}
-
-struct task *Wait(void)
-{
- tcb->t_state |= WAITBIT;
- return (tcb);
-}
-
-struct task *holdself(void)
-{
- ++holdcount;
- tcb->t_state |= HOLDBIT;
- return (tcb->t_link) ;
-}
-
-struct task *findtcb(int id)
-{
- struct task *t = 0;
-
- if (1<=id && id<=(long)10)
- t = tasktab[id];
- if (t==0) printf("\nBad task id %d\n", id);
- return(t);
-}
-
-struct task *release(int id)
-{
- struct task *t;
-
- t = findtcb(id);
- if ( t==0 ) return (0);
-
- t->t_state &= NOTHOLDBIT;
- if ( t->t_pri > tcb->t_pri ) return (t);
-
- return (tcb) ;
-}
-
-
-struct task *qpkt(struct packet *pkt)
-{
- struct task *t;
-
- t = findtcb(pkt->p_id);
- if (t==0) return (t);
-
- qpktcount++;
-
- pkt->p_link = 0;
- pkt->p_id = taskid;
-
- if (t->t_wkq==0)
- {
- t->t_wkq = pkt;
- t->t_state |= PKTBIT;
- if (t->t_pri > tcb->t_pri) return (t);
- }
- else
- {
- append(pkt, (struct packet *)&(t->t_wkq));
- }
-
- return (tcb);
-}
-
-struct task *idlefn(struct packet *pkt)
-{
- --v2;
- if ( v2==0 ) return ( holdself() );
-
- if ( (v1&1) == 0 )
- {
- v1 = ( v1>>1) & MAXINT;
- return ( release(I_DEVA) );
- }
- else
- {
- v1 = ( (v1>>1) & MAXINT) ^ 0XD008;
- return ( release(I_DEVB) );
- }
-}
-
-struct task *workfn(struct packet *pkt)
-{
- if ( pkt==0 ) return ( Wait() );
- else
- {
- int i;
-
- v1 = I_HANDLERA + I_HANDLERB - v1;
- pkt->p_id = v1;
-
- pkt->p_a1 = 0;
- for (i=0; i<=BUFSIZE; i++)
- {
- v2++;
- if ( v2 > 26 ) v2 = 1;
- (pkt->p_a2)[i] = alphabet[v2];
- }
- return ( qpkt(pkt) );
- }
-}
-
-struct task *handlerfn(struct packet *pkt)
-{
- if ( pkt!=0) append(pkt,
- (struct packet *)(pkt->p_kind==K_WORK ? &v1 : &v2));
-
- if ( v1!=0 )
- {
- int count;
- struct packet *workpkt = (struct packet *)v1;
- count = workpkt->p_a1;
-
- if ( count > BUFSIZE )
- {
- v1 = (long)(((struct packet *)v1)->p_link);
- return ( qpkt(workpkt) );
- }
-
- if ( v2!=0 )
- {
- struct packet *devpkt;
-
- devpkt = (struct packet *)v2;
- v2 = (long)(((struct packet *)v2)->p_link);
- devpkt->p_a1 = workpkt->p_a2[count];
- workpkt->p_a1 = count+1;
- return( qpkt(devpkt) );
- }
- }
- return ( Wait() );
-}
-
-struct task *devfn(struct packet *pkt)
-{
- if ( pkt==0 )
- {
- if ( v1==0 ) return ( Wait() );
- pkt = (struct packet *)v1;
- v1 = 0;
- return ( qpkt(pkt) );
- }
- else
- {
- v1 = (long)pkt;
- if (tracing==TRUE) trace(pkt->p_a1);
- return ( holdself() );
- }
-}
-
-void append(struct packet *pkt, struct packet *ptr)
-{
- pkt->p_link = 0;
-
- while ( ptr->p_link ) ptr = ptr->p_link;
-
- ptr->p_link = pkt;
-}
-
-int main()
-{
- struct packet *wkq = 0;
- int retval;
-
- printf("Bench mark starting\n");
-
- createtask(I_IDLE, 0, wkq, S_RUN, idlefn, 1, Count);
-
- wkq = pkt(0, 0, K_WORK);
- wkq = pkt(wkq, 0, K_WORK);
-
- createtask(I_WORK, 1000, wkq, S_WAITPKT, workfn, I_HANDLERA, 0);
-
- wkq = pkt(0, I_DEVA, K_DEV);
- wkq = pkt(wkq, I_DEVA, K_DEV);
- wkq = pkt(wkq, I_DEVA, K_DEV);
-
- createtask(I_HANDLERA, 2000, wkq, S_WAITPKT, handlerfn, 0, 0);
-
- wkq = pkt(0, I_DEVB, K_DEV);
- wkq = pkt(wkq, I_DEVB, K_DEV);
- wkq = pkt(wkq, I_DEVB, K_DEV);
-
- createtask(I_HANDLERB, 3000, wkq, S_WAITPKT, handlerfn, 0, 0);
-
- wkq = 0;
- createtask(I_DEVA, 4000, wkq, S_WAIT, devfn, 0, 0);
- createtask(I_DEVB, 5000, wkq, S_WAIT, devfn, 0, 0);
-
- tcb = tasklist;
-
- qpktcount = holdcount = 0;
-
- printf("Starting\n");
-
- tracing = FALSE;
- layout = 0;
-
- schedule();
-
- printf("finished\n");
-
- printf("qpkt count = %d holdcount = %d\n",
- qpktcount, holdcount);
-
- printf("These results are ");
- if (qpktcount == Qpktcountval && holdcount == Holdcountval) {
- printf("correct");
- retval = 0;
- } else {
- printf("incorrect");
- retval = 1;
- }
-
- printf("\nend of run\n");
- return retval;
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/rmd160.c b/lib/CPUs/MIPS/bsp/examples/rmd160.c
deleted file mode 100644
index 8b0f2c7..0000000
--- a/lib/CPUs/MIPS/bsp/examples/rmd160.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/********************************************************************\
- *
- * FILE: rmd160.c
- *
- * CONTENTS: A sample C-implementation of the RIPEMD-160
- * hash-function.
- * TARGET: any computer with an ANSI C compiler
- *
- * AUTHOR: Antoon Bosselaers, ESAT-COSIC
- * DATE: 1 March 1996
- * VERSION: 1.0
- *
- * Copyright (c) Katholieke Universiteit Leuven
- * 1996, All Rights Reserved
- *
- * Conditions for use of the RIPEMD-160 Software
- *
- * The RIPEMD-160 software is freely available for use under the terms and
- * conditions described hereunder, which shall be deemed to be accepted by
- * any user of the software and applicable on any use of the software:
- *
- * 1. K.U.Leuven Department of Electrical Engineering-ESAT/COSIC shall for
- * all purposes be considered the owner of the RIPEMD-160 software and of
- * all copyright, trade secret, patent or other intellectual property
- * rights therein.
- * 2. The RIPEMD-160 software is provided on an "as is" basis without
- * warranty of any sort, express or implied. K.U.Leuven makes no
- * representation that the use of the software will not infringe any
- * patent or proprietary right of third parties. User will indemnify
- * K.U.Leuven and hold K.U.Leuven harmless from any claims or liabilities
- * which may arise as a result of its use of the software. In no
- * circumstances K.U.Leuven R&D will be held liable for any deficiency,
- * fault or other mishappening with regard to the use or performance of
- * the software.
- * 3. User agrees to give due credit to K.U.Leuven in scientific publications
- * or communications in relation with the use of the RIPEMD-160 software
- * as follows: RIPEMD-160 software written by Antoon Bosselaers,
- * available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
- *
-\********************************************************************/
-
-/* header files */
-#include
-#include
-#include
-#include "rmd160.h"
-
-/********************************************************************/
-
-void MDinit(dword *MDbuf)
-{
- MDbuf[0] = 0x67452301UL;
- MDbuf[1] = 0xefcdab89UL;
- MDbuf[2] = 0x98badcfeUL;
- MDbuf[3] = 0x10325476UL;
- MDbuf[4] = 0xc3d2e1f0UL;
-
- return;
-}
-
-/********************************************************************/
-
-void compress(dword *MDbuf, dword *X)
-{
- dword aa = MDbuf[0], bb = MDbuf[1], cc = MDbuf[2],
- dd = MDbuf[3], ee = MDbuf[4];
- dword aaa = MDbuf[0], bbb = MDbuf[1], ccc = MDbuf[2],
- ddd = MDbuf[3], eee = MDbuf[4];
-
- /* round 1 */
- FF(aa, bb, cc, dd, ee, X[ 0], 11);
- FF(ee, aa, bb, cc, dd, X[ 1], 14);
- FF(dd, ee, aa, bb, cc, X[ 2], 15);
- FF(cc, dd, ee, aa, bb, X[ 3], 12);
- FF(bb, cc, dd, ee, aa, X[ 4], 5);
- FF(aa, bb, cc, dd, ee, X[ 5], 8);
- FF(ee, aa, bb, cc, dd, X[ 6], 7);
- FF(dd, ee, aa, bb, cc, X[ 7], 9);
- FF(cc, dd, ee, aa, bb, X[ 8], 11);
- FF(bb, cc, dd, ee, aa, X[ 9], 13);
- FF(aa, bb, cc, dd, ee, X[10], 14);
- FF(ee, aa, bb, cc, dd, X[11], 15);
- FF(dd, ee, aa, bb, cc, X[12], 6);
- FF(cc, dd, ee, aa, bb, X[13], 7);
- FF(bb, cc, dd, ee, aa, X[14], 9);
- FF(aa, bb, cc, dd, ee, X[15], 8);
-
- /* round 2 */
- GG(ee, aa, bb, cc, dd, X[ 7], 7);
- GG(dd, ee, aa, bb, cc, X[ 4], 6);
- GG(cc, dd, ee, aa, bb, X[13], 8);
- GG(bb, cc, dd, ee, aa, X[ 1], 13);
- GG(aa, bb, cc, dd, ee, X[10], 11);
- GG(ee, aa, bb, cc, dd, X[ 6], 9);
- GG(dd, ee, aa, bb, cc, X[15], 7);
- GG(cc, dd, ee, aa, bb, X[ 3], 15);
- GG(bb, cc, dd, ee, aa, X[12], 7);
- GG(aa, bb, cc, dd, ee, X[ 0], 12);
- GG(ee, aa, bb, cc, dd, X[ 9], 15);
- GG(dd, ee, aa, bb, cc, X[ 5], 9);
- GG(cc, dd, ee, aa, bb, X[ 2], 11);
- GG(bb, cc, dd, ee, aa, X[14], 7);
- GG(aa, bb, cc, dd, ee, X[11], 13);
- GG(ee, aa, bb, cc, dd, X[ 8], 12);
-
- /* round 3 */
- HH(dd, ee, aa, bb, cc, X[ 3], 11);
- HH(cc, dd, ee, aa, bb, X[10], 13);
- HH(bb, cc, dd, ee, aa, X[14], 6);
- HH(aa, bb, cc, dd, ee, X[ 4], 7);
- HH(ee, aa, bb, cc, dd, X[ 9], 14);
- HH(dd, ee, aa, bb, cc, X[15], 9);
- HH(cc, dd, ee, aa, bb, X[ 8], 13);
- HH(bb, cc, dd, ee, aa, X[ 1], 15);
- HH(aa, bb, cc, dd, ee, X[ 2], 14);
- HH(ee, aa, bb, cc, dd, X[ 7], 8);
- HH(dd, ee, aa, bb, cc, X[ 0], 13);
- HH(cc, dd, ee, aa, bb, X[ 6], 6);
- HH(bb, cc, dd, ee, aa, X[13], 5);
- HH(aa, bb, cc, dd, ee, X[11], 12);
- HH(ee, aa, bb, cc, dd, X[ 5], 7);
- HH(dd, ee, aa, bb, cc, X[12], 5);
-
- /* round 4 */
- II(cc, dd, ee, aa, bb, X[ 1], 11);
- II(bb, cc, dd, ee, aa, X[ 9], 12);
- II(aa, bb, cc, dd, ee, X[11], 14);
- II(ee, aa, bb, cc, dd, X[10], 15);
- II(dd, ee, aa, bb, cc, X[ 0], 14);
- II(cc, dd, ee, aa, bb, X[ 8], 15);
- II(bb, cc, dd, ee, aa, X[12], 9);
- II(aa, bb, cc, dd, ee, X[ 4], 8);
- II(ee, aa, bb, cc, dd, X[13], 9);
- II(dd, ee, aa, bb, cc, X[ 3], 14);
- II(cc, dd, ee, aa, bb, X[ 7], 5);
- II(bb, cc, dd, ee, aa, X[15], 6);
- II(aa, bb, cc, dd, ee, X[14], 8);
- II(ee, aa, bb, cc, dd, X[ 5], 6);
- II(dd, ee, aa, bb, cc, X[ 6], 5);
- II(cc, dd, ee, aa, bb, X[ 2], 12);
-
- /* round 5 */
- JJ(bb, cc, dd, ee, aa, X[ 4], 9);
- JJ(aa, bb, cc, dd, ee, X[ 0], 15);
- JJ(ee, aa, bb, cc, dd, X[ 5], 5);
- JJ(dd, ee, aa, bb, cc, X[ 9], 11);
- JJ(cc, dd, ee, aa, bb, X[ 7], 6);
- JJ(bb, cc, dd, ee, aa, X[12], 8);
- JJ(aa, bb, cc, dd, ee, X[ 2], 13);
- JJ(ee, aa, bb, cc, dd, X[10], 12);
- JJ(dd, ee, aa, bb, cc, X[14], 5);
- JJ(cc, dd, ee, aa, bb, X[ 1], 12);
- JJ(bb, cc, dd, ee, aa, X[ 3], 13);
- JJ(aa, bb, cc, dd, ee, X[ 8], 14);
- JJ(ee, aa, bb, cc, dd, X[11], 11);
- JJ(dd, ee, aa, bb, cc, X[ 6], 8);
- JJ(cc, dd, ee, aa, bb, X[15], 5);
- JJ(bb, cc, dd, ee, aa, X[13], 6);
-
- /* parallel round 1 */
- JJJ(aaa, bbb, ccc, ddd, eee, X[ 5], 8);
- JJJ(eee, aaa, bbb, ccc, ddd, X[14], 9);
- JJJ(ddd, eee, aaa, bbb, ccc, X[ 7], 9);
- JJJ(ccc, ddd, eee, aaa, bbb, X[ 0], 11);
- JJJ(bbb, ccc, ddd, eee, aaa, X[ 9], 13);
- JJJ(aaa, bbb, ccc, ddd, eee, X[ 2], 15);
- JJJ(eee, aaa, bbb, ccc, ddd, X[11], 15);
- JJJ(ddd, eee, aaa, bbb, ccc, X[ 4], 5);
- JJJ(ccc, ddd, eee, aaa, bbb, X[13], 7);
- JJJ(bbb, ccc, ddd, eee, aaa, X[ 6], 7);
- JJJ(aaa, bbb, ccc, ddd, eee, X[15], 8);
- JJJ(eee, aaa, bbb, ccc, ddd, X[ 8], 11);
- JJJ(ddd, eee, aaa, bbb, ccc, X[ 1], 14);
- JJJ(ccc, ddd, eee, aaa, bbb, X[10], 14);
- JJJ(bbb, ccc, ddd, eee, aaa, X[ 3], 12);
- JJJ(aaa, bbb, ccc, ddd, eee, X[12], 6);
-
- /* parallel round 2 */
- III(eee, aaa, bbb, ccc, ddd, X[ 6], 9);
- III(ddd, eee, aaa, bbb, ccc, X[11], 13);
- III(ccc, ddd, eee, aaa, bbb, X[ 3], 15);
- III(bbb, ccc, ddd, eee, aaa, X[ 7], 7);
- III(aaa, bbb, ccc, ddd, eee, X[ 0], 12);
- III(eee, aaa, bbb, ccc, ddd, X[13], 8);
- III(ddd, eee, aaa, bbb, ccc, X[ 5], 9);
- III(ccc, ddd, eee, aaa, bbb, X[10], 11);
- III(bbb, ccc, ddd, eee, aaa, X[14], 7);
- III(aaa, bbb, ccc, ddd, eee, X[15], 7);
- III(eee, aaa, bbb, ccc, ddd, X[ 8], 12);
- III(ddd, eee, aaa, bbb, ccc, X[12], 7);
- III(ccc, ddd, eee, aaa, bbb, X[ 4], 6);
- III(bbb, ccc, ddd, eee, aaa, X[ 9], 15);
- III(aaa, bbb, ccc, ddd, eee, X[ 1], 13);
- III(eee, aaa, bbb, ccc, ddd, X[ 2], 11);
-
- /* parallel round 3 */
- HHH(ddd, eee, aaa, bbb, ccc, X[15], 9);
- HHH(ccc, ddd, eee, aaa, bbb, X[ 5], 7);
- HHH(bbb, ccc, ddd, eee, aaa, X[ 1], 15);
- HHH(aaa, bbb, ccc, ddd, eee, X[ 3], 11);
- HHH(eee, aaa, bbb, ccc, ddd, X[ 7], 8);
- HHH(ddd, eee, aaa, bbb, ccc, X[14], 6);
- HHH(ccc, ddd, eee, aaa, bbb, X[ 6], 6);
- HHH(bbb, ccc, ddd, eee, aaa, X[ 9], 14);
- HHH(aaa, bbb, ccc, ddd, eee, X[11], 12);
- HHH(eee, aaa, bbb, ccc, ddd, X[ 8], 13);
- HHH(ddd, eee, aaa, bbb, ccc, X[12], 5);
- HHH(ccc, ddd, eee, aaa, bbb, X[ 2], 14);
- HHH(bbb, ccc, ddd, eee, aaa, X[10], 13);
- HHH(aaa, bbb, ccc, ddd, eee, X[ 0], 13);
- HHH(eee, aaa, bbb, ccc, ddd, X[ 4], 7);
- HHH(ddd, eee, aaa, bbb, ccc, X[13], 5);
-
- /* parallel round 4 */
- GGG(ccc, ddd, eee, aaa, bbb, X[ 8], 15);
- GGG(bbb, ccc, ddd, eee, aaa, X[ 6], 5);
- GGG(aaa, bbb, ccc, ddd, eee, X[ 4], 8);
- GGG(eee, aaa, bbb, ccc, ddd, X[ 1], 11);
- GGG(ddd, eee, aaa, bbb, ccc, X[ 3], 14);
- GGG(ccc, ddd, eee, aaa, bbb, X[11], 14);
- GGG(bbb, ccc, ddd, eee, aaa, X[15], 6);
- GGG(aaa, bbb, ccc, ddd, eee, X[ 0], 14);
- GGG(eee, aaa, bbb, ccc, ddd, X[ 5], 6);
- GGG(ddd, eee, aaa, bbb, ccc, X[12], 9);
- GGG(ccc, ddd, eee, aaa, bbb, X[ 2], 12);
- GGG(bbb, ccc, ddd, eee, aaa, X[13], 9);
- GGG(aaa, bbb, ccc, ddd, eee, X[ 9], 12);
- GGG(eee, aaa, bbb, ccc, ddd, X[ 7], 5);
- GGG(ddd, eee, aaa, bbb, ccc, X[10], 15);
- GGG(ccc, ddd, eee, aaa, bbb, X[14], 8);
-
- /* parallel round 5 */
- FFF(bbb, ccc, ddd, eee, aaa, X[12] , 8);
- FFF(aaa, bbb, ccc, ddd, eee, X[15] , 5);
- FFF(eee, aaa, bbb, ccc, ddd, X[10] , 12);
- FFF(ddd, eee, aaa, bbb, ccc, X[ 4] , 9);
- FFF(ccc, ddd, eee, aaa, bbb, X[ 1] , 12);
- FFF(bbb, ccc, ddd, eee, aaa, X[ 5] , 5);
- FFF(aaa, bbb, ccc, ddd, eee, X[ 8] , 14);
- FFF(eee, aaa, bbb, ccc, ddd, X[ 7] , 6);
- FFF(ddd, eee, aaa, bbb, ccc, X[ 6] , 8);
- FFF(ccc, ddd, eee, aaa, bbb, X[ 2] , 13);
- FFF(bbb, ccc, ddd, eee, aaa, X[13] , 6);
- FFF(aaa, bbb, ccc, ddd, eee, X[14] , 5);
- FFF(eee, aaa, bbb, ccc, ddd, X[ 0] , 15);
- FFF(ddd, eee, aaa, bbb, ccc, X[ 3] , 13);
- FFF(ccc, ddd, eee, aaa, bbb, X[ 9] , 11);
- FFF(bbb, ccc, ddd, eee, aaa, X[11] , 11);
-
- /* combine results */
- ddd += cc + MDbuf[1]; /* final result for MDbuf[0] */
- MDbuf[1] = MDbuf[2] + dd + eee;
- MDbuf[2] = MDbuf[3] + ee + aaa;
- MDbuf[3] = MDbuf[4] + aa + bbb;
- MDbuf[4] = MDbuf[0] + bb + ccc;
- MDbuf[0] = ddd;
-
- return;
-}
-
-/********************************************************************/
-
-void MDfinish(dword *MDbuf, byte *strptr, dword lswlen, dword mswlen)
-{
- unsigned int i; /* counter */
- dword X[16]; /* message words */
-
- memset(X, 0, 16*sizeof(dword));
-
- /* put bytes from strptr into X */
- for (i=0; i<(lswlen&63); i++) {
- /* byte i goes into word X[i div 4] at pos. 8*(i mod 4) */
- X[i>>2] ^= (dword) *strptr++ << (8 * (i&3));
- }
-
- /* append the bit m_n == 1 */
- X[(lswlen>>2)&15] ^= (dword)1 << (8*(lswlen&3) + 7);
-
- if ((lswlen & 63) > 55) {
- /* length goes to next block */
- compress(MDbuf, X);
- memset(X, 0, 16*sizeof(dword));
- }
-
- /* append length in bits*/
- X[14] = lswlen << 3;
- X[15] = (lswlen >> 29) | (mswlen << 3);
- compress(MDbuf, X);
-
- return;
-}
-
-/************************ end of file rmd160.c **********************/
-
diff --git a/lib/CPUs/MIPS/bsp/examples/rmd160.h b/lib/CPUs/MIPS/bsp/examples/rmd160.h
deleted file mode 100644
index 70a33a6..0000000
--- a/lib/CPUs/MIPS/bsp/examples/rmd160.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/********************************************************************\
- *
- * FILE: rmd160.h
- *
- * CONTENTS: Header file for a sample C-implementation of the
- * RIPEMD-160 hash-function.
- * TARGET: any computer with an ANSI C compiler
- *
- * AUTHOR: Antoon Bosselaers, ESAT-COSIC
- * DATE: 1 March 1996
- * VERSION: 1.0
- *
- * Copyright (c) Katholieke Universiteit Leuven
- * 1996, All Rights Reserved
- *
- * Conditions for use of the RIPEMD-160 Software
- *
- * The RIPEMD-160 software is freely available for use under the terms and
- * conditions described hereunder, which shall be deemed to be accepted by
- * any user of the software and applicable on any use of the software:
- *
- * 1. K.U.Leuven Department of Electrical Engineering-ESAT/COSIC shall for
- * all purposes be considered the owner of the RIPEMD-160 software and of
- * all copyright, trade secret, patent or other intellectual property
- * rights therein.
- * 2. The RIPEMD-160 software is provided on an "as is" basis without
- * warranty of any sort, express or implied. K.U.Leuven makes no
- * representation that the use of the software will not infringe any
- * patent or proprietary right of third parties. User will indemnify
- * K.U.Leuven and hold K.U.Leuven harmless from any claims or liabilities
- * which may arise as a result of its use of the software. In no
- * circumstances K.U.Leuven R&D will be held liable for any deficiency,
- * fault or other mishappening with regard to the use or performance of
- * the software.
- * 3. User agrees to give due credit to K.U.Leuven in scientific publications
- * or communications in relation with the use of the RIPEMD-160 software
- * as follows: RIPEMD-160 software written by Antoon Bosselaers,
- * available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
- *
-\********************************************************************/
-
-#ifndef RMD160H /* make sure this file is read only once */
-#define RMD160H
-
-/********************************************************************/
-
-/* typedef 8 and 32 bit types, resp. */
-/* adapt these, if necessary,
- for your operating system and compiler */
-typedef unsigned char byte;
-typedef unsigned long dword;
-
-
-/********************************************************************/
-
-/* macro definitions */
-
-/* collect four bytes into one word: */
-#define BYTES_TO_DWORD(strptr) \
- (((dword) *((strptr)+3) << 24) | \
- ((dword) *((strptr)+2) << 16) | \
- ((dword) *((strptr)+1) << 8) | \
- ((dword) *(strptr)))
-
-/* ROL(x, n) cyclically rotates x over n bits to the left */
-/* x must be of an unsigned 32 bits type and 0 <= n < 32. */
-#define ROL(x, n) (((x) << (n)) | ((x) >> (32-(n))))
-
-/* the five basic functions F(), G() and H() */
-#define F(x, y, z) ((x) ^ (y) ^ (z))
-#define G(x, y, z) (((x) & (y)) | (~(x) & (z)))
-#define H(x, y, z) (((x) | ~(y)) ^ (z))
-#define I(x, y, z) (((x) & (z)) | ((y) & ~(z)))
-#define J(x, y, z) ((x) ^ ((y) | ~(z)))
-
-/* the ten basic operations FF() through III() */
-#define FF(a, b, c, d, e, x, s) {\
- (a) += F((b), (c), (d)) + (x);\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-#define GG(a, b, c, d, e, x, s) {\
- (a) += G((b), (c), (d)) + (x) + 0x5a827999UL;\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-#define HH(a, b, c, d, e, x, s) {\
- (a) += H((b), (c), (d)) + (x) + 0x6ed9eba1UL;\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-#define II(a, b, c, d, e, x, s) {\
- (a) += I((b), (c), (d)) + (x) + 0x8f1bbcdcUL;\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-#define JJ(a, b, c, d, e, x, s) {\
- (a) += J((b), (c), (d)) + (x) + 0xa953fd4eUL;\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-#define FFF(a, b, c, d, e, x, s) {\
- (a) += F((b), (c), (d)) + (x);\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-#define GGG(a, b, c, d, e, x, s) {\
- (a) += G((b), (c), (d)) + (x) + 0x7a6d76e9UL;\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-#define HHH(a, b, c, d, e, x, s) {\
- (a) += H((b), (c), (d)) + (x) + 0x6d703ef3UL;\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-#define III(a, b, c, d, e, x, s) {\
- (a) += I((b), (c), (d)) + (x) + 0x5c4dd124UL;\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-#define JJJ(a, b, c, d, e, x, s) {\
- (a) += J((b), (c), (d)) + (x) + 0x50a28be6UL;\
- (a) = ROL((a), (s)) + (e);\
- (c) = ROL((c), 10);\
- }
-
-/********************************************************************/
-
-/* function prototypes */
-
-void MDinit(dword *MDbuf);
-/*
- * initializes MDbuffer to "magic constants"
- */
-
-void compress(dword *MDbuf, dword *X);
-/*
- * the compression function.
- * transforms MDbuf using message bytes X[0] through X[15]
- */
-
-void MDfinish(dword *MDbuf, byte *strptr, dword lswlen, dword mswlen);
-/*
- * puts bytes from strptr into X and pad out; appends length
- * and finally, compresses the last block(s)
- * note: length in bits == 8 * (lswlen + 2^32 mswlen).
- * note: there are (lswlen mod 64) bytes left in strptr.
- */
-
-#endif /* RMD160H */
-
-/*********************** end of file rmd160.h ***********************/
-
diff --git a/lib/CPUs/MIPS/bsp/examples/rmd160_test.c b/lib/CPUs/MIPS/bsp/examples/rmd160_test.c
deleted file mode 100644
index d46b86e..0000000
--- a/lib/CPUs/MIPS/bsp/examples/rmd160_test.c
+++ /dev/null
@@ -1,113 +0,0 @@
-#include
-#include
-#include
-#include "libsys.h"
-
-#include "rmd160.h"
-
-#ifndef RMDsize
-#define RMDsize 160
-#endif
-
-byte *RMD(byte *message)
-/*
- * returns RMD(message)
- * message should be a string terminated by '\0'
- */
-{
- dword MDbuf[RMDsize/32]; /* contains (A, B, C, D(, E)) */
- static byte hashcode[RMDsize/8]; /* for final hash-value */
- dword X[16]; /* current 16-word chunk */
- unsigned int i; /* counter */
- dword length; /* length in bytes of message */
- dword nbytes; /* # of bytes not yet processed */
-
- /* initialize */
- MDinit(MDbuf);
- length = (dword)strlen((char *)message);
-
- /* process message in 16-word chunks */
- for (nbytes=length; nbytes > 63; nbytes-=64) {
- for (i=0; i<16; i++) {
- X[i] = BYTES_TO_DWORD(message);
- message += 4;
- }
- compress(MDbuf, X);
- } /* length mod 64 bytes left */
-
- /* finish: */
- MDfinish(MDbuf, message, length, 0);
-
- for (i=0; i>2]; /* implicit cast to byte */
- hashcode[i+1] = (MDbuf[i>>2] >> 8); /* extracts the 8 least */
- hashcode[i+2] = (MDbuf[i>>2] >> 16); /* significant bits. */
- hashcode[i+3] = (MDbuf[i>>2] >> 24);
- }
-
- return (byte *)hashcode;
-}
-
-#define MSG_SIZE (1*1024*1024) // Bit
-#define TIME_STEP 2
-
-char msg[MSG_SIZE/8+1];
-byte hashref[] = {0xFC,0x20,0x7B,0x84,0x40,0x1C,0x49,0x0B,0x8D,0x69,0x88,0xD2,0x49,0x20,0x01,0x90,0x41,0x77,0x72,0x59};
-
-int main (void)
-{
- int result, i, j, cnt;
- byte *hashcode;
- UINT32 start, stop;
-
- for (i=0; i < MSG_SIZE/8; i++)
- msg[i] = 0x55;
-
- msg[i] = 0;
-
- setbuf(stdout, NULL);
-
- cnt = 0;
- while(1)
- {
- while (start == time(NULL));
-
- start = time(NULL);
- stop = start + TIME_STEP;
-
-
- while(1)
- {
- hashcode = RMD((byte *)msg);
- cnt++;
-
- if (memcmp(hashcode, hashref, sizeof(hashref)))
- {
- printf("Error RipeMD-160!\n");
- printf("Hash expected: ");
- for (i=0; i %d Mbit/s\n\n", cnt, MSG_SIZE/(1024*1024), TIME_STEP, cnt*MSG_SIZE/(1024*1024)/TIME_STEP);
- cnt = 0;
- break;
- }
- }
- }
-
- return 0;
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/round.h b/lib/CPUs/MIPS/bsp/examples/round.h
deleted file mode 100644
index 4dcbb58..0000000
--- a/lib/CPUs/MIPS/bsp/examples/round.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* +++Date last modified: 05-Jul-1997 */
-
-/*
-** rounding macros by Dave Knapp, Thad Smith, Jon Strayer, & Bob Stout
-*/
-
-#ifndef ROUND__H
-#define ROUND__H
-
-#include
-
-#if defined(__cplusplus) && __cplusplus
-
-/*
-** Safe C++ inline versions
-*/
-
-/* round to integer */
-
-inline int iround(double x)
-{
- return (int)floor(x + 0.5);
-}
-
-/* round number n to d decimal points */
-
-inline double fround(double n, unsigned d)
-{
- return floor(n * pow(10., d) + .5) / pow(10., d);
-}
-
-#else
-
-/*
-** NOTE: These C macro versions are unsafe since arguments are referenced
-** more than once.
-**
-** Avoid using these with expression arguments to be safe.
-*/
-
-/*
-** round to integer
-*/
-
-#define iround(x) floor((x) + 0.5)
-
-/*
-** round number n to d decimal points
-*/
-
-#define fround(n,d) (floor((n)*pow(10.,(d))+.5)/pow(10.,(d)))
-
-#endif
-
-#endif /* ROUND__H */
diff --git a/lib/CPUs/MIPS/bsp/examples/serdump.c b/lib/CPUs/MIPS/bsp/examples/serdump.c
deleted file mode 100644
index 066d0ea..0000000
--- a/lib/CPUs/MIPS/bsp/examples/serdump.c
+++ /dev/null
@@ -1,83 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include "libsys.h"
-
-#define BUF_SIZE 1024
-char buffer[BUF_SIZE];
-char rxbuf[BUF_SIZE];
-char * volatile pPtr_r;
-char * volatile pPtr_w;
-UINT32 volatile timeout_cnt;
-
-void handler3(void)
-{
- volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
- volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA;
-
- while((0x10 & *pUART_stat))
- {
-/// sputs("w: "); print_word((int)pPtr_w); sputs("\n");
- if (pPtr_w == &buffer[BUF_SIZE-1])
- pPtr_w = buffer;
- *(pPtr_w++) = *pUART_data;
- timeout_cnt = 200;
-
- }
-
-}
-
-int main(int argc, char **argv)
-{
- volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
- unsigned char *fileData;
- unsigned long file_len, state;
-
- pPtr_r = buffer;
- pPtr_w = buffer;
- interrupt_register(3, handler3);
- interrupt_enable(3);
- *pUART_stat |= (1 << 6);
- setbuf(stderr, NULL);
-
- state = 0;
- while(1)
- {
- fprintf(stdout,"Reading serial stream..\n");
- file_len = 0;
- timeout_cnt = 20000000;
- while(timeout_cnt--)
- {
- sleep(1);
- }
- while(pPtr_w != pPtr_r)
- {
-// sputs("r: "); print_word((int)pPtr_r); sputs("\n");
- if (pPtr_r == &buffer[BUF_SIZE-1])
- pPtr_r = buffer;
- rxbuf[file_len++] = *(pPtr_r++);
- }
- if (file_len)
- {
- PrintBuffer8(rxbuf, 16, file_len);
- }
- switch(state)
- {
- case 0:
- if (!memcmp(rxbuf, "CLIENT", file_len))
- {
- fprintf(stdout,"Send response\n");
- fprintf(stderr,"SERVER");
- state = 1;
- }
- break;
- default:
- break;
- }
- }
-
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/snipmath.h b/lib/CPUs/MIPS/bsp/examples/snipmath.h
deleted file mode 100644
index 9ef5841..0000000
--- a/lib/CPUs/MIPS/bsp/examples/snipmath.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* +++Date last modified: 05-Jul-1997 */
-
-/*
-** SNIPMATH.H - Header file for SNIPPETS math functions and macros
-*/
-
-#ifndef SNIPMATH__H
-#define SNIPMATH__H
-
-#include
-#include "sniptype.h"
-#include "round.h"
-
-/*
-** Callable library functions begin here
-*/
-
-void SetBCDLen(int n); /* Bcdl.C */
-long BCDtoLong(char *BCDNum); /* Bcdl.C */
-void LongtoBCD(long num, char BCDNum[]); /* Bcdl.C */
-double bcd_to_double(void *buf, size_t len, /* Bcdd.C */
- int digits);
-int double_to_bcd(double arg, char *buf, /* Bcdd.C */
- size_t length, size_t digits );
-DWORD ncomb1 (int n, int m); /* Combin.C */
-DWORD ncomb2 (int n, int m); /* Combin.C */
-void SolveCubic(double a, double b, double c, /* Cubic.C */
- double d, int *solutions,
- double *x);
-DWORD dbl2ulong(double t); /* Dbl2Long.C */
-long dbl2long(double t); /* Dbl2Long.C */
-double dround(double x); /* Dblround.C */
-
-/* Use #defines for Permutations and Combinations -- Factoryl.C */
-
-#define log10P(n,r) (log10factorial(n)-log10factorial((n)-(r)))
-#define log10C(n,r) (log10P((n),(r))-log10factorial(r))
-
-double log10factorial(double N); /* Factoryl.C */
-
-double fibo(unsigned short term); /* Fibo.C */
-double frandom(int n); /* Frand.C */
-double ipow(double x, int n); /* Ipow.C */
-int ispow2(int x); /* Ispow2.C */
-long double ldfloor(long double a); /* Ldfloor.C */
-int initlogscale(long dmax, long rmax); /* Logscale.C */
-long logscale(long d); /* Logscale.C */
-
-float MSBINToIEEE(float f); /* Msb2Ieee.C */
-float IEEEToMSBIN(float f); /* Msb2Ieee.C */
-int perm_index (char pit[], int size); /* Perm_Idx.C */
-int round_div(int n, int d); /* Rnd_Div.C */
-long round_ldiv(long n, long d); /* Rnd_Div.C */
-double rad2deg(double rad); /* Rad2Deg.C */
-double deg2rad(double deg); /* Rad2Deg.C */
-
-#include "pi.h"
-#ifndef PHI
- #define PHI ((1.0+sqrt(5.0))/2.0) /* the golden number */
- #define INV_PHI (1.0/PHI) /* the golden ratio */
-#endif
-
-/*
-** File: ISQRT.C
-*/
-
-struct int_sqrt {
- unsigned sqrt,
- frac;
-};
-
-void usqrt(unsigned long x, struct int_sqrt *q);
-
-
-#endif /* SNIPMATH__H */
diff --git a/lib/CPUs/MIPS/bsp/examples/sniptype.h b/lib/CPUs/MIPS/bsp/examples/sniptype.h
deleted file mode 100644
index 399935d..0000000
--- a/lib/CPUs/MIPS/bsp/examples/sniptype.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* +++Date last modified: 05-Jul-1997 */
-
-/*
-** SNIPTYPE.H - Include file for SNIPPETS data types and commonly used macros
-*/
-
-#ifndef SNIPTYPE__H
-#define SNIPTYPE__H
-
-#include /* For free() */
-#include /* For NULL & strlen() */
-
-typedef enum {Error_ = -1, Success_, False_ = 0, True_} Boolean_T;
-
-/*#if !defined(WIN32) && !defined(_WIN32) && !defined(__NT__) \
- && !defined(_WINDOWS)
- #if !defined(OS2)*/
- typedef unsigned char BYTE;
- typedef unsigned long DWORD;
-/* #endif*/
- typedef unsigned short WORD;
-/*#else
- #define WIN32_LEAN_AND_MEAN
- #define NOGDI
- #define NOSERVICE
- #undef INC_OLE1
- #undef INC_OLE2
- #include
- #define HUGE
- #endif*/
-
-#define NUL '\0'
-#define LAST_CHAR(s) (((char *)s)[strlen(s) - 1])
-#define TOBOOL(x) (!(!(x)))
-#define FREE(p) (free(p),(p)=NULL)
-
-#endif /* SNIPTYPE__H */
diff --git a/lib/CPUs/MIPS/bsp/examples/specs/specs b/lib/CPUs/MIPS/bsp/examples/specs/specs
deleted file mode 100644
index 3871b63..0000000
--- a/lib/CPUs/MIPS/bsp/examples/specs/specs
+++ /dev/null
@@ -1,147 +0,0 @@
-*asm:
-%{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} %{mips16} %{mno-mips16:-no-mips16} %{mips3d} %{mno-mips3d:-no-mips3d} %{mdmx} %{mno-mdmx:-no-mdmx} %{mdsp} %{mno-dsp} %{mdspr2} %{mno-dspr2} %{msmartmips} %{mno-smartmips} %{mmt} %{mno-mt} %{mfix-vr4120} %{mfix-vr4130} %(subtarget_asm_optimizing_spec) %(subtarget_asm_debugging_spec) %{mabi=*} %{!mabi*: %(asm_abi_default_spec)} %{mgp32} %{mgp64} %{march=*} %{mxgot:-xgot} %{mfp32} %{mfp64} %{mshared} %{mno-shared} %{msym32} %{mno-sym32} %{mtune=*} %{v} %(subtarget_asm_spec)
-
-*asm_debug:
-%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}} %{fdebug-prefix-map=*:--debug-prefix-map %*}
-
-*asm_final:
-
-
-*asm_options:
-%{--target-help:%:print-asm-header()} %a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}
-
-*invoke_as:
-%{!S:-o %|.s |
- as %(asm_options) %m.s %A }
-
-*cpp:
-%(subtarget_cpp_spec)
-
-*cpp_options:
-%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef} %{save-temps:-fpch-preprocess}
-
-*cpp_debug_options:
-%{d*}
-
-*cpp_unique_options:
-%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}} %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{fmudflap:-D_MUDFLAP -include mf-runtime.h} %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h} %{E|M|MM:%W{o*}}
-
-*trad_capable_cpp:
-cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}
-
-*cc1:
-%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} %{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}} %{save-temps: } %(subtarget_cc1_spec)
-
-*cc1_options:
-%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{--help=*:--help=%(VALUE)} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants} %{coverage:-fprofile-arcs -ftest-coverage}
-
-*cc1plus:
-
-
-*link_gcc_c_sequence:
-%G %L %G
-
-*link_ssp:
-%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}
-
-*endfile:
-crtend%O%s crtn%O%s
-
-*link:
-%(endian_spec) %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} %{bestGnum} %{shared} %{non_shared}
-
-*lib:
---start-group %o -lc --end-group
-
-*mfwrap:
- %{static: %{fmudflap|fmudflapth: --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc --wrap=mmap --wrap=munmap --wrap=alloca} %{fmudflapth: --wrap=pthread_create}} %{fmudflap|fmudflapth: --wrap=main}
-
-*mflib:
-%{fmudflap|fmudflapth: -export-dynamic}
-
-*link_gomp:
-
-
-*libgcc:
--lgcc
-
-*startfile:
-crti%O%s crtbegin%O%s
-
-*switches_need_spaces:
-
-
-*cross_compile:
-1
-
-*version:
-4.3.3
-
-*multilib:
-. !msoft-float !EL !EB;soft-float msoft-float !EL !EB;el !msoft-float EL !EB;eb !msoft-float !EL EB;soft-float/el msoft-float EL !EB;soft-float/eb msoft-float !EL EB;
-
-*multilib_defaults:
-EL mips1 mabi=32
-
-*multilib_extra:
-
-
-*multilib_matches:
-mel EL;meb EB;m4650 msingle-float;msoft-float msoft-float;EL EL;EB EB;
-
-*multilib_exclusions:
-
-
-*multilib_options:
-msoft-float EL/EB
-
-*linker:
-collect2
-
-*link_libgcc:
-%D
-
-*md_exec_prefix:
-
-
-*md_startfile_prefix:
-
-
-*md_startfile_prefix_1:
-
-
-*startfile_prefix_spec:
-
-*sysroot_spec:
---sysroot=%R
-
-*sysroot_suffix_spec:
-
-
-*sysroot_hdrs_suffix_spec:
-
-
-*subtarget_cc1_spec:
-
-
-*subtarget_cpp_spec:
-
-
-*subtarget_asm_optimizing_spec:
-%{noasmopt:-O0} %{!noasmopt:%{O:-O2} %{O1:-O2} %{O2:-O2} %{O3:-O3}}
-
-*subtarget_asm_debugging_spec:
-%{g} %{g0} %{g1} %{g2} %{g3} %{ggdb:-g} %{ggdb0:-g0} %{ggdb1:-g1} %{ggdb2:-g2} %{ggdb3:-g3} %{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} %{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} %{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3} %{gcoff*:-mdebug} %{!gcoff*:-no-mdebug}
-
-*subtarget_asm_spec:
-
-
-*asm_abi_default_spec:
--mabi=32
-
-*endian_spec:
-%{!EB:%{!meb:-EL}} %{EB|meb:-EB}
-
-*link_command:
-%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S: %(linker) -T link/link.ld %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*} %(mfwrap) %(link_libgcc) %{lib} %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)} %(mflib) %{fprofile-arcs|fprofile-generate|coverage:-lgcov} %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/stanford.c b/lib/CPUs/MIPS/bsp/examples/stanford.c
deleted file mode 100644
index 907477b..0000000
--- a/lib/CPUs/MIPS/bsp/examples/stanford.c
+++ /dev/null
@@ -1,1117 +0,0 @@
-/* stanford baby benchmark suite from john hennessy --
-
-There are copies all around; the MIPS performance brief has up-to-date
-numbers for a bunch of machines. BUT, these wouldn't be my first
-choice. SPEC, the industry benchmark collection group, will probably
-specify a new set of benchmarks shortly and release then right after
-that. I imagine they will include espresso, gcc, and other large, but
-public domain programs, for real things.
-
-here's bench.c
- John Hennessy
-*/
-
-
-/* This is a suite of benchmarks that are relatively short, both in program
- size and execution time. It requires no input, and prints the execution
- time for each program, using the system- dependent routine Getclock,
- below, to find out the current CPU time. It does a rudimentary check to
- make sure each program gets the right output. These programs were
- gathered by John Hennessy and modified by Peter Nye.
-
-4.2 VERSION */
-
-#include
-#include
-#include
-#include
-
-#ifndef HZ
-#define HZ 60
-#endif
-#define nil 0
-#define false 0
-#define true 1
-#define bubblebase 1.61
-#define dnfbase 3.5
-#define permbase 1.75
-#define queensbase 1.83
-#define towersbase 2.39
-#define quickbase 1.92
-#define intmmbase 1.46
-#define treebase 2.5
-#define mmbase 0.0
-#define fpmmbase 2.92
-#define puzzlebase 0.5
-#define fftbase 0.0
-#define fpfftbase 4.44
- /* Towers */
-#define maxcells 18
-
- /* Intmm, Mm */
-#define rowsize 40
-
- /* Puzzle */
-#define size 511
-#define classmax 3
-#define typemax 12
-#define d 8
-
- /* Bubble, Quick */
-#define sortelements 5000
-#define srtelements 500
-
- /* fft */
-#define fftsize 256
-#define fftsize2 129
-/*
-type */
- /* Perm */
-#define permrange 10
-
- /* tree */
-struct node
-{
- struct node *left, *right;
- int val;
-};
-
-/* Towers *//*
- discsizrange = 1..maxcells; */
-#define stackrange 3
-/* cellcursor = 0..maxcells; */
-struct element
-{
- int discsize;
- int next;
-};
-/* emsgtype = packed array[1..15] of char;
-*/
-/* Intmm, Mm *//*
- index = 1 .. rowsize;
- intmatrix = array [index,index] of integer;
- realmatrix = array [index,index] of real;
- */
-/* Puzzle *//*
- piececlass = 0..classmax;
- piecetype = 0..typemax;
- position = 0..size;
- */
-/* Bubble, Quick *//*
- listsize = 0..sortelements;
- sortarray = array [listsize] of integer;
- */
- /* FFT */
-struct complex
-{
- float rp, ip;
-};
-/*
- carray = array [1..fftsize] of complex ;
- c2array = array [1..fftsize2] of complex ;
-*/
-
-float value;
-float fixed, floated;
-
- /* global */
-int timer;
-int xtimes[11];
-int seed;
-
- /* Perm */
-int permarray[permrange + 1];
-int pctr;
-
- /* tree */
-struct node *tree;
-
- /* Towers */
-int stack[stackrange + 1];
-struct element cellspace[maxcells + 1];
-int freelist, movesdone;
-
- /* Intmm, Mm */
-int ima[rowsize + 1][rowsize + 1], imb[rowsize + 1][rowsize + 1],
- imr[rowsize + 1][rowsize + 1];
-float rma[rowsize + 1][rowsize + 1], rmb[rowsize + 1][rowsize + 1],
- rmr[rowsize + 1][rowsize + 1];
-
- /* Puzzle */
-int piececount[classmax + 1],
- class[typemax + 1],
- piecemax[typemax + 1],
- puzzl[size + 1], p[typemax + 1][size + 1], n, kount;
-
- /* Bubble, Quick */
-int sortlist[sortelements + 1], biggest, littlest, top;
-
- /* FFT */
-struct complex z[fftsize + 1], w[fftsize + 1], e[fftsize2 + 1];
-float zr, zi;
-
-/* global procedures */
-
-int
-Getclock ()
-{
- struct tms rusage;
- times (&rusage);
- return ((60*rusage.tms_utime/HZ) * 50 / 3);
-};
-
-Initrand ()
-{
- seed = 74755;
-};
-
-int
-Rand ()
-{
- seed = (seed * 1309 + 13849) & 65535;
- return (seed);
-};
-
-
-
- /* Permutation program, heavily recursive, written by Denny Brown. */
-
-Swap (a, b)
- int *a, *b;
-{
- int t;
- t = *a;
- *a = *b;
- *b = t;
-};
-
-Initialize ()
-{
- int i;
- for (i = 1; i <= 7; i++)
- {
- permarray[i] = i - 1;
- };
-};
-
-Permute (n)
- int n;
-{ /* permute */
- int k;
- pctr = pctr + 1;
- if (n != 1)
- {
- Permute (n - 1);
- for (k = n - 1; k >= 1; k--)
- {
- Swap (&permarray[n], &permarray[k]);
- Permute (n - 1);
- Swap (&permarray[n], &permarray[k]);
- };
- };
-} /* permute */ ;
-
-Perm ()
-{ /* Perm */
- int i;
- pctr = 0;
- for (i = 1; i <= 5; i++)
- {
- Initialize ();
- Permute (7);
- };
- if (pctr != 43300)
- printf (" Error in Perm.\n");
-} /* Perm */ ;
-
-
-
- /* Program to Solve the Towers of Hanoi */
-
-Error (emsg)
- char *emsg;
-{
- printf (" Error in Towers: %s\n", emsg);
-};
-
-Makenull (s)
-{
- stack[s] = 0;
-};
-
-int
-Getelement ()
-{
- int temp;
- if (freelist > 0)
- {
- temp = freelist;
- freelist = cellspace[freelist].next;
- }
- else
- Error ("out of space ");
- return (temp);
-};
-
-Push (i, s)
- int i, s;
-{
- int errorfound, localel;
- errorfound = false;
- if (stack[s] > 0)
- if (cellspace[stack[s]].discsize <= i)
- {
- errorfound = true;
- Error ("disc size error");
- };
- if (!errorfound)
- {
- localel = Getelement ();
- cellspace[localel].next = stack[s];
- stack[s] = localel;
- cellspace[localel].discsize = i;
- }
-};
-
-Init (s, n)
- int s, n;
-{
- int discctr;
- Makenull (s);
- for (discctr = n; discctr >= 1; discctr--)
- Push (discctr, s);
-};
-
-int
-Pop (s)
- int s;
-{
- int temp, temp1;
- if (stack[s] > 0)
- {
- temp1 = cellspace[stack[s]].discsize;
- temp = cellspace[stack[s]].next;
- cellspace[stack[s]].next = freelist;
- freelist = stack[s];
- stack[s] = temp;
- return (temp1);
- }
- else
- Error ("nothing to pop ");
-};
-
-Move (s1, s2)
- int s1, s2;
-{
- Push (Pop (s1), s2);
- movesdone = movesdone + 1;
-};
-
-tower (i, j, k)
- int i, j, k;
-{
- int other;
- if (k == 1)
- Move (i, j);
- else
- {
- other = 6 - i - j;
- tower (i, other, k - 1);
- Move (i, j);
- tower (other, j, k - 1);
- }
-};
-
-
-Towers ()
-{ /* Towers */
- int i;
- for (i = 1; i <= maxcells; i++)
- cellspace[i].next = i - 1;
- freelist = maxcells;
- Init (1, 14);
- Makenull (2);
- Makenull (3);
- movesdone = 0;
- tower (1, 2, 14);
- if (movesdone != 16383)
- printf (" Error in Towers.\n");
-}; /* Towers */
-
-
- /* The eight queens problem, solved 50 times. */
-/*
- type
- doubleboard = 2..16;
- doublenorm = -7..7;
- boardrange = 1..8;
- aarray = array [boardrange] of boolean;
- barray = array [doubleboard] of boolean;
- carray = array [doublenorm] of boolean;
- xarray = array [boardrange] of boardrange;
-*/
-
-Try (i, q, a, b, c, x)
- int i, *q, a[], b[], c[], x[];
-{
- int j;
- j = 0;
- *q = false;
- while ((!*q) && (j != 8))
- {
- j = j + 1;
- *q = false;
- if (b[j] && a[i + j] && c[i - j + 7])
- {
- x[i] = j;
- b[j] = false;
- a[i + j] = false;
- c[i - j + 7] = false;
- if (i < 8)
- {
- Try (i + 1, q, a, b, c, x);
- if (!*q)
- {
- b[j] = true;
- a[i + j] = true;
- c[i - j + 7] = true;
- }
- }
- else
- *q = true;
- }
- }
-};
-
-Doit ()
-{
- int i, q;
- int a[9], b[17], c[15], x[9];
- i = 0 - 7;
- while (i <= 16)
- {
- if ((i >= 1) && (i <= 8))
- a[i] = true;
- if (i >= 2)
- b[i] = true;
- if (i <= 7)
- c[i + 7] = true;
- i = i + 1;
- };
-
- Try (1, &q, b, a, c, x);
- if (!q)
- printf (" Error in Queens.\n");
-};
-
-Queens ()
-{
- int i;
- for (i = 1; i <= 50; i++)
- Doit ();
-};
-
- /* Multiplies two integer matrices. */
-
-Initmatrix (m)
- int m[rowsize + 1][rowsize + 1];
-{
- int temp, i, j;
- for (i = 1; i <= rowsize; i++)
- for (j = 1; j <= rowsize; j++)
- {
- temp = Rand ();
- m[i][j] = temp - (temp / 120) * 120 - 60;
- }
-};
-
-Innerproduct (result, a, b, row, column)
- int *result, a[rowsize + 1][rowsize + 1], b[rowsize + 1][rowsize + 1],
- row, column;
- /* computes the inner product of A[row,*] and B[*,column] */
-{
- int i;
- *result = 0;
- for (i = 1; i <= rowsize; i++)
- *result = *result + a[row][i] * b[i][column];
-};
-
-Intmm ()
-{
- int i, j;
- Initrand ();
- Initmatrix (ima);
- Initmatrix (imb);
- for (i = 1; i <= rowsize; i++)
- for (j = 1; j <= rowsize; j++)
- Innerproduct (&imr[i][j], ima, imb, i, j);
-};
-
-
- /* Multiplies two real matrices. */
-
-rInitmatrix (m)
- float m[rowsize + 1][rowsize + 1];
-{
- int temp, i, j;
- for (i = 1; i <= rowsize; i++)
- for (j = 1; j <= rowsize; j++)
- {
- temp = Rand ();
- m[i][j] = (temp - (temp / 120) * 120 - 60) / 3;
- }
-};
-
-rInnerproduct (result, a, b, row, column)
- float *result, a[rowsize + 1][rowsize + 1], b[rowsize + 1][rowsize + 1];
- int row, column;
- /* computes the inner product of A[row,*] and B[*,column] */
-{
- int i;
- *result = 0.0;
- for (i = 1; i <= rowsize; i++)
- *result = *result + a[row][i] * b[i][column];
-};
-
-Mm ()
-{
- int i, j;
- Initrand ();
- rInitmatrix (rma);
- rInitmatrix (rmb);
- for (i = 1; i <= rowsize; i++)
- for (j = 1; j <= rowsize; j++)
- rInnerproduct (&rmr[i][j], rma, rmb, i, j);
-};
-
-
-
-
- /* A compute-bound program from Forest Baskett. */
-
-int
-Fit (i, j)
- int i, j;
-{
- int k;
- for (k = 0; k <= piecemax[i]; k++)
- if (p[i][k])
- if (puzzl[j + k])
- return (false);
- return (true);
-};
-
-int
-Place (i, j)
- int i, j;
-{
- int k;
- for (k = 0; k <= piecemax[i]; k++)
- if (p[i][k])
- puzzl[j + k] = true;
- piececount[class[i]] = piececount[class[i]] - 1;
- for (k = j; k <= size; k++)
- if (!puzzl[k])
- {
- return (k);
- };
- return (0);
-};
-
-Remove (i, j)
- int i, j;
-{
- int k;
- for (k = 0; k <= piecemax[i]; k++)
- if (p[i][k])
- puzzl[j + k] = false;
- piececount[class[i]] = piececount[class[i]] + 1;
-};
-
-int
-Trial (j)
- int j;
-{
- int i, k;
- kount = kount + 1;
- for (i = 0; i <= typemax; i++)
- if (piececount[class[i]] != 0)
- if (Fit (i, j))
- {
- k = Place (i, j);
- if (Trial (k) || (k == 0))
- {
- return (true);
- }
- else
- Remove (i, j);
- };
- return (false);
-};
-
-Puzzle ()
-{
- int i, j, k, m;
- for (m = 0; m <= size; m++)
- puzzl[m] = true;
- for (i = 1; i <= 5; i++)
- for (j = 1; j <= 5; j++)
- for (k = 1; k <= 5; k++)
- puzzl[i + d * (j + d * k)] = false;
- for (i = 0; i <= typemax; i++)
- for (m = 0; m <= size; m++)
- p[i][m] = false;
- for (i = 0; i <= 3; i++)
- for (j = 0; j <= 1; j++)
- for (k = 0; k <= 0; k++)
- p[0][i + d * (j + d * k)] = true;
- class[0] = 0;
- piecemax[0] = 3 + d * 1 + d * d * 0;
- for (i = 0; i <= 1; i++)
- for (j = 0; j <= 0; j++)
- for (k = 0; k <= 3; k++)
- p[1][i + d * (j + d * k)] = true;
- class[1] = 0;
- piecemax[1] = 1 + d * 0 + d * d * 3;
- for (i = 0; i <= 0; i++)
- for (j = 0; j <= 3; j++)
- for (k = 0; k <= 1; k++)
- p[2][i + d * (j + d * k)] = true;
- class[2] = 0;
- piecemax[2] = 0 + d * 3 + d * d * 1;
- for (i = 0; i <= 1; i++)
- for (j = 0; j <= 3; j++)
- for (k = 0; k <= 0; k++)
- p[3][i + d * (j + d * k)] = true;
- class[3] = 0;
- piecemax[3] = 1 + d * 3 + d * d * 0;
- for (i = 0; i <= 3; i++)
- for (j = 0; j <= 0; j++)
- for (k = 0; k <= 1; k++)
- p[4][i + d * (j + d * k)] = true;
- class[4] = 0;
- piecemax[4] = 3 + d * 0 + d * d * 1;
- for (i = 0; i <= 0; i++)
- for (j = 0; j <= 1; j++)
- for (k = 0; k <= 3; k++)
- p[5][i + d * (j + d * k)] = true;
- class[5] = 0;
- piecemax[5] = 0 + d * 1 + d * d * 3;
- for (i = 0; i <= 2; i++)
- for (j = 0; j <= 0; j++)
- for (k = 0; k <= 0; k++)
- p[6][i + d * (j + d * k)] = true;
- class[6] = 1;
- piecemax[6] = 2 + d * 0 + d * d * 0;
- for (i = 0; i <= 0; i++)
- for (j = 0; j <= 2; j++)
- for (k = 0; k <= 0; k++)
- p[7][i + d * (j + d * k)] = true;
- class[7] = 1;
- piecemax[7] = 0 + d * 2 + d * d * 0;
- for (i = 0; i <= 0; i++)
- for (j = 0; j <= 0; j++)
- for (k = 0; k <= 2; k++)
- p[8][i + d * (j + d * k)] = true;
- class[8] = 1;
- piecemax[8] = 0 + d * 0 + d * d * 2;
- for (i = 0; i <= 1; i++)
- for (j = 0; j <= 1; j++)
- for (k = 0; k <= 0; k++)
- p[9][i + d * (j + d * k)] = true;
- class[9] = 2;
- piecemax[9] = 1 + d * 1 + d * d * 0;
- for (i = 0; i <= 1; i++)
- for (j = 0; j <= 0; j++)
- for (k = 0; k <= 1; k++)
- p[10][i + d * (j + d * k)] = true;
- class[10] = 2;
- piecemax[10] = 1 + d * 0 + d * d * 1;
- for (i = 0; i <= 0; i++)
- for (j = 0; j <= 1; j++)
- for (k = 0; k <= 1; k++)
- p[11][i + d * (j + d * k)] = true;
- class[11] = 2;
- piecemax[11] = 0 + d * 1 + d * d * 1;
- for (i = 0; i <= 1; i++)
- for (j = 0; j <= 1; j++)
- for (k = 0; k <= 1; k++)
- p[12][i + d * (j + d * k)] = true;
- class[12] = 3;
- piecemax[12] = 1 + d * 1 + d * d * 1;
- piececount[0] = 13;
- piececount[1] = 3;
- piececount[2] = 1;
- piececount[3] = 1;
- m = 1 + d * (1 + d * 1);
- kount = 0;
- if (Fit (0, m))
- n = Place (0, m);
- else
- printf ("Error1 in Puzzle\n");
- if (!Trial (n))
- printf ("Error2 in Puzzle.\n");
- else if (kount != 2005)
- printf ("Error3 in Puzzle.\n");
-};
-
-
-
- /* Sorts an array using quicksort */
-
-Initarr ()
-{
- int i, temp;
- Initrand ();
- biggest = 0;
- littlest = 0;
- for (i = 1; i <= sortelements; i++)
- {
- temp = Rand ();
- sortlist[i] = temp - (temp / 100000) * 100000 - 50000;
-
- if (sortlist[i] > biggest)
- biggest = sortlist[i];
- else if (sortlist[i] < littlest)
- littlest = sortlist[i];
- };
-};
-
-Quicksort (a, l, r)
- int a[], l, r;
- /* quicksort the array A from start to finish */
-{
- int i, j, x, w;
-
- i = l;
- j = r;
- x = a[(l + r) / 2];
- do
- {
- while (a[i] < x)
- i = i + 1;
- while (x < a[j])
- j = j - 1;
- if (i <= j)
- {
- w = a[i];
- a[i] = a[j];
- a[j] = w;
- i = i + 1;
- j = j - 1;
- }
- }
- while (i <= j);
- if (l < j)
- Quicksort (a, l, j);
- if (i < r)
- Quicksort (a, i, r);
-};
-
-
-Quick ()
-{
- Initarr ();
- Quicksort (sortlist, 1, sortelements);
- if ((sortlist[1] != littlest) || (sortlist[sortelements] != biggest))
- {
- printf (" Error in Quick.\n");
- }
-
-};
-
-
- /* Sorts an array using treesort */
-
-tInitarr ()
-{
- int i, temp;
- Initrand ();
- biggest = 0;
- littlest = 0;
- for (i = 1; i <= sortelements; i++)
- {
- temp = Rand ();
- sortlist[i] = temp - (temp / 100000) * 100000 - 50000;
- if (sortlist[i] > biggest)
- biggest = sortlist[i];
- else if (sortlist[i] < littlest)
- littlest = sortlist[i];
- };
-
-};
-
-CreateNode (t, n)
- struct node **t;
- int n;
-{
- *t = (struct node *) malloc (sizeof (struct node));
- (*t)->left = nil;
- (*t)->right = nil;
- (*t)->val = n;
-};
-
-Insert (n, t)
- int n;
- struct node *t;
- /* insert n into tree */
-{
- if (n > t->val)
- if (t->left == nil)
- CreateNode (&t->left, n);
- else
- Insert (n, t->left);
- else if (n < t->val)
- if (t->right == nil)
- CreateNode (&t->right, n);
- else
- Insert (n, t->right);
-};
-
-int
-Checktree (p)
- struct node *p;
- /* check by inorder traversal */
-{
- int result;
- result = true;
- if (p->left != nil)
- if (p->left->val <= p->val)
- result = false;
- else
- result = Checktree (p->left) && result;
- if (p->right != nil)
- if (p->right->val >= p->val)
- result = false;
- else
- result = Checktree (p->right) && result;
- return (result);
-}; /* checktree */
-
-Trees ()
-{
- int i;
- tInitarr ();
- tree = (struct node *) malloc (sizeof (struct node));
- tree->left = nil;
- tree->right = nil;
- tree->val = sortlist[1];
- for (i = 2; i <= sortelements; i++)
- Insert (sortlist[i], tree);
- if (!Checktree (tree))
- printf (" Error in Tree.\n");
-};
-
-
- /* Sorts an array using bubblesort */
-
-bInitarr ()
-{
- int i, temp;
- Initrand ();
- biggest = 0;
- littlest = 0;
- for (i = 1; i <= srtelements; i++)
- {
- temp = Rand ();
- sortlist[i] = temp - (temp / 100000) * 100000 - 50000;
- if (sortlist[i] > biggest)
- biggest = sortlist[i];
- else if (sortlist[i] < littlest)
- littlest = sortlist[i];
- };
-};
-
-Bubble ()
-{
- int i, j;
- bInitarr ();
- top = srtelements;
-
- while (top > 1)
- {
-
- i = 1;
- while (i < top)
- {
-
- if (sortlist[i] > sortlist[i + 1])
- {
- j = sortlist[i];
- sortlist[i] = sortlist[i + 1];
- sortlist[i + 1] = j;
- };
- i = i + 1;
- };
-
- top = top - 1;
- };
- if ((sortlist[1] != littlest) || (sortlist[srtelements] != biggest))
- printf ("Error3 in Bubble.\n");
-};
-
-
-float
-Cos (x)
- float x;
-/* computes cos of x (x in radians) by an expansion */
-{
- int i, factor;
- float result, power;
-
- result = 1.0;
- factor = 1;
- power = x;
- for (i = 2; i <= 10; i++)
- {
- factor = factor * i;
- power = power * x;
- if ((i & 1) == 0)
- {
- if ((i & 3) == 0)
- result = result + power / factor;
- else
- result = result - power / factor;
- };
- };
- return (result);
-};
-
-int
-Min0 (arg1, arg2)
- int arg1, arg2;
-{
- if (arg1 < arg2)
- return (arg1);
- else
- return (arg2);
-};
-
-Printcomplex (arg1, arg2, zarray, start, finish, increment)
- int arg1, arg2, start, finish, increment;
- struct complex zarray[];
-{
- int i;
- printf ("\n");
-
- i = start;
- do
- {
- printf (" %15.3e%15.3e", zarray[i].rp, zarray[i].ip);
- i = i + increment;
- printf (" %15.3e%15.3e", zarray[i].rp, zarray[i].ip);
- printf ("\n");
- i = i + increment;
- }
- while (i <= finish);
-
-};
-
-Uniform11 (iy, yfl)
- int iy;
- float yfl;
-{
- iy = (4855 * iy + 1731) & 8191;
- yfl = iy / 8192.0;
-} /* uniform */ ;
-
-Exptab (n, e)
- int n;
- struct complex e[];
-
-{ /* exptab */
- float theta, divisor, h[26];
- int i, j, k, l, m;
-
- theta = 3.1415926536;
- divisor = 4.0;
- for (i = 1; i <= 25; i++)
- {
- h[i] = 1 / (2 * Cos (theta / divisor));
- divisor = divisor + divisor;
- };
-
- m = n / 2;
- l = m / 2;
- j = 1;
- e[1].rp = 1.0;
- e[1].ip = 0.0;
- e[l + 1].rp = 0.0;
- e[l + 1].ip = 1.0;
- e[m + 1].rp = -1.0;
- e[m + 1].ip = 0.0;
-
- do
- {
- i = l / 2;
- k = i;
-
- do
- {
- e[k + 1].rp = h[j] * (e[k + i + 1].rp + e[k - i + 1].rp);
- e[k + 1].ip = h[j] * (e[k + i + 1].ip + e[k - i + 1].ip);
- k = k + l;
- }
- while (k <= m);
-
- j = Min0 (j + 1, 25);
- l = i;
- }
- while (l > 1);
-
-} /* exptab */ ;
-
-Fft (n, z, w, e, sqrinv)
- int n;
- struct complex z[], w[];
- struct complex e[];
- float sqrinv;
-{
- int i, j, k, l, m, index;
- m = n / 2;
- l = 1;
-
- do
- {
- k = 0;
- j = l;
- i = 1;
-
- do
- {
-
- do
- {
- w[i + k].rp = z[i].rp + z[m + i].rp;
- w[i + k].ip = z[i].ip + z[m + i].ip;
- w[i + j].rp = e[k + 1].rp * (z[i].rp - z[i + m].rp)
- - e[k + 1].ip * (z[i].ip - z[i + m].ip);
- w[i + j].ip = e[k + 1].rp * (z[i].ip - z[i + m].ip)
- + e[k + 1].ip * (z[i].rp - z[i + m].rp);
- i = i + 1;
- }
- while (i <= j);
-
- k = j;
- j = k + l;
- }
- while (j <= m);
-
- /*z = w ; */ index = 1;
- do
- {
- z[index] = w[index];
- index = index + 1;
- }
- while (index <= n);
- l = l + l;
- }
- while (l <= m);
-
- for (i = 1; i <= n; i++)
- {
- z[i].rp = sqrinv * z[i].rp;
- z[i].ip = -sqrinv * z[i].ip;
- };
-
-};
-
-Oscar ()
-{ /* oscar */
- int i;
- Exptab (fftsize, e);
- seed = 5767;
- for (i = 1; i <= fftsize; i++)
- {
- Uniform11 (seed, zr);
- Uniform11 (seed, zi);
- z[i].rp = 20.0 * zr - 10.0;
- z[i].ip = 20.0 * zi - 10.0;
- };
-
-
- for (i = 1; i <= 20; i++)
- {
- Fft (fftsize, z, w, e, 0.0625);
-// Printcomplex( 6, 99, z, 1, 256, 17 );
- };
-} /* oscar */ ;
-
-main ()
-{
- int i;
- fixed = 0.0;
- floated = 0.0;
- printf ("Starting \n");
-/* rewrite (output); */
- setbuf(stdout, nil);
- printf (" Perm");
- timer = Getclock ();
- Perm ();
- xtimes[1] = Getclock () - timer;
- fixed = fixed + permbase * xtimes[1];
- floated = floated + permbase * xtimes[1];
- printf (" Towers");
- timer = Getclock ();
- Towers ();
- xtimes[2] = Getclock () - timer;
- fixed = fixed + towersbase * xtimes[2];
- floated = floated + towersbase * xtimes[2];
- printf (" Queens");
- timer = Getclock ();
- Queens ();
- xtimes[3] = Getclock () - timer;
- fixed = fixed + queensbase * xtimes[3];
- floated = floated + queensbase * xtimes[3];
- printf (" Intmm");
- timer = Getclock ();
- Intmm ();
- xtimes[4] = Getclock () - timer;
- fixed = fixed + intmmbase * xtimes[4];
- floated = floated + intmmbase * xtimes[4];
- printf (" Mm");
- timer = Getclock ();
- Mm ();
- xtimes[5] = Getclock () - timer;
- fixed = fixed + mmbase * xtimes[5];
- floated = floated + fpmmbase * xtimes[5];
- printf (" Puzzle");
- timer = Getclock ();
- Puzzle ();
- xtimes[6] = Getclock () - timer;
- fixed = fixed + puzzlebase * xtimes[6];
- floated = floated + puzzlebase * xtimes[6];
- printf (" Quick");
- timer = Getclock ();
- Quick ();
- xtimes[7] = Getclock () - timer;
- fixed = fixed + quickbase * xtimes[7];
- floated = floated + quickbase * xtimes[7];
- printf (" Bubble");
- timer = Getclock ();
- Bubble ();
- xtimes[8] = Getclock () - timer;
- fixed = fixed + bubblebase * xtimes[8];
- floated = floated + bubblebase * xtimes[8];
- printf (" Tree");
- timer = Getclock ();
- Trees ();
- xtimes[9] = Getclock () - timer;
- fixed = fixed + treebase * xtimes[9];
- floated = floated + treebase * xtimes[9];
- printf (" FFT");
- timer = Getclock ();
- Oscar ();
- xtimes[10] = Getclock () - timer;
- fixed = fixed + fftbase * xtimes[10];
- floated = floated + fpfftbase * xtimes[10];
- printf ("\n");
- for (i = 1; i <= 10; i++)
- printf ("%8d", xtimes[i]);
- printf ("\n");
- /* compute composites */
- printf ("\n");
- printf ("Nonfloating point composite is %10.0f\n", fixed / 10.0);
- printf ("\n");
- printf ("Floating point composite is %10.0f\n", floated / 10.0);
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/startup.S b/lib/CPUs/MIPS/bsp/examples/startup.S
deleted file mode 100644
index b3eb382..0000000
--- a/lib/CPUs/MIPS/bsp/examples/startup.S
+++ /dev/null
@@ -1,87 +0,0 @@
- .file "startup.S"
-
- .section .rodata
- .data
-argv0: .asciz "\"This-MIPS-program\""
-argv: .word argv0
-
- .text
- .section .start, "ax"
- .extern _init
- .extern libsys_init
- .extern _exc_vect_start
- .extern _xcpt_handler
- .align 2
- .globl _start
-_start:
- .set noreorder
- j init
- nop
- .set reorder
-
- .text
- .set noreorder
-init:
- # Set stack pointer
- la $sp, stack_ptr
- # Set global pointer
- la $gp, _gp
-
- # zero bss
- la $8, __bss_start
- la $9, _end
-$zeroise:
- sw $0, 0($8)
- bne $8, $9, $zeroise
- addiu $8, 4
-
- # Install exception vector jump code
- la $t1, _exc_vect_copy_start
- la $t2, _exc_vect_copy_end
- la $t0, _exc_vect_start
-
-$install: lw $v0, 0($t1)
- addiu $t1, 4
- sw $v0, 0($t0)
- bne $t1, $t2, $install
- addiu $t0, 4
-
- # Call _init
- la $k0, _init
- jalr $k0
- nop
-
- # Call libsys_init
- la $k0, libsys_init
- jalr $k0
- nop
-
- # Set user-mode
- mfc0 $a0, $12
- li $a1, 3
- or $a0, $a1
- mtc0 $a0, $12
-
- # Set environment
- li $a0, 1
- la $a1, argv
-
- # Call main
- la $k0, main
- jalr $k0
- nop
-
- # Terminate after main returns
-_terminate:
- nop
- la $t0, exit
- jalr $t0
- move $a0, $v0
-
-_exc_vect_copy_start:
- la $k0, _xcpt_handler
- jr $k0
- nop
-_exc_vect_copy_end:
-
- .set reorder
diff --git a/lib/CPUs/MIPS/bsp/examples/test_ac97.c b/lib/CPUs/MIPS/bsp/examples/test_ac97.c
deleted file mode 100644
index 12dce79..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_ac97.c
+++ /dev/null
@@ -1,310 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include "libsys.h"
-
-#define PI 3.1415926535897932384626433832795
-#define SAMPLE_RATE 48000
-#define BUF_SIZE (2*4800)
-#define REC_BUF_SIZE (5*60*2*SAMPLE_RATE)
-
-INT32 *buffer;
-INT32 *rec_buffer;
-UINT32 buf_size;
-
-INT32 * volatile pPtr_r;
-INT32 * volatile pPtr_w;
-UINT32 gcnt, led_cnt;
-volatile INT32 sample_left, sample_right;
-
-#define AC97_REG_RESET 0x00
-#define AC97_REG_VOLO_MST 0x02
-#define AC97_REG_VOLO_HP 0x04
-#define AC97_REG_VOLO_MONO 0x06
-#define AC97_REG_VOLI_BEEP 0x0A
-#define AC97_REG_VOLI_PHONE 0x0C
-#define AC97_REG_VOLI_MIC 0x0E
-#define AC97_REG_VOLI_LINE 0x10
-#define AC97_REG_VOLI_CD 0x12
-#define AC97_REG_VOLI_VIDEO 0x14
-#define AC97_REG_VOLI_AUX 0x16
-#define AC97_REG_VOLI_PCM 0x18
-#define AC97_REG_REC_SRC 0x1A
-#define AC97_REG_REC_GAIN 0x1C
-#define AC97_REG_EXTCTRL 0x2A
-#define AC97_REG_RATE_DAC 0x2C
-#define AC97_REG_RATE_ADC 0x32
-
-UINT32 ac97_status(UINT32 reg)
-{
- UINT32 offset;
- volatile UINT32 *pAC_stat = (UINT32*)SYS_AC97_STAT;
- volatile UINT32 *pAC_stat_ac = (UINT32*)SYS_AC97_ACSTAT;
-
- offset = (reg & 0x7E);
-
- // Wait if previous command is still pending
- while(*pAC_stat & 1);
-
- *(pAC_stat_ac + offset) = 0;
-
- // Wait for data valid
- while(!(*pAC_stat & 2));
-
- return *pAC_stat_ac;
-}
-
-void ac97_ctrl(UINT32 reg, UINT16 value)
-{
- UINT32 offset;
- volatile UINT32 *pAC_stat = (UINT32*)SYS_AC97_STAT;
- volatile UINT32 *pAC_ctrl_ac = (UINT32*)SYS_AC97_ACCTRL;
-
- offset = (reg & 0x7E);
-
- // Wait if previous command is still pending
- while(*pAC_stat & 1);
-
- *(pAC_ctrl_ac + offset) = value;
-
-}
-
-void ac97_isr_rec(void)
-{
- int i, size;
- volatile UINT32 *pReg = (UINT32*)SYS_LED_PORT;
- volatile UINT32 *pAC_stat = (UINT32*)SYS_AC97_STAT;
- volatile INT32 *pAC_pcm = (INT32*)SYS_AC97_PCM;
-
- if (!gcnt)
- {
- gcnt = SAMPLE_RATE;
- *pReg = led_cnt++;
- }
- gcnt--;
-
- *pPtr_w++ = pAC_pcm[3];
- if (pPtr_w == &buffer[buf_size])
- pPtr_w = buffer;
-
- *pPtr_w++ = pAC_pcm[4];
- if (pPtr_w == &buffer[buf_size])
- pPtr_w = buffer;
-
- CP0_TR_write(pAC_pcm[3]);
- CP0_TR_write(pAC_pcm[4]);
-
-}
-
-void ac97_isr_play(void)
-{
- int i, size;
- volatile UINT32 *pReg = (UINT32*)SYS_LED_PORT;
- volatile UINT32 *pAC_stat = (UINT32*)SYS_AC97_STAT;
- volatile INT32 *pAC_pcm = (INT32*)SYS_AC97_PCM;
-
- if (!gcnt)
- {
- gcnt = SAMPLE_RATE;
- *pReg = led_cnt++;
- }
- gcnt--;
-
- *pAC_pcm = *pPtr_r++;
- if (pPtr_r == &buffer[buf_size])
- pPtr_r = buffer;
-}
-
-void ac97_isr_pass(void)
-{
- int i, size;
- volatile UINT32 *pReg = (UINT32*)SYS_LED_PORT;
- volatile UINT32 *pAC_stat = (UINT32*)SYS_AC97_STAT;
- volatile INT32 *pAC_pcm = (INT32*)SYS_AC97_PCM;
-
- if (!gcnt)
- {
- gcnt = SAMPLE_RATE;
- *pReg = led_cnt++;
- }
- gcnt--;
-
- if (*pAC_stat & 0x08)
- {
-
-// CP0_TR_write(pAC_pcm[3]);
-// CP0_TR_write(pAC_pcm[4]);
-
- *pPtr_w++ = pAC_pcm[3];
- if (pPtr_w == &buffer[buf_size])
- pPtr_w = buffer;
-
- *pPtr_w++ = pAC_pcm[4];
- if (pPtr_w == &buffer[buf_size])
- pPtr_w = buffer;
- }
-
- if (pPtr_r != pPtr_w)
- {
- *pAC_pcm = *pPtr_r++;
- if (pPtr_r == &buffer[buf_size])
- pPtr_r = buffer;
- }
-
-}
-
-int main (void)
-{
- int result, i, j;
- volatile UINT32 *pReg = (UINT32*)SYS_LED_PORT;
- volatile UINT32 *pGPIO1 = (UINT32*)SYS_GPIO1;
- volatile UINT32 *pAC_ctrl = (UINT32*)SYS_AC97_CTRL;
- volatile UINT32 *pAC_stat = (UINT32*)SYS_AC97_STAT;
- volatile UINT32 *pAC_ctrl_ac = (UINT32*)SYS_AC97_ACCTRL;
- volatile UINT32 *pAC_stat_ac = (UINT32*)SYS_AC97_ACSTAT;
- volatile UINT32 *pAC_pcm = (UINT32*)SYS_AC97_PCM;
- double phi, dphi, y, mean;
- char sel, cmd;
- char buf[1024];
- FILE *pFile = stdout;
-
-// setbuf(stderr, NULL);
-//
- fprintf(pFile, "AC-97 Test\n");
- fprintf(pFile, "Status : %8.8X\n", *pAC_ctrl);
-
- ac97_ctrl(AC97_REG_VOLO_MST, 0);
- ac97_ctrl(AC97_REG_VOLO_HP, 0);
- ac97_ctrl(AC97_REG_VOLI_LINE, 0x8808);
- ac97_ctrl(AC97_REG_VOLI_PCM, 0x0808);
- ac97_ctrl(AC97_REG_REC_SRC, 0x0404);
- ac97_ctrl(AC97_REG_REC_GAIN, 0);
- ac97_ctrl(AC97_REG_EXTCTRL, 1);
-
- ac97_ctrl(AC97_REG_RATE_DAC, SAMPLE_RATE);
- ac97_ctrl(AC97_REG_RATE_ADC, SAMPLE_RATE);
-
- led_cnt = 0;
- gcnt = SAMPLE_RATE;
-
- fprintf(pFile, "DAC-Rate : %d\n", ac97_status(AC97_REG_RATE_DAC));
- fprintf(pFile, "ADC-Rate : %d\n", ac97_status(AC97_REG_RATE_ADC));
-
- *pGPIO1 = 0x04;
-
- while(1)
- {
- fprintf(pFile, "Aufnehmen und Abspielen (1)\n");
- fprintf(pFile, "Sinus Ton (2)\n");
- fprintf(pFile, "Pass through (3)\n");
- fprintf(pFile, "Eingabe: ");
-
- scanf("%c", &sel);
-// sel = 0x31;
-
- if (sel == 0x31)
- {
- buf_size = REC_BUF_SIZE;
- buffer = (INT32*)malloc(REC_BUF_SIZE*sizeof(INT32));
-// memset(buffer, 0, sizeof(REC_BUF_SIZE*sizeof(INT32)));
- pPtr_r = buffer;
- pPtr_w = buffer;
-
- ac97_ctrl(AC97_REG_VOLI_LINE, 0x0808);
-
- cmd = 0;
- while(1)
- {
- switch (cmd)
- {
- case 'r':
- ac97_ctrl(AC97_REG_VOLI_LINE, 0x0808);
- pPtr_w = buffer;
- fprintf(pFile, "Aufnahme\n");
- interrupt_register(5, ac97_isr_rec);
- interrupt_enable(5);
- *pAC_ctrl = 0x24;
- break;
-
- case 'p':
- ac97_ctrl(AC97_REG_VOLI_LINE, 0x8808);
- pPtr_r = buffer;
- fprintf(pFile, "Wiedergabe\n");
- interrupt_register(5, ac97_isr_play);
- interrupt_enable(5);
- *pAC_ctrl = 0x12;
- break;
-
- case ' ':
- ac97_ctrl(AC97_REG_VOLI_LINE, 0x0808);
- fprintf(pFile, "Stop\n");
- memset(buffer, 0, sizeof(REC_BUF_SIZE*sizeof(INT32)));
- *pAC_ctrl = 0x00;
- pPtr_r = buffer;
- pPtr_w = buffer;
- break;
-
- default:
- fprintf(pFile, "Aufnahme (R)\n");
- fprintf(pFile, "Wiedergabe (P)\n");
- fprintf(pFile, "Stop (Space)\n");
- break;
- }
- cmd = readchar(0);
- }
- }
- if (sel == 0x32)
- {
- buf_size = BUF_SIZE;
- buffer = (INT32*)malloc(REC_BUF_SIZE*sizeof(INT32));
- memset(buffer, 0, sizeof(REC_BUF_SIZE*sizeof(INT32)));
- pPtr_r = buffer;
- pPtr_w = buffer;
-
- dphi = 120*2*PI/BUF_SIZE;
- phi = 0;
- for (i=0; i < BUF_SIZE/2; i++)
- {
- y = cos(phi);
- buffer[2*i+0] = (INT32)(32000*y);
- buffer[2*i+1] = (INT32)(32000*y);
- phi = fmod((phi + dphi), 2.0*PI);
- }
-
- fprintf(stderr, "Status : %8.8X\n", *pAC_ctrl);
-
- interrupt_register(5, ac97_isr_play);
- interrupt_enable(5);
- *pAC_ctrl = 0x12;
-
- fprintf(stderr, "Status : %8.8X\n", *pAC_ctrl);
-
- while(1)
- {
- fprintf(stderr, "Status : %8.8X\n", *pAC_ctrl);
- }
- }
- if (sel == 0x33)
- {
-
- buf_size = BUF_SIZE;
- buffer = (INT32*)malloc(BUF_SIZE*sizeof(INT32));
- memset(buffer, 0, sizeof(BUF_SIZE*sizeof(INT32)));
- pPtr_r = buffer;
- pPtr_w = buffer;
- *pAC_ctrl = 0x32;
- interrupt_register(5, ac97_isr_pass);
- interrupt_enable(5);
-
- fprintf(stdout, "Status : %8.8X\n", *pAC_ctrl);
-
- while(1);
- }
- }
-
- return 0;
-
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/test_dcache.c b/lib/CPUs/MIPS/bsp/examples/test_dcache.c
deleted file mode 100644
index 74327d1..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_dcache.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include
-#include
-#include "libsys.h"
-#include "libsys.h"
-
-UINT32 tset(UINT32 *pMem)
-{
-
- __asm__
- (
- ".set noreorder\n"
- ".set nomacro\n"
- "addiu $t1, $0, 0x5555\n"
- "lw $t0, 0(%[pMem])\n"
- "sw $t1, 24(%[pMem])\n"
- "addiu $t0, 8\n"
- "sw $t0, 0(%[pMem])\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "nop\n"
- "lw $v0, 24(%[pMem])\n"
- ".set macro\n"
- ".set reorder\n"
- :
- : [pMem] "r" (pMem)
- : "t0", "t1"
- );
-}
-
-int main(void)
-{
- int i;
- volatile int *pLED = (int*)SYS_LED_PORT;
- UINT64 *pBuf64;
- UINT32 *pPtr;
-
- pBuf64 = (UINT64*)0x4000FC80; //malloc(1024*sizeof(UINT32));
-
- pPtr = (UINT32*)pBuf64;
-
- for(i=0; i < 1024; i++)
- *pPtr++ = i;
-
- pPtr = (UINT32*)pBuf64;
- sputs("Ptr: "); print_word((int)pPtr); sputs("\n");
- DCACHE_invalidate_all();
-
-
- *pLED = tset(pPtr);
-
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/test_endianess.c b/lib/CPUs/MIPS/bsp/examples/test_endianess.c
deleted file mode 100644
index 8f0d737..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_endianess.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#include
-#include
-#include
-#include "libsys.h"
-
-#define TEST_SIZE 32768
-int main (void)
-{
- int i;
- UINT16 *ram16;
- UINT32 sr;
- UINT32 volatile *pReg = (UINT32*)SYS_LED_PORT;
-
- *pReg = 0;
-
- sr = CP0_SR_read();
-
- ram16 = (UINT16*)calloc(TEST_SIZE/2,sizeof(UINT16));
-
- CP0_SR_write(sr | (1 << 25));
-
- for (i=0; i < TEST_SIZE/2; i++)
- ram16[i] = (UINT16)i;
-
- for (i=TEST_SIZE/2-1; i >= 0; i--)
- if (ram16[i] != (UINT16)i)
- break;
-
- i++;
- if (i)
- *pReg = 0xFFFFFFFF;
- else
- *pReg = 1;
-
-
- free(ram16);
-
- ram16 = (UINT16*)calloc(TEST_SIZE/2,sizeof(UINT16));
-
- *pReg = 0;
- CP0_SR_write(sr & ~(1 << 25));
-
- for (i=0; i < TEST_SIZE/2; i++)
- ram16[i] = (UINT16)i;
-
- for (i=TEST_SIZE/2-1; i >= 0; i--)
- if (ram16[i] != (UINT16)i)
- break;
-
- i++;
- if (i)
- *pReg = 0xFFFFFFFF;
- else
- *pReg = 1;
-
-
- free(ram16);
-
-
-// sputs("Status : ");print_word(sr);sputs("\n");
-
- return 0;
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/test_exception.c b/lib/CPUs/MIPS/bsp/examples/test_exception.c
deleted file mode 100644
index 34a0bca..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_exception.c
+++ /dev/null
@@ -1,282 +0,0 @@
-#include
-#include
-#include "libsys.h"
-
-void _exc_break(void)
-{
- __asm
- (
- ".set noreorder\n"
- "break 0x9\n"
- ".set reorder\n"
-
- );
-}
-
-void _exc_syscall(UINT32 code, UINT32 arg)
-{
- __asm
- (
- "move $v0, %[code]\n"
- "move $a0, %[arg]\n"
- "syscall\n"
- :
- : [code] "r" (code), [arg] "r" (arg)
- : "v0", "a0"
-
- );
-}
-
-void _exc_arith(void)
-{
- __asm
- (
- ".set noreorder\n"
- " li $t0, 0x7FFFFFFF\n"
- " addi $t1, $t0, 2\n"
- ".set reorder\n"
-
- );
-}
-
-void _exc_store_err(void)
-{
- volatile int *pSrc = (int*)SYS_TIMER_SEC;
- volatile int *pDst = (int*)0x40000001;
-
- *pDst = *pSrc;
-
-}
-
-void _exc_load_err(void)
-{
- __asm
- (
- ".set noreorder\n"
- " li $t0, 0x40000000\n"
- " li $t1, 0x40000000\n"
- " lw $t1, 0($t1)\n"
- " lw $t0, 2($t0)\n"
- " lw $t1, 4($t0)\n"
- "nop\n"
- ".set reorder\n"
-
- );
-
-}
-
-void _exc_kaddr_err(void)
-{
- __asm
- (
- ".set noreorder\n"
- " li $t0, 0x80000000\n"
- " jr $t0\n"
- "nop\n"
- ".set reorder\n"
-
- );
-
-}
-
-void _exc_iaddr_daddr_err(void)
-{
- __asm
- (
- ".set noreorder\n"
- " li $t0, 0x40000003\n"
- " li $t1, 0x40000002\n"
- " jr $t0\n"
- " lw $t1, 0($t1)\n"
- "nop\n"
- ".set reorder\n"
-
- );
-
-}
-
-void _exc_daddr_iaddr_err(void)
-{
- __asm
- (
- ".set noreorder\n"
- " li $t0, 0x40000003\n"
- " li $t1, 0x40000002\n"
- " lw $t1, 0($t1)\n"
- " jr $t0\n"
- "nop\n"
- ".set reorder\n"
-
- );
-
-}
-
-void _exc_iaddr_err(void)
-{
- __asm
- (
- ".set noreorder\n"
- " li $t0, 0x40000003\n"
- " jr $t0\n"
- "nop\n"
- ".set reorder\n"
-
- );
-
-}
-
-void _exc_ri(void)
-{
- __asm
- (
- ".set noreorder\n"
- " li $t0, 0x40010000\n"
- " li $t1, 0x9c563442\n"
- " sw $t1, 0($t0)\n"
- " jr $t0\n"
- "nop\n"
- ".set reorder\n"
-
- );
-
-}
-
-void _exc_ibe(void)
-{
- __asm
- (
- ".set noreorder\n"
- " li $t1, 0x10000000\n"
- " jr $t1\n"
- "nop\n"
- ".set reorder\n"
-
- );
-
-}
-
-void _exc_dbe(void)
-{
- __asm
- (
- ".set noreorder\n"
- " li $t1, 0x10000000\n"
- " lw $t0, 0($t1)\n"
- "nop\n"
- " jr $t0\n"
- "nop\n"
- ".set reorder\n"
-
- );
-
-}
-
-void handler0(void)
-{
- printf("Interrupt 0\n");
- interrupt_clr(0);
-}
-
-void handler1(void)
-{
- printf("Interrupt 1\n");
- interrupt_clr(1);
-}
-
-int main(void)
-{
- int buf[256];
- int i, sel;
-
- interrupt_register(0, handler0);
- interrupt_enable(0);
- interrupt_register(1, handler1);
- interrupt_enable(1);
-
- while(1)
- {
- printf("Welche exception möchten Sie testen?\n");
- printf(" 1 : Reserved instruction\n");
- printf(" 2 : Privileged address (BadVAddr = 0x80000000)\n");
- printf(" 3 : Arithmetic overflow\n");
- printf(" 4 : Syscall\n");
- printf(" 5 : Breakpoint\n");
- printf(" 6 : Load error on instruction (BadVAddr = 0x40000003)\n");
- printf(" 7 : Load error on data (BadVAddr = 0x40000002)\n");
- printf(" 8 : Store error on data (BadVAddr = 0x40000001)\n");
- printf(" 9 : Bus error on instruction\n");
- printf("10 : Bus error on data\n");
- printf("11 : SW-interrupt 0\n");
- printf("12 : SW-interrupt 1\n");
- printf("13 : Load error on instruction and Load error on data (BadVAddr = 0x40000003)\n");
- printf("14 : Load error on data and Load error on instruction (BadVAddr = 0x40000002)\n");
-
- scanf("%d", &sel);
- printf("Jetzt kommt die exception (%d)!\n", sel);
-
- switch(sel)
- {
- case 1:
- _exc_ri();
- break;
-
- case 2:
- _exc_kaddr_err();
- break;
-
- case 3:
- _exc_arith();
- break;
-
- case 4:
- _exc_syscall(4, (UINT32)((char*)"Hallo Syscall ("));
- _exc_syscall(1, 12345678);
- _exc_syscall(4, (UINT32)((char*)")\n"));
- break;
-
- case 5:
- _exc_break();
- break;
-
- case 6:
- _exc_iaddr_err();
- break;
-
- case 7:
- _exc_load_err();
- break;
-
- case 8:
- _exc_store_err();
- break;
-
- case 9:
- printf("IBE: Exception not implemented in current CPU!\nPush reset to restart!\n");
- _exc_ibe();
- break;
-
- case 10:
- printf("DBE: Exception not implemented in current CPU!\nPush reset to restart!\n");
- _exc_dbe();
- break;
-
- case 11:
- case 12:
- interrupt_set(sel-11);
- break;
-
- case 13:
- _exc_iaddr_daddr_err();
- break;
-
- case 14:
- _exc_daddr_iaddr_err();
- break;
-
- default:
- break;
- }
- sel = 0;
- }
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/test_flash.c b/lib/CPUs/MIPS/bsp/examples/test_flash.c
deleted file mode 100644
index 7d40961..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_flash.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/************************************************************************/
-/* */
-/* AMD CFI Enabled Flash Memory Drivers */
-/* File name: CFIDRIVE.C */
-/* Revision: 1.0 5/07/98 */
-/* */
-/* Copyright (c) 1998 ADVANCED MICRO DEVICES, INC. All Rights Reserved. */
-/* This software is unpublished and contains the trade secrets and */
-/* confidential proprietary information of AMD. Unless otherwise */
-/* provided in the Software Agreement associated herewith, it is */
-/* licensed in confidence "AS IS" and is not to be reproduced in whole */
-/* or part by any means except for backup. Use, duplication, or */
-/* disclosure by the Government is subject to the restrictions in */
-/* paragraph (b) (3) (B) of the Rights in Technical Data and Computer */
-/* Software clause in DFAR 52.227-7013 (a) (Oct 1988). */
-/* Software owned by */
-/* Advanced Micro Devices, Inc., */
-/* One AMD Place, */
-/* P.O. Box 3453 */
-/* Sunnyvale, CA 94088-3453. */
-/************************************************************************/
-/* This software constitutes a basic shell of source code for */
-/* programming all AMD Flash components. AMD */
-/* will not be responsible for misuse or illegal use of this */
-/* software for devices not supported herein. AMD is providing */
-/* this source code "AS IS" and will not be responsible for */
-/* issues arising from incorrect user implementation of the */
-/* source code herein. It is the user's responsibility to */
-/* properly design-in this source code. */
-/* */
-/************************************************************************/
-
-#include
-#include
-#include "cfiflash.h"
-#include "libsys.h"
-
-#define TEST_SIZE (1024*1024)
-#define FLASH_OFFSET 0x700000
-int main(void)
-{
- int i;
- flash_t flash;
- UINT8 *pFlash = (UINT8*)0xA4000000;
- UINT32 result;
- UINT8 *pBuf;
-
- setbuf(stdout, NULL);
- result = flash_find(&flash, 0xA4000000);
-
- if (result < 0)
- {
- printf("flash_find() error!\n");
- return 1;
- }
-
- printf("Found Flash at %8.8X\n", (UINT32)flash.pBase);
-
- pBuf = (UINT8*)malloc(TEST_SIZE);
-
- for (i=0; i < TEST_SIZE; i++)
- pBuf[i] = i;
-
- printf("Flash erase from %8.8X to %8.8X...", FLASH_OFFSET, FLASH_OFFSET+TEST_SIZE);
- result = flash_erase(&flash, FLASH_OFFSET, TEST_SIZE);
- if (result < 0)
- {
- printf("error!\n");
- return 1;
- }
- printf("OK\n");
-
- printf("Flash program from %8.8X to %8.8X...", FLASH_OFFSET, FLASH_OFFSET+TEST_SIZE);
- result = flash_program(&flash, FLASH_OFFSET, pBuf, TEST_SIZE);
- if (result < 0)
- {
- printf("error!\n");
- return 1;
- }
- printf("OK\n");
-
- printf("Flash verify from %8.8X to %8.8X...", FLASH_OFFSET, FLASH_OFFSET+TEST_SIZE);
- result = flash_verify(&flash, FLASH_OFFSET, pBuf, TEST_SIZE);
- if (result < 0)
- {
- printf("error!\n");
- return 1;
- }
- printf("OK\n");
-
-// PrintBuffer8((UINT8*)pFlash, 16, TEST_SIZE);
-
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/test_hpi.c b/lib/CPUs/MIPS/bsp/examples/test_hpi.c
deleted file mode 100644
index 407d070..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_hpi.c
+++ /dev/null
@@ -1,848 +0,0 @@
-#include
-#include
-#include
-#include
-#include "libsys.h"
-#include "cfiflash.h"
-#include "hpi.h"
-
-static volatile UINT32 _g_uart_msg;
-static volatile UINT32 _g_rst;
-static volatile UINT32 _g_sus;
-static volatile UINT32 _g_cfg;
-
-void uart_handler(void)
-{
- volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
- volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA;
-
- while((SYS_PS2_BIT_RX_AVAIL & *pUART_stat))
- {
- _g_uart_msg = *pUART_data;
- }
-
-}
-
-void PrintDevRegs(UINT devid)
-{
- int i;
- UINT32 reg_base1, reg_base2, reg_addr;
-
- if ((devid < 1) || (devid > 2))
- return;
-
- printf("********************************************************\n");
- printf("Device %d status\n", devid);
- printf("********************************************************\n");
- reg_base1 = 0x0200 + (devid-1)*0x80;
- reg_base2 = 0xC080 + (devid-1)*0x20;
- reg_addr = reg_base2 + 4;
- printf("Port select (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base2 + 10;
- printf("USB control (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base2 + 12;
- printf("Int. enable (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base2 + 14;
- printf("Address (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base2 + 16;
- printf("Status (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base2 + 18;
- printf("Frame # reg (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base2 + 20;
- printf("SOF/EOP cnt (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- for (i=0; i < 8; i++)
- {
- printf("EP# %d\n", i);
- reg_addr = reg_base1 + 16*i + 0;
- printf("Control (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base1 + 16*i + 2;
- printf("Address (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base1 + 16*i + 4;
- printf("Count (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base1 + 16*i + 6;
- printf("Status (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- reg_addr = reg_base1 + 16*i + 8;
- printf("Count result (%4.4X) : %4.4X\n", reg_addr, hpi_read_reg(reg_addr));
-
- }
-}
-
-typedef struct _sdev_descr_t
-{
- UINT8 size; // length
- UINT8 type; // desc type
- UINT16 usb_spec; // USB spec
- UINT8 devclass; // device class
- UINT8 subclass; // sub class
- UINT8 protocol; // protocol
- UINT8 max_packet_size; // max packet size for endpoint 0
- UINT16 vendor_id; // Vendor ID
- UINT16 product_id; // Product ID
- UINT16 device_id; // device release number
- UINT8 man_str_index; // index of manufacture string
- UINT8 prod_str_index; // index of product string
- UINT8 sn_str_index; // index of serial number string
- UINT8 nconfs; // number of configurations
-} __attribute__ ((__packed__)) dev_descr_t;
-
-typedef struct _sconf_descr_t
-{
- UINT8 size; // length of this config
- UINT8 type; // desc type
- UINT16 total_size; // Total configuration desc length including this config and following descriptions
- UINT8 nifaces; // Number of interface descriptions following this
- UINT8 conf_id; // config number
- UINT8 conf_str_index; // index of string describing config
- UINT8 attr; // attributes (e.g. bus powered)
- UINT8 current; // 2mA x (max. 250 => 500mA)
-} __attribute__ ((__packed__)) conf_descr_t;
-
-typedef struct _siface_descr_t
-{
- UINT8 size; // length of this config
- UINT8 type; // desc type
- UINT8 base; // base number
- UINT8 alt; // alt
- UINT8 neps; // number of endpoint description following this
- UINT8 iface_class; // interface class (vendor)
- UINT8 subclass; // subclass
- UINT8 iface_proto; // interface proto (vendor)
- UINT8 iface_str_index;
-} __attribute__ ((__packed__)) iface_descr_t;
-
-typedef struct _sep_descr_t
-{
- UINT8 size; // length of this config
- UINT8 type; // type (endpoint)
- UINT8 type_num; // type/number (Host use WriteFile)
- UINT8 bulk; // Bulk
- UINT16 pkt_size; // packet size
- UINT8 interval; // interval
-} __attribute__ ((__packed__)) ep_descr_t;
-
-typedef struct _sotg_descr_t
-{
- UINT8 size; // length of this config
- UINT8 type; // type (OTG)
- UINT8 hnp_srp; // HNP|SRP support
-} __attribute__ ((__packed__)) otg_descr_t;
-
-typedef struct _sstr_descr_hdr_t
-{
- UINT8 size; // length of this config
- UINT8 type; // type
-} __attribute__ ((__packed__)) str_descr_hdr_t;
-
-typedef struct _scfg_inst_t
-{
- usb_irp_t *pIRP_rx;
- usb_irp_t *pIRP_tx;
-} cfg_inst_t;
-
-UINT32 conf_write(UINT8 *pConfDescr, UINT32 neps, ep_descr_t *pEP)
-{
- UINT32 pos, size;
- conf_descr_t cfg;
- iface_descr_t iface;
- otg_descr_t otg_descr;
-
- // Fill config description
- cfg.size = sizeof(conf_descr_t);
- cfg.type = 2;
- cfg.total_size = sizeof(conf_descr_t) + sizeof(iface_descr_t) + neps*sizeof(ep_descr_t) + sizeof(otg_descr_t);
- cfg.nifaces = 1; // can handle only one interface per config
- cfg.conf_id = 1;
- cfg.conf_str_index = 0;
- cfg.attr = 0x80;
- cfg.current = 50;
-
- // Copy config description
- pos = 0;
- size = sizeof(conf_descr_t);
- memcpy(&pConfDescr[pos], &cfg, size);
-
- // Fill interface description
- iface.size = sizeof(iface_descr_t);
- iface.type = 4;
- iface.base = 0;
- iface.alt = 0;
- iface.neps = neps;
- iface.iface_class = 0;
- iface.subclass = 0;
- iface.iface_proto = 0;
- iface.iface_str_index = 0;
-
- // Copy interface description
- pos += size;
- size = sizeof(iface_descr_t);
- memcpy(&pConfDescr[pos], &iface, size);
-
- // Copy N end point descriptions
- pos += size;
- size = neps*sizeof(ep_descr_t);
- memcpy(&pConfDescr[pos], pEP, size);
-
- // Fill OTG description
- otg_descr.size = sizeof(otg_descr_t);
- otg_descr.type = 9; // OTG
- otg_descr.hnp_srp = 3; // HNP|SRP supported
-
- // Copy OTG description
- pos += size;
- size = sizeof(ep_descr_t);
- memcpy(&pConfDescr[pos], &otg_descr, size);
-
- pos += size;
-
- return pos;
-}
-
-UINT32 str_write(UINT8 *pStrDescr, UINT8 *pStr0, UINT8 *pStr1, UINT8 *pStr2)
-{
- int i;
- UINT32 pos, size, strsize;
- str_descr_hdr_t *pStrHdr;
- UINT16 *pStr;
-
- pos = 0;
- size = sizeof(str_descr_hdr_t);
- strsize = 2;
- pStrHdr = (str_descr_hdr_t*)&pStrDescr[pos];
- pStrHdr->size = size + strsize;
- pStrHdr->type = 3;
-
- pos += size;
- pStr = (UINT16*)&pStrDescr[pos];
-
- *pStr = 0x0409;
-
- // String 0
- pos += size;
- size = sizeof(str_descr_hdr_t);
- strsize = strlen(pStr0);
-
- pStrHdr = (str_descr_hdr_t*)&pStrDescr[pos];
- pStrHdr->size = sizeof(str_descr_hdr_t) + 2*strsize;
- pStrHdr->type = 3;
-
- pos += size;
- size = 2*strsize;
- pStr = (UINT16*)&pStrDescr[pos];
-
- for (i=0; i < strsize; i++)
- pStr[i] = (UINT16)pStr0[i];
-
- // String 1
- pos += size;
- size = sizeof(str_descr_hdr_t);
- strsize = strlen(pStr1);
-
- pStrHdr = (str_descr_hdr_t*)&pStrDescr[pos];
- pStrHdr->size = sizeof(str_descr_hdr_t) + 2*strsize;
- pStrHdr->type = 3;
-
- pos += size;
- size = 2*strsize;
- pStr = (UINT16*)&pStrDescr[pos];
-
- for (i=0; i < strsize; i++)
- pStr[i] = (UINT16)pStr1[i];
-
- // String 2
- pos += size;
- size = sizeof(str_descr_hdr_t);
- strsize = strlen(pStr2);
-
- pStrHdr = (str_descr_hdr_t*)&pStrDescr[pos];
- pStrHdr->size = sizeof(str_descr_hdr_t) + 2*strsize;
- pStrHdr->type = 3;
-
- pos += size;
- size = 2*strsize;
- pStr = (UINT16*)&pStrDescr[pos];
-
- for (i=0; i < strsize; i++)
- pStr[i] = (UINT16)pStr2[i];
-
- pos += size;
-
- return pos;
-}
-
-void ep0_func(void *pArg)
-{
- UINT32 result;
- UINT16 buf[USB_MAX_IMG_SIZE/2], ep_cntres, ep_status, ep_count, tsize;
- usb_irp_t *pIRP = (usb_irp_t*)pArg;
-
-// printf("Callback with pArg = %8.8X\n", (UINT32)pArg);
- ep_status = hpi_read_reg (SUSB2_REG_EP_STATUS0);
- ep_cntres = hpi_read_reg (SUSB2_REG_EP_CNTRES0);
- ep_count = hpi_read_reg (SUSB2_REG_EP_COUNT0);
-
- if (ep_status & 0x10)
- {
- printf("Setup-flag detected. Status = %4.4X\n", ep_status);
- }
-}
-
-void ep1_func(void *pArg)
-{
- UINT32 result;
- UINT16 buf[USB_MAX_IMG_SIZE/2], ep_cntres, ep_status, ep_count, tsize;
- usb_irp_t *pIRP = (usb_irp_t*)pArg;
-
-// printf("Callback with pArg = %8.8X\n", (UINT32)pArg);
- ep_status = hpi_read_reg (SUSB2_REG_EP_STATUS1);
- ep_cntres = hpi_read_reg (SUSB2_REG_EP_CNTRES1);
- ep_count = hpi_read_reg (SUSB2_REG_EP_COUNT1);
-
- tsize = pIRP->tsize;
- if (ep_status & 0x0020)
- {
- printf("Length exception result %4.4X with count = %d\n", ep_status, (INT16)ep_cntres);
- if (ep_status & 0x0400)
- tsize = (UINT16)((INT16)tsize - (INT16)ep_cntres);
- if (ep_status & 0x0800)
- tsize = (UINT16)((INT16)tsize - (INT16)ep_cntres);
-
- }
- result = hpi_read_ram(pIRP->cy_req.addr, buf, tsize);
- usb_irp_enqueue(pIRP);
- fifo_write(&pIRP->fifo, (UINT8*)buf, result, 0, FIFO_BLOCK);
-
-// printf("Read %d bytes\n", result);
-
-}
-
-void ep2_func(void *pArg)
-{
- UINT32 result;
- UINT16 buf[USB_MAX_IMG_SIZE/2], ep_cntres, ep_status, ep_count, tsize;
- usb_irp_t *pIRP = (usb_irp_t*)pArg;
-
-// printf("Callback with pArg = %8.8X\n", (UINT32)pArg);
- ep_status = hpi_read_reg (SUSB2_REG_EP_STATUS2);
- ep_cntres = hpi_read_reg (SUSB2_REG_EP_CNTRES2);
- ep_count = hpi_read_reg (SUSB2_REG_EP_COUNT2);
-
- tsize = pIRP->tsize;
- if (ep_status & 0x0020)
- {
- printf("Length exception result %4.4X with count = %d\n", ep_status, (INT16)ep_cntres);
- if (ep_status & 0x0400)
- tsize = (UINT16)((INT16)tsize - (INT16)ep_cntres);
- if (ep_status & 0x0800)
- tsize = (UINT16)((INT16)tsize - (INT16)ep_cntres);
- }
-
- pIRP->tx_in_progress = 0;
- result = fifo_read(&pIRP->fifo, (UINT8*)buf, pIRP->tsize, 0, FIFO_NONBLOCK);
- if (!result)
- return;
-
- pIRP->cy_req.size = result;
- hpi_write_ram(pIRP->cy_req.addr, (UINT16*)buf, result);
-
- usb_irp_enqueue(pIRP);
-
-// printf("Wrote %d bytes\n", result);
-
-}
-
-void rst_func(void *pArg)
-{
- volatile int *pLED = (int*)SYS_LED_PORT;
-
-// printf("Callback with pArg = %8.8X\n", (UINT32)pArg);
- sputs("SUSB_RST_MSG\n");
-/// hpi_comm_reset();
-
- _g_rst = 1;
-
- *pLED = 0x40000000 + 1;
-
-}
-
-void sof_func(void *pArg)
-{
- volatile int *pLED = (int*)SYS_LED_PORT;
-
-// printf("Callback with pArg = %8.8X\n", (UINT32)pArg);
- sputs("SUSB_SOF_MSG\n");
-
- *pLED = 0x40000000 + 2;
-
-}
-
-void cfg_func(void *pArg)
-{
- volatile int *pLED = (int*)SYS_LED_PORT;
- cfg_inst_t *pCFG = (cfg_inst_t*)pArg;
- usb_irp_t *pIRP_rx = (usb_irp_t*)pCFG->pIRP_rx;
- usb_irp_t *pIRP_tx = (usb_irp_t*)pCFG->pIRP_tx;
-
-// printf("Callback with pArg = %8.8X\n", (UINT32)pArg);
- sputs("SUSB_CFG_MSG\n");
- _g_cfg = 1;
- usb_irp_enqueue(pIRP_rx);
- fifo_flush(&pIRP_rx->fifo);
- fifo_flush(&pIRP_tx->fifo);
- pIRP_tx->tx_in_progress = 0;
- *pLED = 0;
-
-}
-
-void sus_func(void *pArg)
-{
- volatile int *pLED = (int*)SYS_LED_PORT;
-
-// printf("Callback with pArg = %8.8X\n", (UINT32)pArg);
- sputs("SUSB_SUS_MSG\n");
-
- *pLED = 0x40000000 + 3;
-
- _g_sus = 1;
-
-}
-
-void id_func(void *pArg)
-{
- volatile int *pLED = (int*)SYS_LED_PORT;
-
-// printf("Callback with pArg = %8.8X\n", (UINT32)pArg);
- sputs("SUSB_ID_MSG\n");
-
- *pLED = 0x40000000 + 4;
-
-}
-
-void vbus_func(void *pArg)
-{
- volatile int *pLED = (int*)SYS_LED_PORT;
-
-// printf("Callback with pArg = %8.8X\n", (UINT32)pArg);
- sputs("SUSB_VBUS_MSG\n");
-
- *pLED = 0x40000000 + 5;
-
-}
-
-UINT32 usb_init_descr(void)
-{
- UINT32 result;
-
- UINT16 buffer16[0x100];
- UINT16 addr;
- dev_descr_t dev_descr = {sizeof(dev_descr_t), 1, 0x0200, 0xFF, 0, 0, 8, 0x04B4, 0x7200, 0x0099, 1, 2, 3, 1};
- ep_descr_t ep_descr[2] = {{sizeof(ep_descr_t), 5, 1, 2, 64, 0}, {sizeof(ep_descr_t), 5, 0x82, 2, 64, 0}};
-
- // Set device descriptor
- addr = 0xf516; // default
- addr = 0xA00;
- hpi_write_ram(addr, (UINT16*)&dev_descr, sizeof(dev_descr_t));
- hpi_write_reg(2*SUSB2_DEVICE_DESCRIPTOR_VEC, addr);
-
- // Set new configuration descriptor
-
- // Write config and interface descriptor
- result = conf_write((UINT8*)buffer16, sizeof(ep_descr)/sizeof(ep_descr_t), ep_descr);
-
- addr = 0xf528; // default
- addr = 0xB00;
- hpi_write_ram(addr, (UINT16*)buffer16, result);
- hpi_write_reg(2*SUSB2_CONFIGURATION_DESCRIPTOR_VEC, addr);
-
- // Set string description
- result = str_write((UINT8*)buffer16, "JDI Inc.", "JDI-USB (MIPS)", "311070");
- addr = 0xf528; // default
- addr = 0xC00;
- hpi_write_ram(addr, (UINT16*)buffer16, result);
- hpi_write_reg(2*SUSB2_STRING_DESCRIPTOR_VEC, addr);
-
- return 0;
-}
-
-UINT32 usb_force_reconnect(UINT32 port)
-{
- UINT32 result;
- UINT16 addr;
-
- if (port >= USB_MAX_NUM_PORTS)
- return -1;
-
- if (port == 0)
- {
- // R1 = 0 : Full speed
- // R2 = 1 : SIE1
- addr = hpi_read_reg(SUSB1_REG_USBCTRL);
- hpi_write_reg(SUSB1_REG_USBCTRL, addr | 0x0010);
- result = hpi_comm_exec_int(SUSB_INIT_INT, 2, R1, 0, R2, 1);
- hpi_write_reg(SUSB1_REG_USBCTRL, addr);
- }
- else
- {
- // R1 = 0 : Full speed
- // R2 = 2 : SIE2
- addr = hpi_read_reg(SUSB2_REG_USBCTRL);
- hpi_write_reg(SUSB2_REG_USBCTRL, addr | 0x0010);
- result = hpi_comm_exec_int(SUSB_INIT_INT, 2, R1, 0, R2, 2);
- hpi_write_reg(SUSB2_REG_USBCTRL, addr);
- }
- return result;
-}
-
-UINT32 usb_recv(usb_irp_t *pObj, UINT8 *pData, UINT32 len, UINT32 timeout)
-{
- UINT32 result;
-
- result = fifo_read(&pObj->fifo, pData, len, timeout, FIFO_BLOCK);
-
- return result;
-}
-
-UINT32 usb_send(usb_irp_t *pObj, UINT8 *pData, UINT32 len, UINT32 timeout)
-{
- UINT32 result;
- UINT8 buf[USB_MAX_IMG_SIZE];
-
- // Fill-up FIFO
- result = fifo_write(&pObj->fifo, pData, len, 0, FIFO_NONBLOCK);
- if (!result)
- return 0;
-
- // Trigger TX
- if (!pObj->tx_in_progress)
- {
- pObj->cy_req.size = fifo_read(&pObj->fifo, (UINT8*)buf, pObj->tsize, 0, FIFO_NONBLOCK);
- hpi_write_ram(pObj->cy_req.addr, (UINT16*)buf, pObj->cy_req.size);
- usb_irp_enqueue(pObj);
- }
-
- // If necessary, write rest to FIFO
- result += fifo_write(&pObj->fifo, &pData[result], len - result, timeout, FIFO_BLOCK);
-
- return result;
-
-}
-
-#define TEST_SIZE (2*1024*1024)
-#define TRANSFER_SIZE 64
-#define FLASH_IMAGE_SIZE (2*1024*1024)
-
-int main(void)
-{
- int i;
- UINT32 result, sync, cmd, len, buf_count, led_count, remain, tx_cnt, flash_offset;
- UINT8 buffer8[2048];
- UINT16 buffer16[0x2000];
- UINT16 addr;
- volatile UINT32 *pLED = (UINT32*)SYS_LED_PORT;
- volatile UINT32 *pUART0_stat = (UINT32*)SYS_UART0_STAT;
- UINT32 start, end;
- UINT32 *pFlash32;
- UINT8 *pFlash8;
- UINT32 buffer32[16], *pBuf;
- UINT64 *pBuf64;
- usb_irp_t irp_rx, irp_tx;
- fifo_t fifo_rx, fifo_tx;
- cfg_inst_t cfg_inst;
- flash_t flash;
- volatile UINT32 *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
- volatile UINT32 *pVGA_front = (UINT32*)SYS_VGA_FB_FRONT;
- volatile UINT32 *pVGA_back = (UINT32*)SYS_VGA_FB_BACK;
-
- _g_rst = 0;
- _g_sus = 0;
- _g_cfg = 0;
-
- usb_init();
-
- // enable EP#0 callback
- usb_callback_register(1, SUSB_EP0_MSG, ep0_func, NULL);
-
- // enable EP#1 callback
- usb_irp_register(&irp_rx, 1, 1, TRANSFER_SIZE, 1);
- usb_callback_register(1, SUSB_EP1_MSG, ep1_func, &irp_rx);
-
- // enable EP#2 callback
- usb_irp_register(&irp_tx, 1, 2, TRANSFER_SIZE, 0);
- usb_callback_register(1, SUSB_EP2_MSG, ep2_func, &irp_tx);
-
- usb_callback_register(1, SUSB_RST_MSG, rst_func, NULL);
- usb_callback_register(1, SUSB_SOF_MSG, sof_func, NULL);
- cfg_inst.pIRP_rx = &irp_rx;
- cfg_inst.pIRP_tx = &irp_tx;
- usb_callback_register(1, SUSB_CFG_MSG, cfg_func, &cfg_inst);
- usb_callback_register(1, SUSB_SUS_MSG, sus_func, NULL);
- usb_callback_register(1, SUSB_ID_MSG, id_func, NULL);
- usb_callback_register(1, SUSB_VBUS_MSG, vbus_func, NULL);
-
- printf("HPI-Test\n\n");
-
- if (IS_ERROR(hpi_init()))
- {
- sputs("hpi_init(): error\n");
- return 1;
- }
-
- printf("cy67k3_reset\n");
- cy67k3_reset();
-
- while(!_g_rst);
-
- printf("hpi_comm_reset\n");
- hpi_comm_reset();
-
- while(!_g_sus);
-
- printf("usb_init_descr\n");
- usb_init_descr();
- printf("hpi_comm_exec_int\n");
- hpi_comm_exec_int(SUSB_INIT_INT, 2, R1, 0, R2, 2);
- printf("usb_force_reconnect\n");
- usb_force_reconnect(1);
-
- while(!_g_cfg);
-
- printf("USB-Ready\n");
-
- printf("CY-Read..");
- start = clock();
- for (i=0; i < TEST_SIZE; i+=0x2000)
- hpi_read_ram(0x2000, buffer16, 0x2000);
-
- end = clock();
- printf("done (%.2f Mbyte/s)\n", (double)TEST_SIZE/(1000*(end-start)));
-
- printf("CY-Write..");
- start = clock();
- for (i=0; i < TEST_SIZE; i+=0x2000)
- hpi_write_ram(0x2000, buffer16, 0x2000);
-
- end = clock();
- printf("done (%.2f Mbyte/s)\n", (double)TEST_SIZE/(1000*(end-start)));
-
- sputs("HPI-Status : ");
- print_word(cy67k3_read_HPI_STATUS());
- sputs("\n");
-
- sputs("HPI BP : ");
- print_word(hpi_read_reg(HPI_REG_BP));
- sputs("\n");
-
- sputs("HPI IRR : ");
- print_word(hpi_read_reg(HPI_REG_INTROUTE));
- sputs("\n");
-
- sputs("CPU Revision : ");
- print_word(hpi_comm_read_ctrl_reg(USB_REG_REVISON));
- sputs("\n");
-
- hpi_comm_write_ctrl_reg(USB_REG_SPEED, 0x0000, LOGIC_DIRECT);
- sputs("CPU Speed : ");
- print_word(hpi_comm_read_ctrl_reg(USB_REG_SPEED));
- sputs("\n");
-
-// usb_init_descr();
-// usb_force_reconnect(1);
-
- // enable RX interrupt
- *pUART0_stat |= (1 << 6);
- interrupt_register(3, uart_handler);
- interrupt_enable(3);
-
- // Enable EP#1
- hpi_write_reg(SUSB2_REG_EP_COUNT1, TRANSFER_SIZE);
- hpi_write_reg(SUSB2_REG_EP_CTRL1, 2);
- hpi_write_reg(SUSB2_REG_EP_CNTRES1, 0);
- hpi_write_reg(SUSB2_REG_EP_STATUS1, 0);
-
- // Enable EP#2
- hpi_write_reg(SUSB2_REG_EP_COUNT2, TRANSFER_SIZE);
- hpi_write_reg(SUSB2_REG_EP_CTRL2, 2);
- hpi_write_reg(SUSB2_REG_EP_CNTRES2, 0);
- hpi_write_reg(SUSB2_REG_EP_STATUS2, 0);
-
- led_count = 0;
- buf_count = 0;
-
- pBuf64 = (UINT64*)malloc(FLASH_IMAGE_SIZE);
- pBuf = (UINT32*)pBuf64;
-
- *pVGA_front = (UINT32)pBuf64;
- *pVGA_back = (UINT32)pBuf64;
- *pVGA_ctrl |= SYS_VGA_BIT_MSTEN;
-
- if (IS_ERROR(flash_find(&flash, SYS_FLASH_IO)))
- {
- printf("Cannot find flash device. Exit now!\n");
- return 1;
- }
-
- // Get flash offset by value of DIP-switch
- flash_offset = flash_get_offset_by_blocknum(&flash, flash.info.nblocks-FLASH_IMAGE_SIZE/flash.info.blocksize);
- printf("flash_offset: %08X\n", flash_offset);
- pFlash32 = (UINT32*)(SYS_FLASH_IO + flash_offset);
- pFlash8 = (UINT8*)pFlash32;
-
- while(1)
- {
- switch (_g_uart_msg)
- {
- case '1':
- _g_uart_msg = 0;
- PrintDevRegs(1);
- printf("\nSIEmsg1: %4.4X\n", hpi_read_reg(HPI_REG_SIE1MSG));
- break;
-
- case '2':
- _g_uart_msg = 0;
- PrintDevRegs(2);
- printf("\nSIEmsg2: %4.4X\n", hpi_read_reg(HPI_REG_SIE2MSG));
- break;
-
- default:
- break;
- }
- result = usb_recv(&irp_rx, (UINT8*)&sync, 4, 100);
- if (!result)
- continue;
-
- *pLED = led_count++;
-
- if (sync == 0xC24755AA)
- {
- printf("Sync found\n");
- result = usb_recv(&irp_rx, (UINT8*)&cmd, 4, 1000);
- if (!result)
- continue;
-
- result = usb_recv(&irp_rx, (UINT8*)&len, 4, 1000);
- if (!result)
- continue;
-
- printf("Command %d with len %d found\n",cmd, len);
- switch(cmd)
- {
- case 0x00000001:
- result = usb_recv(&irp_rx, NULL, len, 1000);
- if (result)
- {
- printf("Read %d bytes\n", result);
- }
- break;
-
- case 0x00000002:
- remain = len;
- tx_cnt = 0;
- while(remain)
- {
- len = sizeof(buffer8);
- if (remain < len)
- len = remain;
-
- for (i=0; i < len; i++)
- buffer8[i] = buf_count+i;
-
- result = usb_send(&irp_tx, buffer8, len, 1000);
- if (!result)
- break;
- tx_cnt += result;
- remain -= result;
- buf_count++;
- }
- printf("Wrote %d bytes\n", tx_cnt);
- break;
-
- case 0x00000003:
- remain = len;
- tx_cnt = 0;
- while(remain)
- {
- len = 256;
- if (remain < len)
- len = remain;
-
- result = usb_send(&irp_tx, (UINT8*)&pFlash8[tx_cnt], len, 1000);
- if (!result)
- break;
- tx_cnt += result;
- remain -= result;
- buf_count++;
- }
- printf("Wrote %d bytes\n", tx_cnt);
- break;
-
- case 0x00000004:
- *pVGA_ctrl &= ~SYS_VGA_BIT_MSTEN;
- result = usb_recv(&irp_rx, (UINT8*)pBuf, len, 1000);
- if (result)
- {
- printf("Read %d bytes\n", result);
- }
-
- len = result;
- if (len > FLASH_IMAGE_SIZE)
- {
- printf("Cannot write flash: image to large!\n");
- break;
- }
-
- printf("Flash erase...");
- result = flash_erase(&flash, flash_offset, len);
- if (IS_ERROR(result))
- {
- printf("failed (%08X)\n", result);
- break;
- }
- printf("done\n");
-
- printf("Flash write...");
- result = flash_program(&flash, flash_offset, (UINT8*)pBuf, len);
- if (IS_ERROR(result))
- {
- printf("failed (%08X)\n", result);
- break;
- }
- printf("done\n");
-
- printf("Flash verify...");
- result = flash_verify(&flash, flash_offset, (UINT8*)pBuf, len);
- if (IS_ERROR(result))
- {
- printf("failed (%08X)\n", result);
- break;
- }
- printf("passed\n");
- *pVGA_ctrl |= SYS_VGA_BIT_MSTEN;
- break;
-
- case 0x000000FF:
- usb_force_reconnect(1);
- break;
-
- default:
- break;
- }
- }
- }
-
- return 0;
-}
-
-// pMem = (UINT8*)0x40000000;
-// result = fifo_write(&fifo_tx, pMem, 640, 0, FIFO_NONBLOCK);
-// pMem += result;
-// usb_irp_enqueue(&irp_tx);
diff --git a/lib/CPUs/MIPS/bsp/examples/test_irq.c b/lib/CPUs/MIPS/bsp/examples/test_irq.c
deleted file mode 100644
index b1a9213..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_irq.c
+++ /dev/null
@@ -1,335 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define CPU_FREQ_HZ 100000000
-#include "libsys.h"
-#include "irq.h"
-#include "mips_gfx.h"
-#include "mips_ps2.h"
-
-char buffer[16384];
-char * volatile pPtr_r;
-char * volatile pPtr_w;
-static volatile INT32 mouse_x;
-static volatile INT32 mouse_y;
-static box_t box;
-static gfx_t gfx;
-static volatile int _g_posx, _g_posy;
-static volatile g_btn_l, g_btn_r;
-static volatile UINT32 g_color;
-
-// -------------------------------------------------------------
-void handler0(void)
-{
- printf("Interrupt 0\n");
- interrupt_clr(0);
-}
-
-void handler1(void)
-{
- printf("Interrupt 1\n");
- interrupt_clr(1);
-}
-
-void handler2(void)
-{
- printf("Interrupt 2\n");
-}
-
-void handler3(void)
-{
- volatile UINT32 *pUART0_stat = (UINT32*)SYS_UART0_STAT;
- volatile UINT32 *pUART0_data = (UINT32*)SYS_UART0_DATA;
- volatile UINT32 *pUART1_stat = (UINT32*)SYS_UART1_STAT;
- volatile UINT32 *pUART1_data = (UINT32*)SYS_UART1_DATA;
-
- while(0x200 & *pUART0_stat)
- {
-// sputs("w: "); print_word((int)pPtr_w); sputs("\n");
- if (pPtr_w == &buffer[16383])
- pPtr_w = buffer;
- *(pPtr_w++) = *pUART0_data;
- }
-
- while(0x200 & *pUART1_stat)
- {
-// sputs("w: "); print_word((int)pPtr_w); sputs("\n");
- if (pPtr_w == &buffer[16383])
- pPtr_w = buffer;
- *(pPtr_w++) = *pUART1_data;
- }
-
-}
-
-void handler4(void)
-{
- printf("Interrupt 4\n");
-}
-
-void handler5(void)
-{
- UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
-
- // Ack
- *pVGA_ctrl |= SYS_VGA_BIT_BUFCHG_FLAG;
-
-}
-
-void handler6(void)
-{
- int p, i;
- ps2_if_t *pIF;
- UINT8 mouse_rsp[3];
- UINT32 timeout_count, key;
-
- INT32 dx, dy;
-
- for (p=0; p < PS2_get_num_if(); p++)
- {
- pIF = PS2_get_if(p);
- if (SYS_PS2_BIT_RX_ERR_FLAG & *pIF->pCTRL)
- fprintf(stderr, "PS2[%d]: Status = 0x%08X\n", p, *pIF->pCTRL);
-
- if (pIF->type == ps2_type_keyb)
- {
- while(SYS_PS2_BIT_RX_IRQ & *pIF->pCTRL)
- {
- key = *pIF->pDATA;
- printf("Keyboard scan code = 0x%02X\n", key);
- }
- }
- if (pIF->type == ps2_type_mouse)
- {
- if(!(SYS_PS2_BIT_RX_IRQ & *pIF->pCTRL))
- continue;
-
- for (i=0; i < 3; i++)
- {
- timeout_count = 100;
- while(!(SYS_PS2_BIT_RX_IRQ & *pIF->pCTRL))
- {
- timeout_count--;
- if (!timeout_count)
- {
- break;
- }
- sleep(1);
- }
- if (!timeout_count)
- {
- break;
- }
- mouse_rsp[i] = (UINT8)*pIF->pDATA;
- }
- if (!timeout_count)
- {
- continue;
- }
- dx = mouse_rsp[1];
- if (mouse_rsp[0] & 0x10)
- dx |= 0xFFFFFF00;
- dy = mouse_rsp[2];
- if (mouse_rsp[0] & 0x20)
- dy |= 0xFFFFFF00;
-
-// printf("dx = %5d, dy = %5d\n", dx, dy);
-
- mouse_x += dx;
- mouse_y -= dy;
- g_btn_l = 0;
- if (mouse_rsp[0] & 0x01)
- g_btn_l = 1;
-
- if (mouse_rsp[0] & 0x02)
- {
- if (g_btn_r == 0)
- {
- g_color = (UINT32)rand();
- }
- g_btn_r = 1;
- }
- else
- g_btn_r = 0;
-
-
- if (mouse_x < 0)
- mouse_x = 0;
- if (mouse_y < 0)
- mouse_y = 0;
- if (mouse_x > (gfx.w-1))
- mouse_x = gfx.w-1;
- if (mouse_y >= (gfx.h-1))
- mouse_y = gfx.h-1;
-
-// Screen_csr_set_x(mouse_x);
-// Screen_csr_set_y(mouse_y);
-
-// printf("x = %5d, y = %5d\n", mouse_x, mouse_y);
-
- }
- }
-}
-
-void handler7(void)
-{
- printf("Interrupt 7\n");
-}
-
-int main(void)
-{
-
- int i;
- volatile UINT32 *pUART0_stat = (UINT32*)SYS_UART0_STAT;
- volatile UINT32 *pUART1_stat = (UINT32*)SYS_UART1_STAT;
- volatile UINT32 *pUART0_baud = (UINT32*)SYS_UART0_BAUD;
- volatile UINT32 *pUART1_baud = (UINT32*)SYS_UART1_BAUD;
- UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
- UINT32 volatile *pVGA_moffs_0 = (UINT32*)SYS_VGA_FB_FRONT;
- UINT32 volatile *pVGA_moffs_1 = (UINT32*)SYS_VGA_FB_BACK;
- UINT32 volatile *pVGA_cgcol = (UINT32*)SYS_VGA_CGCOL;
- UINT32 volatile *pFlashPicture = (UINT32*)(SYS_FLASH_MEM + 0x00600000);
- UINT32 framecount;
- UINT32 start, end;
- char string[65];
-
- interrupt_register(0, (void*)handler0);
- interrupt_register(1, (void*)handler1);
-// interrupt_register(2, (void*)handler2);
- interrupt_register(3, (void*)handler3);
-// interrupt_register(4, (void*)handler4);
-// interrupt_register(5, (void*)handler5);
- interrupt_register(6, (void*)handler6);
- interrupt_register(7, (void*)handler7);
-
- srand(clock());
- UART1_setbaud(460800);
- printf("Hello\n");
- memset(buffer, 0, sizeof(buffer));
-
- *pVGA_cgcol = 0x00FFFFFF;
- _g_posx = _g_posy = 0;
- g_color = 0xFFFFFFFF;
- GFX_init(&gfx);
-
- GFX_set_background(&gfx, pFlashPicture, 800, 600, 1, 1);
- box_create(&box, 256, 256);
- GFX_box_draw(&gfx, &box, _g_posx, _g_posy, g_color);
- GFX_show(&gfx);
- printf("VGA status = %08X\n", *pVGA_ctrl);
-
- pPtr_r = buffer;
- pPtr_w = buffer;
-
- printf("UART0 Status = 0x%8.8X\n", *pUART0_stat);
- printf("UART0 Baud = 0x%8.8X\n", *pUART0_baud);
- printf("UART1 Status = 0x%8.8X\n", *pUART1_stat);
- printf("UART1 Baud = 0x%8.8X\n", *pUART1_baud);
-
- // UART: enable RX interrupt
- *pUART0_stat |= (1 << 6);
- *pUART1_stat |= (1 << 6);
- printf("UART0 Status = 0x%8.8X\n", *pUART0_stat);
- printf("UART1 Status = 0x%8.8X\n", *pUART1_stat);
-
- PS2_init(0);
- PS2_init(1);
-
- sputs("r: "); print_word((int)pPtr_r); sputs("\n");
- sputs("w: "); print_word((int)pPtr_w); sputs("\n");
-
- // Print Status register
- sputs("Status : ");
- print_word(CP0_SR_read());
- sputs("\n");
- sputs("\n");
-
- interrupt_disable(6);
- printf("Bitte gebe ein: ");
- scanf("%s", string);
- printf("Du schriebst: %s\n", string);
-
- // Flush buffer
- PS2_flush(0);
- PS2_flush(1);
-
- printf("Start:\n");
-
- interrupt_enable(0);
- interrupt_enable(1);
-// interrupt_enable(2);
- interrupt_enable(3);
-// interrupt_enable(4);
-// interrupt_enable(5);
- interrupt_enable(6);
- interrupt_enable(7);
-
- interrupt_set(0);
- interrupt_set(1);
- interrupt_set(2);
- interrupt_set(3);
- interrupt_set(4);
- interrupt_set(5);
- interrupt_set(6);
- interrupt_set(7);
-
-// while(1)
-// {
-// printf("PS2-Status : 0x%08X\n", *(ps2_if[0].pCTRL));
-// printf("PS2-Data : 0x%08X\n", *(ps2_if[0].pDATA));
-// sleep(1000);
-// }
-
- interrupt_enable(6);
- framecount = Screen_get_fps();
- start = clock();
-
- while(1)
- {
- if (!framecount)
- {
- end = clock();
- framecount = Screen_get_fps();
- printf("%f FPS\n", (float)framecount/((float)(end-start)/CLOCKS_PER_SEC));
- start = clock();
- }
-
- GFX_frame(&gfx, GFX_FRAME_SYNC);
- framecount--;
-
- while ((_g_posx != (UINT32)mouse_x) || (_g_posy != (UINT32)mouse_y) || g_btn_r || g_btn_l)
- {
-
- GFX_restore(&gfx, &box, _g_posx, _g_posy);
-
- _g_posx = (UINT32)mouse_x;
- _g_posy = (UINT32)mouse_y;
-
- if (g_btn_l && !g_btn_r)
- {
- GFX_box_draw_bg(&gfx, &box, _g_posx, _g_posy, g_color);
- }
-
- if (g_btn_l && g_btn_r)
- {
- GFX_set_background(&gfx, pFlashPicture, 800, 600, 1, 1);
- }
-
- GFX_box_draw(&gfx, &box, _g_posx, _g_posy, g_color);
- break;
- }
- GFX_show(&gfx);
-
- if(pPtr_w != pPtr_r)
- {
-// sputs("r: "); print_word((int)pPtr_r); sputs("\n");
- if (pPtr_r == &buffer[16383])
- pPtr_r = buffer;
- writechar(0, *(pPtr_r++));
- }
- }
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/test_mipsdis.c b/lib/CPUs/MIPS/bsp/examples/test_mipsdis.c
deleted file mode 100644
index eb3a61b..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_mipsdis.c
+++ /dev/null
@@ -1,651 +0,0 @@
-/* +----------------------------------------------------------------+ */
-/* | Copyright (c) 1994 Stanford University. | */
-/* | All Rights Reserved. | */
-/* | | */
-/* | This software is distributed with *ABSOLUTELY NO SUPPORT* | */
-/* | and *NO WARRANTY*. Use or reproduction of this code for | */
-/* | commerical gains is strictly prohibited. Otherwise, you | */
-/* | are given permission to use or modify this code as long | */
-/* | as you do not remove this notice. | */
-/* +----------------------------------------------------------------+ */
-/* --------------------------------------------------- */
-/* | Copyright (c) 1986 MIPS Computer Systems, Inc. | */
-/* | All Rights Reserved. | */
-/* --------------------------------------------------- */
-
-/*
- * Copyright 1985 by MIPS Computer Systems, Inc.
- */
-
-/* TORCH disassembler */
-/* derived from MIPS instruction dissassembler by PGL October 91 */
-
-#include
-#include
-#include "mipsdis.h"
-
-#define false 0
-#define true 1
-typedef int boolean;
-char *strcat();
-
-#define ZERO 0
-
-#define COMPILER_NAMES tdis_reg_names[0]
-#define HARDWARE_NAMES tdis_reg_names[1]
-#define ASSEMBLER_NAMES tdis_reg_names[2]
-#define DIS_REG_NAMES(x) tdis_reg_names[x]
-
-union extension_byte {
- unsigned char byte;
- struct { /* extension byte bits in little-endian order */
-#if (defined __MIPSEB || defined _MIPSEB || defined MIPSEB)
- unsigned reserved:1;
- unsigned dyn_nop:1;
- unsigned rs_boost:2;
- unsigned rt_boost:2;
- unsigned rd_boost:2;
-#elif (defined __MIPSEL || defined _MIPSEL || defined MIPSEL)
- unsigned rd_boost:2;
- unsigned rt_boost:2;
- unsigned rs_boost:2;
- unsigned dyn_nop:1;
- unsigned reserved:1;
-#endif /*MIPSEB*/
- } e;
-};
-
-#define blez_op_T blez_op
-#define blez_op_N (blez_op | 0x10)
-#define bgtz_op_T bgtz_op
-#define bgtz_op_N (bgtz_op | 0x10)
-#define beq_op_T beq_op
-#define beq_op_N (beq_op | 0x10)
-#define bne_op_T bne_op
-#define bne_op_N (bne_op | 0x10)
-#define bc_op_T bc_op
-#define bc_op_N (bc_op | 0x02)
-
-static char *op_name[64] = {
-/* 0 */ "special", "regimm","j", "jal", "beq", "bne", "blez", "bgtz",
-/* 8 */ "addi", "addiu","slti", "sltiu","andi", "ori", "xori", "lui",
-/*16 */ "cop0", "cop1", "cop2", "cop3", "beql","bnel","blezl","bgtzl",
-/*24 */ "op60", "op64", "op68", "op6c", "op70", "op74", "op78", "op7c",
-/*32 */ "lb", "lh", "lwl", "lw", "lbu", "lhu", "lwr", "ld",
-/*40 */ "sb", "sh", "swl", "sw", "opb0", "opb4", "swr", "sd",
-/*48 */ "lwc0", "lwc1", "lwc2", "lwc3", "ldc0", "ldc1", "ldc2", "ldc3",
-/*56 */ "swc0", "swc1", "swc2", "swc3", "sdc0", "sdc1", "sdc2", "sdc3"
-};
-
-static char *spec_name[64] = {
-/* 0*/ "sll", "spec01","srl", "sra", "sllv", "spec05","srlv","srav",
-/* 8*/ "jr", "jalr", "spec12","spec13","syscall","break","vcall","spec17",
-/*16*/ "mfhi", "mthi", "mflo", "mtlo", "spec24","spec25","spec26","spec27",
-/*24*/ "mult", "multu","div", "divu", "spec34","spec35","spec36","spec37",
-/*32*/ "add", "addu", "sub", "subu", "and", "or", "xor", "nor",
-/*40*/ "spec50","spec51","slt","sltu", "spec54","spec55","spec56","spec57",
-/*48*/ "spec60","spec61","spec62","spec63","spec64","spec65","spec66","spec67",
-/*56*/ "spec70","spec71","spec72","spec73","spec74","spec75","spec76","spec77"
-};
-
-static char *bcond_name[32] = {
- "bltz",
- "bgez",
- "bltzl",
- "bgezl",
- "bcond04",
- "bcond05",
- "bcond06",
- "bcond07",
- "tgei",
- "tgeiu",
- "tlti",
- "tltiu",
- "teqi",
- "bcond0d",
- "tnei",
- "bcond0f",
- "bltzal",
- "bgezal",
- "bltzall",
- "bgezall",
- "bcond14",
- "bcond15",
- "bcond16",
- "bcond17",
- "bcond18",
- "bcond19",
- "bcond1a",
- "bcond1b",
- "bcond1c",
- "bcond1d",
- "bcond1e",
- "bcond1f"
-};
-
-static char *cop1_name[64] = {
-/* 0 */ "add", "sub", "mul", "div", "sqrt", "abs", "mov", "neg",
-/* 8 */ "fop08","fop09","fop0a","fop0b","fop0c","fop0d","fop0e","fop0f",
-/*16 */ "fop10","fop11","fop12","fop13","fop14","fop15","fop16","fop17",
-/*24 */ "fop18","fop19","fop1a","fop1b","fop1c","fop1d","fop1e","fop1f",
-/*32 */ "cvt.s","cvt.d","cvt.e","fop23","cvt.w","fop25","fop26","fop27",
-/*40 */ "fop28","fop29","fop2a","fop2b","fop2c","fop2d","fop2e","fop2f",
-/*48 */ "c.f", "c.un","c.eq","c.ueq","c.olt","c.ult","c.ole","c.ule",
-/*56 */ "c.sf","c.ngle","c.seq","c.ngl","c.lt","c.nge","c.le","c.ngt"
-};
-
-static char *fmt_name[16] = {
- "s", "d", "e", "q",
- "w", "fmt5", "fmt6", "fmt7",
- "fmt8", "fmt9", "fmta", "fmtb",
- "fmtc", "fmtd", "fmte", "fmtf"
-};
-
-/* public */
-/* Three sets of commonly used register names */
-const char *tdis_reg_names[3][64] = {
- { /* compiler names */
- "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
- "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
- "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
- "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra",
- "zero.B","at.B","v0.B", "v1.B", "a0.B", "a1.B", "a2.B", "a3.B",
- "t0.B", "t1.B", "t2.B", "t3.B", "t4.B", "t5.B", "t6.B", "t7.B",
- "s0.B", "s1.B", "s2.B", "s3.B", "s4.B", "s5.B", "s6.B", "s7.B",
- "t8.B", "t9.B", "k0.B", "k1.B", "gp.B", "sp.B", "s8.B", "ra.B"
- },
- { /* hardware names */
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
- "r24", "r25", "r26", "r27", "gp", "sp", "r30", "r31",
- "r0.B", "r1.B", "r2.B", "r3.B", "r4.B", "r5.B", "r6.B", "r7.B",
- "r8.B", "r9.B", "r10.B","r11.B","r12.B","r13.B","r14.B","r15.B",
- "r16.B","r17.B","r18.B","r19.B","r20.B","r21.B","r22.B","r23.B",
- "r24.B","r25.B","r26.B","r27.B","gp.B", "sp.B", "r30.B","r31.B"
- },
- { /* assembler names */
- "$0", "$at", "$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", "$gp", "$sp", "$30", "$31",
- "$0.B", "$at.B","$2.B", "$3.B", "$4.B", "$5.B", "$6.B", "$7.B",
- "$8.B", "$9.B", "$10.B","$11.B","$12.B","$13.B","$14.B","$15.B",
- "$16.B","$17.B","$18.B","$19.B","$20.B","$21.B","$22.B","$23.B",
- "$24.B","$25.B","$26.B","$27.B","$gp.B","$sp.B","$30.B","$31.B"
- }
-};
-
-static char *c0_opname[64] = {
- "c0op0","tlbr","tlbwi","c0op3","c0op4","c0op5","tlbwr","c0op7",
- "tlbp","c0op9","c0op10","c0op11","c0op12","c0op13","c0op14","c0op15",
- "rfe","c0op17","c0op18","c0op19","c0op20","c0op21","c0op22","c0op23",
- "c0op24","c0op25","c0op26","c0op27","c0op28","c0op29","c0op30","c0op31",
- "c0op32","c0op33","c0op34","c0op35","c0op36","c0op37","c0op38","c0op39",
- "c0op40","c0op41","c0op42","c0op43","c0op44","c0op45","c0op46","c0op47",
- "c0op48","c0op49","c0op50","c0op51","c0op52","c0op53","c0op54","c0op55",
- "c0op56","c0op57","c0op58","c0op59","c0op60","c0op61","c0op62","c0op63"
-};
-
-static char *c0_reg[32] = {
- "index","random","tlblo","c0r3","context","c0r5","c0r6","c0r7",
- "badvaddr","c0r9","tlbhi","epcn","sr", "cause","epc", "c0r15",
- "c0r16","c0r17","c0r18","c0r19","c0r20","c0r21","c0r22","c0r23",
- "c0r24","c0r25","c0r26","c0r27","c0r28","c0r29","c0r30","c0r31"
-};
-
-/* Remember the options set by dis_init */
-#define ADDR_DEFAULT 0
-//#define ADDR_DEFAULT "%#010x:\t"
-//#define VALUE_DEFAULT "%#010x\t"
-#define VALUE_DEFAULT 0
-#define NAME_DEFAULT COMPILER_NAMES
-static struct {
- char *addr_format;
- char *value_format;
- const char **reg_names;
- int print_jal_targets;
-} save = {
- ADDR_DEFAULT,
- VALUE_DEFAULT,
- NAME_DEFAULT,
- true
-};
-
-/* Update regmask to reflect the use of this general-purpose (not fp)
- register, and return its name */
-static const char *
-register_name(ireg, boosted, regmask)
-unsigned ireg, *regmask;
-int boosted;
-{
- if (!boosted)
- *regmask |= (1 << ireg);
- return save.reg_names[boosted ? ireg + 32 : ireg];
-}
-
-/* public -- see dissassembler.h */
-int
-tdisasm(buffer, address, iword, ext, regmask, symbol_value, ls_register)
-char *buffer;
-unsigned char ext; /* extension byte */
-unsigned address, iword, *regmask, *symbol_value, *ls_register;
-{
- int return_value = 0;
- char *bufptr = buffer;
- boolean do_b_displacement = false;
- boolean do_loadstore = false;
- union mips_instruction i;
- union extension_byte e;
-
- *bufptr = 0;
- i.word = iword;
- e.byte = ext;
- *regmask = *symbol_value = *ls_register = 0;
-
- /* Put out the address and hex value of the instruction,
- leaving bufptr set at the end */
- if (save.addr_format) {
- sprintf(bufptr, save.addr_format, address);
- bufptr += strlen(bufptr);
- }
- if (save.value_format) {
- sprintf(bufptr, save.value_format, iword);
- bufptr += strlen(bufptr);
- }
-
- /* check for dynamic NOP */
- if (e.e.dyn_nop) {
- strcat(bufptr, "D.");
- bufptr += 2;
- }
-
- /* decode the instruction */
- switch (i.j_format.opcode) {
-
- case spec_op:
-
- if (i.word == 0x20) {
- strcat(bufptr, "nop");
- if (e.e.rd_boost)
- strcat(bufptr, ".B");
- bufptr += strlen(bufptr);
- break;
- } else if (i.r_format.func == addu_op && i.r_format.rt == ZERO) {
- sprintf(bufptr, "move%s\t%s,%s",
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rs, e.e.rs_boost, regmask));
- bufptr += strlen(bufptr);
- break;
- }
- strcat(bufptr, spec_name[i.r_format.func]);
- if (e.e.rd_boost)
- strcat(bufptr, ".B");
- bufptr += strlen(bufptr);
-
- switch (i.r_format.func) {
- case sll_op:
- case srl_op:
- case sra_op:
- sprintf(bufptr, "\t%s,%s,%d",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rt, e.e.rt_boost, regmask),
- i.r_format.re);
- break;
- case sllv_op:
- case srlv_op:
- case srav_op:
- sprintf(bufptr, "\t%s,%s,%s",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rt, e.e.rt_boost, regmask),
- register_name(i.r_format.rs, e.e.rs_boost, regmask));
- break;
- case mfhi_op:
- case mflo_op:
- sprintf(bufptr, "\t%s",
- register_name(i.r_format.rd, e.e.rd_boost, regmask));
- break;
- case jalr_op:
- return_value = 2;
- sprintf(bufptr, "\t%s,%s",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rs, e.e.rs_boost, regmask));
- break;
- case jr_op:
- return_value = 2;
- /* fall through */
- case mtlo_op:
- case mthi_op:
- sprintf(bufptr, "\t%s",
- register_name(i.r_format.rs, e.e.rs_boost, regmask));
- break;
- case mult_op:
- case multu_op:
- case div_op:
- case divu_op:
- sprintf(bufptr, "\t%s,%s",
- register_name(i.r_format.rs, e.e.rs_boost, regmask),
- register_name(i.r_format.rt, e.e.rt_boost, regmask));
- break;
- case syscall_op:
- break;
- case break_op:
- case vcall_op:
- {
- char *format = "\t%d";
- unsigned op2 = i.r_format.rd * 32 + i.r_format.re;
-
- if (op2)
- format = "\t%d,%d";
- sprintf(bufptr, format, i.r_format.rs*32+i.r_format.rt,
- op2);
- }
- break;
- default:
- sprintf(bufptr, "\t%s,%s,%s",
- register_name(i.r_format.rd, e.e.rd_boost, regmask),
- register_name(i.r_format.rs, e.e.rs_boost, regmask),
- register_name(i.r_format.rt, e.e.rt_boost, regmask));
- break;
- };
- break;
-
- case bcond_op:
- sprintf(bufptr, "%s%s\t%s,",
- bcond_name[i.i_format.rt],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rs, e.e.rs_boost, regmask));
- do_b_displacement = true;
- break;
-
- case blez_op_T:
- case bgtz_op_T:
- case blez_op_N:
- case bgtz_op_N:
- sprintf(bufptr, "%s%s\t%s,", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rs, e.e.rs_boost, regmask));
- do_b_displacement = true;
- break;
- case beq_op_T:
- case beq_op_N:
- if (i.i_format.rs == ZERO && i.i_format.rt == ZERO) {
- strcat(bufptr, "b");
- if (i.j_format.opcode == beq_op_T)
- strcat(bufptr, ".T");
- else
- strcat(bufptr, ".N");
- if (e.e.rd_boost)
- strcat(bufptr, ".B\t");
- else
- strcat(bufptr, "\t");
- do_b_displacement = true;
- break;
- }
- /* fall through */
- case bne_op_T:
- case bne_op_N:
- sprintf(bufptr, "%s%s\t%s,%s,", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rs, e.e.rs_boost, regmask),
- register_name(i.i_format.rt, e.e.rt_boost, regmask));
- do_b_displacement = true;
- break;
-
- case cop0_op:
- case cop1_op:
- case cop2_op:
- case cop3_op:
- {
- unsigned which_cop = i.j_format.opcode - cop0_op;
- char *f_or_r = "rf";
-
- switch (i.r_format.rs) {
- case bc_op_T:
- sprintf(bufptr, "bc%d%c.T%s\t", which_cop,
- "ft"[i.r_format.rt],
- e.e.rd_boost ? ".B" : "");
- do_b_displacement = true;
- break;
- case bc_op_N:
- sprintf(bufptr, "bc%d%c.N%s\t", which_cop,
- "ft"[i.r_format.rt],
- e.e.rd_boost ? ".B" : "");
- do_b_displacement = true;
- break;
- case mtc_op:
- if (which_cop == 0)
- sprintf(bufptr, "mtc%d%s\t%s,%s", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost,regmask),
- c0_reg[i.f_format.rd]);
- else
- sprintf(bufptr, "mtc%d%s\t%s,%c%d", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost,regmask),
- f_or_r[(which_cop == 1)],
- i.f_format.rd);
- break;
- case mfc_op:
- if (which_cop == 0)
- sprintf(bufptr, "mfc%d%s\t%s,%s", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost,regmask),
- c0_reg[i.f_format.rd]);
- else
- sprintf(bufptr, "mfc%d%s\t%s,%c%d", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost,regmask),
- f_or_r[(which_cop == 1)],
- i.f_format.rd);
- break;
- case cfc_op:
- sprintf(bufptr, "cfc%d%s\t%s,%c%d", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost, regmask),
- f_or_r[(which_cop == 1)],
- i.f_format.rd);
- break;
- case ctc_op:
- sprintf(bufptr, "ctc%d%s\t%s,%c%d", which_cop,
- e.e.rd_boost ? ".B" : "",
- register_name(i.r_format.rt, e.e.rt_boost, regmask),
- f_or_r[(which_cop == 1)],
- i.f_format.rd);
- break;
- default:
- if (which_cop != 1)
- sprintf(bufptr, "c0%s\t%s", e.e.rd_boost ? ".B" : "",
- c0_opname[i.f_format.func]);
- else
- {
- sprintf(bufptr, "%s.%s%s\t",
- cop1_name[i.f_format.func],
- fmt_name[i.f_format.fmt],
- e.e.rd_boost ? ".B" : "");
- bufptr += strlen(bufptr);
- switch (i.f_format.func) {
- case fsqrt_op:
- case fabs_op:
- case fmov_op:
- case fcvts_op:
- case fcvtd_op:
- case fcvte_op:
- case fcvtw_op:
- sprintf(bufptr, "f%d,f%d",
- i.f_format.re,
- i.f_format.rd);
- break;
- case fcmp_op+0x0:
- case fcmp_op+0x1:
- case fcmp_op+0x2:
- case fcmp_op+0x3:
- case fcmp_op+0x4:
- case fcmp_op+0x5:
- case fcmp_op+0x6:
- case fcmp_op+0x7:
- case fcmp_op+0x8:
- case fcmp_op+0x9:
- case fcmp_op+0xa:
- case fcmp_op+0xb:
- case fcmp_op+0xc:
- case fcmp_op+0xd:
- case fcmp_op+0xe:
- case fcmp_op+0xf:
- sprintf(bufptr, "f%d,f%d",
- i.f_format.rd,
- i.f_format.rt);
- break;
- default:
- sprintf(bufptr, "f%d,f%d,f%d",
- i.f_format.re,
- i.f_format.rd,
- i.f_format.rt);
- break;
- } /* switch on func */
- }
- break; /* End of default */
- } /* switch on rs */
- }
- break; /* End of cop0, cop1, cop2, cop3 */
-
- case jal_op:
- case j_op:
- sprintf(bufptr, "%s%s\t", op_name[i.j_format.opcode],
- e.e.rd_boost ? ".B" : "");
- *symbol_value = (address & 0xF0000000) | i.j_format.target << 2;
- if (save.print_jal_targets)
- {
- bufptr += strlen(bufptr);
- sprintf(bufptr, "%#x", *symbol_value);
- }
- return_value = 1;
- break;
-
- case swc1_op:
- case sdc1_op:
- case lwc1_op:
- case ldc1_op:
- sprintf(bufptr, "%s%s\tf%d,", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- i.i_format.rt);
- do_loadstore = true;
- break;
-
- case lb_op:
- case lh_op:
- case lw_op:
- case ld_op:
- case lbu_op:
- case lhu_op:
- case sb_op:
- case sh_op:
- case sw_op:
- case sd_op:
- case lwl_op:
- case lwr_op:
- sprintf(bufptr, "%s%s\t%s,", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rt, e.e.rt_boost, regmask));
- do_loadstore = true;
- break;
-
- case ori_op:
- case xori_op:
- if (i.u_format.rs == ZERO) {
- sprintf(bufptr, "li%s\t%s,%d",
- e.e.rd_boost ? ".B" : "",
- register_name(i.u_format.rt, e.e.rt_boost, regmask),
- i.u_format.uimmediate);
- break;
- }
- /* fall through */
- case andi_op:
- sprintf(bufptr, "%s%s\t%s,%s,%#x", op_name[i.u_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.u_format.rt, e.e.rt_boost, regmask),
- register_name(i.u_format.rs, e.e.rs_boost, regmask),
- i.u_format.uimmediate);
- break;
- case lui_op:
- sprintf(bufptr, "%s%s\t%s,%#x", op_name[i.u_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.u_format.rt, e.e.rt_boost, regmask),
- i.u_format.uimmediate);
- break;
- case addi_op:
- case addiu_op:
- if (i.i_format.rs == ZERO) {
- short sign_extender = i.i_format.simmediate;
- sprintf(bufptr, "li%s\t%s,%d",
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rt, e.e.rt_boost, regmask),
- sign_extender);
- break;
- }
- /* fall through */
- default:
- {
- short sign_extender = i.i_format.simmediate;
- sprintf(bufptr, "%s%s\t%s,%s,%d", op_name[i.i_format.opcode],
- e.e.rd_boost ? ".B" : "",
- register_name(i.i_format.rt, e.e.rt_boost, regmask),
- register_name(i.i_format.rs, e.e.rs_boost, regmask),
- sign_extender);
- }
- break;
- }
-
- /* Some instructions require more than just registers */
-
- if (do_loadstore)
- {
- short sign_extender = i.i_format.simmediate;
- *symbol_value = sign_extender;
- *ls_register = i.i_format.rs;
- bufptr += strlen(bufptr);
- sprintf(bufptr, "%d(%s)", sign_extender,
- register_name(i.i_format.rs, e.e.rs_boost, regmask));
- return_value = -1;
- }
- else if (do_b_displacement)
- {
- short sign_extender = i.i_format.simmediate;
- bufptr += strlen(bufptr);
- sprintf(bufptr, "%#x", 4 + address + ((((long)sign_extender & 0xFFFD0000) | (0x3FFFF & (sign_extender << 2)))));
-// sprintf(bufptr, "%#x", (long)sign_extender);
- return_value = 2;
- }
-
- return return_value;
-}
-
-static long instrs[10]={
- 0x0411000a,
- 0x03e0f021,
- 0x02feb023,
- 0x24010050,
- 0x10360044,
- 0x24010090,
- 0x10360046,
- 0x240100b8,
- 0x10360048,
- 0x240100d0
- };
-
-int main(void)
-{
- int i;
- int junk;
- char buf[80];
- long *pInstr = (long*)instrs;
-
- for (i=0; i < 10; i++)
- {
- tdisasm(buf, (long)&pInstr[i], pInstr[i], 0, &junk, &junk, &junk);
- printf("%s\n", buf);
- }
- return 0;
-
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/test_timer.c b/lib/CPUs/MIPS/bsp/examples/test_timer.c
deleted file mode 100644
index 91b5a78..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_timer.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "libsys.h"
-
-
-int g_cnt;
-void handler7(void)
-{
- UINT32 *pGPIO0 = (UINT32*)SYS_GPIO0;
- UINT32 *pTim_stat = (UINT32*)SYS_ITIM_STAT;
- if (*pTim_stat & 1)
- {
- *pTim_stat = 1;
- *pGPIO0 = g_cnt++;
- }
-
-}
-
-int main (void)
-{
- UINT32 *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
- UINT32 *pTim_stat = (UINT32*)SYS_ITIM_STAT;
- UINT32 *pTim_cnt = (UINT32*)SYS_ITIM_CNT;
- UINT32 *pTim_cmp = (UINT32*)SYS_ITIM_CMP;
- UINT32 *pGPIO0 = (UINT32*)SYS_GPIO0;
-
- g_cnt = 1;
- *pGPIO0 = 0;
-
- interrupt_register(7, handler7);
- interrupt_enable(7);
-
- *pTim_cnt = 0;
- *pTim_cmp = 2000;
- *pTim_stat = 1;
- *pTim_ctrl = 3;
-
- while(1);
-
- return 0;
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/test_vga.c b/lib/CPUs/MIPS/bsp/examples/test_vga.c
deleted file mode 100644
index 7919abd..0000000
--- a/lib/CPUs/MIPS/bsp/examples/test_vga.c
+++ /dev/null
@@ -1,206 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define CPU_FREQ_HZ 100000000
-#include "libsys.h"
-#include "irq.h"
-#include "mips_gfx.h"
-#include "mips_ps2.h"
-
-static volatile INT32 mouse_x;
-static volatile INT32 mouse_y;
-static box_t box;
-static gfx_t gfx;
-static volatile int _g_posx, _g_posy;
-static volatile g_btn_l, g_btn_r;
-static volatile UINT32 g_color;
-
-// -------------------------------------------------------------
-void handler5(void)
-{
- UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
-
- // Ack
- *pVGA_ctrl |= SYS_VGA_BIT_BUFCHG_FLAG;
-
-}
-
-void handler6(void)
-{
- int p, i;
- ps2_if_t *pIF;
- UINT8 mouse_rsp[3];
- UINT32 timeout_count, key;
-
- INT32 dx, dy;
-
- for (p=0; p < PS2_get_num_if(); p++)
- {
- pIF = PS2_get_if(p);
- if (SYS_PS2_BIT_RX_ERR_FLAG & *pIF->pCTRL)
- fprintf(stderr, "PS2[%d]: Status = 0x%08X\n", p, *pIF->pCTRL);
-
- if (pIF->type == ps2_type_keyb)
- {
- while(SYS_PS2_BIT_RX_IRQ & *pIF->pCTRL)
- {
- key = *pIF->pDATA;
- printf("Keyboard scan code = 0x%02X\n", key);
- }
- }
- if (pIF->type == ps2_type_mouse)
- {
- if(!(SYS_PS2_BIT_RX_IRQ & *pIF->pCTRL))
- continue;
-
- for (i=0; i < 3; i++)
- {
- timeout_count = 100;
- while(!(SYS_PS2_BIT_RX_IRQ & *pIF->pCTRL))
- {
- timeout_count--;
- if (!timeout_count)
- {
- break;
- }
- sleep(1);
- }
- if (!timeout_count)
- {
- break;
- }
- mouse_rsp[i] = (UINT8)*pIF->pDATA;
- }
- if (!timeout_count)
- {
- continue;
- }
- dx = mouse_rsp[1];
- if (mouse_rsp[0] & 0x10)
- dx |= 0xFFFFFF00;
- dy = mouse_rsp[2];
- if (mouse_rsp[0] & 0x20)
- dy |= 0xFFFFFF00;
-
-// printf("dx = %5d, dy = %5d\n", dx, dy);
-
- mouse_x += dx;
- mouse_y -= dy;
- g_btn_l = 0;
- if (mouse_rsp[0] & 0x01)
- g_btn_l = 1;
-
- if (mouse_rsp[0] & 0x02)
- {
- if (g_btn_r == 0)
- {
- g_color = (UINT32)rand();
- }
- g_btn_r = 1;
- }
- else
- g_btn_r = 0;
-
-
- if (mouse_x < 0)
- mouse_x = 0;
- if (mouse_y < 0)
- mouse_y = 0;
- if (mouse_x > (gfx.w-1))
- mouse_x = gfx.w-1;
- if (mouse_y >= (gfx.h-1))
- mouse_y = gfx.h-1;
-
-// Screen_csr_set_x(mouse_x);
-// Screen_csr_set_y(mouse_y);
-
-// printf("x = %5d, y = %5d\n", mouse_x, mouse_y);
-
- }
- }
-}
-
-int main(void)
-{
-
- int i;
- UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
- UINT32 volatile *pVGA_moffs_0 = (UINT32*)SYS_VGA_FB_FRONT;
- UINT32 volatile *pVGA_moffs_1 = (UINT32*)SYS_VGA_FB_BACK;
- UINT32 volatile *pVGA_cgcol = (UINT32*)SYS_VGA_CGCOL;
- UINT32 volatile *pFlashPicture = (UINT32*)(SYS_FLASH_MEM + 0x00600000);
- UINT32 framecount;
- UINT32 start, end;
-
- interrupt_register(5, (void*)handler5);
- interrupt_register(6, (void*)handler6);
-
- srand(clock());
- UART1_setbaud(460800);
-
- *pVGA_cgcol = 0x00FFFFFF;
- _g_posx = _g_posy = 0;
- g_color = 0xFFFFFFFF;
- GFX_init(&gfx);
-
- GFX_set_background(&gfx, pFlashPicture, 800, 600, 1, 1);
- box_create(&box, 256, 256);
- GFX_box_draw(&gfx, &box, _g_posx, _g_posy, g_color);
- GFX_show(&gfx);
- printf("VGA status = %08X\n", *pVGA_ctrl);
-
- PS2_init(0);
- PS2_init(1);
-
- // Flush buffer
- PS2_flush(0);
- PS2_flush(1);
-
-// interrupt_enable(5);
- interrupt_enable(6);
-
- framecount = Screen_get_fps();
- start = clock();
-
- while(1)
- {
- if (!framecount)
- {
- end = clock();
- framecount = Screen_get_fps();
- printf("%f FPS\n", (float)framecount/((float)(end-start)/CLOCKS_PER_SEC));
- start = clock();
- }
-
- GFX_frame(&gfx, GFX_FRAME_SYNC);
- framecount--;
-
- while ((_g_posx != (UINT32)mouse_x) || (_g_posy != (UINT32)mouse_y) || g_btn_r || g_btn_l)
- {
-
- GFX_restore(&gfx, &box, _g_posx, _g_posy);
-
- _g_posx = (UINT32)mouse_x;
- _g_posy = (UINT32)mouse_y;
-
- if (g_btn_l && !g_btn_r)
- {
- GFX_box_draw_bg(&gfx, &box, _g_posx, _g_posy, g_color);
- }
-
- if (g_btn_l && g_btn_r)
- {
- GFX_set_background(&gfx, pFlashPicture, 800, 600, 1, 1);
- }
-
- GFX_box_draw(&gfx, &box, _g_posx, _g_posy, g_color);
- break;
- }
- GFX_show(&gfx);
- }
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/testbench.c b/lib/CPUs/MIPS/bsp/examples/testbench.c
deleted file mode 100644
index 15d921d..0000000
--- a/lib/CPUs/MIPS/bsp/examples/testbench.c
+++ /dev/null
@@ -1,1229 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "libsys.h"
-#include "mips_gfx.h"
-
-#define TEST10_ERROR (ERROR | 0x1000)
-#define TEST11_ERROR (ERROR | 0x1100)
-#define TEST12_ERROR (ERROR | 0x1200)
-#define TEST13_ERROR (ERROR | 0x1300)
-#define TEST14_ERROR (ERROR | 0x1400)
-#define TEST15_ERROR (ERROR | 0x1500)
-#define TEST16_ERROR (ERROR | 0x1600)
-
-#define PIC_NX 800
-#define PIC_NY 600
-
-extern int paranoia(int argc, char **argv);
-
-UINT32* pf(void)
-{
- static UINT32 p;
-
- return &p;
-}
-
-volatile UINT32 _g_blitter_rdy;
-void ISR_blitter_rdy(void)
-{
- UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
-
- if (*pVGA_ctrl & SYS_VGA_BIT_BLIT_FIN)
- {
- putchar('.');
- // Ack
- *pVGA_ctrl |= SYS_VGA_BIT_BLIT_ACK;
- _g_blitter_rdy = 1;
- }
-}
-
-// -------------------------------------------------------------
-void LoadPic(UINT64 *pScreen, UINT32 screen_nx, UINT32 screen_ny, UINT32 *pImage, UINT32 image_nx, UINT32 image_ny, UINT32 image_scale_x, UINT32 image_scale_y)
-{
-
- UINT32 off_x, off_y;
- UINT32 i, j, black;
- UINT32 *pScr, *pImg;
-
- off_x = (screen_nx-(image_scale_x*image_nx))/2;
- off_y = (screen_ny-(image_scale_y*image_ny))/2;
-
- black = 0;
- pScr = (UINT32*)pScreen;
- for (i=0; i < screen_nx*screen_ny; i += 8)
- {
- __gfx_block_set_8(pScr, 0);
- pScr += 8;
- }
-
- if (!pImage)
- return;
-
- pScr = ((UINT32*)pScreen) + screen_nx*off_y + off_x;
- pImg = pImage;
-
- for (i=0; i < image_ny*image_nx; i += 8)
- {
- __gfx_block_copy_8(pScr, pImg);
- pScr += 8;
- pImg += 8;
- }
-
-/*
- UINT32 off_x, off_y;
- UINT32 i;
- UINT32 *pScr;
-
- off_x = (screen_nx-(image_scale_x*image_nx))/2;
- off_y = (screen_ny-(image_scale_y*image_ny))/2;
-
- memset(pScreen, 0, screen_nx*screen_ny*sizeof(UINT32));
- pScr = ((UINT32*)pScreen) + screen_nx*off_y + off_x;
-
- for (i=0; i < image_ny; i++)
- {
- memcpy(pScr, &pImage[i*image_nx], image_nx*sizeof(UINT32));
- pScr += screen_nx;
- }
-*/
-}
-
-int IsEndianBig(void)
-{
- UINT8 *pBuf;
- UINT32 word;
- word = 0x12345678;
- pBuf = (UINT8*)&word;
- if (((*pBuf+0) == 0x12) && (*(pBuf+1) == 0x34) && (*(pBuf+2) == 0x56) && (*(pBuf+3) == 0x78))
- {
- return 1;
- }
- if (((*pBuf+0) == 0x78) && (*(pBuf+1) == 0x56) && (*(pBuf+2) == 0x34) && (*(pBuf+3) == 0x12))
- {
- return 0;
- }
- return -1;
-}
-
-void handler3(void)
-{
- volatile UINT32 *pUART_stat = (UINT32*)SYS_UART_STAT;
- volatile UINT32 *pUART_data = (UINT32*)SYS_UART_DATA;
-
- if((0x10 & *pUART_stat))
- {
- _putchar(0, (char)*pUART_data);
- }
-
-}
-
-int g_cnt;
-box_t box;
-gfx_t gfx;
-int posx, posy;
-
-void handler7(void)
-{
- UINT32 volatile *pGPIO0 = (UINT32*)SYS_GPIO0;
- UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
- UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
- UINT32 volatile *pTim0_cmp = (UINT32*)SYS_ITIM0_CMP;
- time_t curr_date;
- struct tm *pDate;
-
- if (*pTim0_cmp < 0x200)
- {
- *pTim0_cmp = 0x200;
- }
- if (*pTim_stat & 1)
- {
- *pTim_stat = 1;
- *pGPIO0 = g_cnt++;
- GFX_frame(&gfx, GFX_FRAME_NOSYNC);
- GFX_restore(&gfx, &box, posx, posy);
- GFX_show(&gfx);
-
- posx = (UINT32)rand()%800;
- posy = (UINT32)rand()%600;
- GFX_frame(&gfx, GFX_FRAME_NOSYNC);
- GFX_box_draw(&gfx, &box, posx, posy, (UINT32)rand());
- GFX_show(&gfx);
- }
-
- if (*pTim_stat & 4)
- {
- *pTim_stat = 4;
- curr_date = time(NULL);
- pDate = gmtime(&curr_date);
- fprintf(stderr, "%s", asctime(pDate));
- }
-
-}
-
-int fibonacci(int f0, int f1, int *pDst, int len)
-{
- int i;
-
- i = 0;
-
- pDst[i++] = f0;
- pDst[i++] = f1;
-
- for (; i < len; i++)
- {
- pDst[i] = pDst[i-2] + pDst[i-1];
- }
-
- return i;
-}
-
-void PrintCPUinfo(void)
-{
- int result, rev_id;
- int cache_size, cache_line;
- int eb;
-
- char *cpu_type_str[7] = {"invalid", "R2000", "R3000", "R6000", "R4000", "reserved", "R6000A"};
-
- // Print Status register
- result = CP0_SR_read();
-
- printf("--------------------------------------------------\n");
- printf("Status : %8.8X\n", result);
-
- // Print Revision
- result = CP0_PRID_read();
- rev_id = (result >> 8) & 0xFF;
- printf("CPU type : MIPS ");
- if ((rev_id > 0) && (rev_id < 0x07))
- {
- printf(cpu_type_str[rev_id]);
- printf(" Rev. ");
- rev_id = result & 0xFF;
- printf("%d", rev_id);
- }
- else
- printf("Unknown");
-
- eb = IsEndianBig();
- if (eb)
- printf(" [Big-endian]\n");
- if (!eb)
- printf(" [Little-endian]\n");
- if (eb < 0)
- printf(" [Unknown endian]\n");
-
- cache_size = (result >> 16) & 7;
- cache_line = (result >> 19) & 7;
- printf("I-Cache : %d kBytes (%d Bytes per line)\n", 4*(int)pow(2.0, (double)(8+cache_size))/1024, 4*(int)pow(2.0, (double)(cache_line)));
- cache_size = (result >> 24) & 7;
- cache_line = (result >> 27) & 7;
- printf("D-Cache : %d kBytes (%d Bytes per line)\n", 4*(int)pow(2.0, (double)(8+cache_size))/1024, 4*(int)pow(2.0, (double)(cache_line)));
- printf("--------------------------------------------------\n");
-
-}
-
-UINT32 uncached_cachemiss_bug(void)
-{
- UINT32 result;
- UINT32 pMem[2];
-
- pMem[0] = 0x12345678;
- pMem[1] = 0xFFFFFFFF;
-
- __asm__
- (
- "cop0 34\n"
- "lui $s0, 0xA000\n"
- "lw $a0, 48($s0)\n"
- "or $s1, $a0, $0\n"
- "or $a2, $0, $0\n"
- "addiu $a2, 0x7F00\n"
- "sw $a2, 48($s0)\n"
-// "lw $a1, 0(%[pMem])\n"
- "lw $a0, 48($s0)\n"
- "lw $a2, 4(%[pMem])\n"
- "lw $a1, 0(%[pMem])\n"
- "nop\n"
- "sw $s1, 48($s0)\n"
- "or %[val], $a0, $0\n"
- : [val] "=r" (result)
- : [pMem] "r" (pMem)
- : "a0", "a1", "a2", "s0", "s1"
- );
- return result;
-}
-
-UINT32 non_aligned_load()
-{
- UINT32 result;
- UINT32 pMem[3];
-
- __asm__
- (
- "li $t0, 0x01234567\n"
- "li $t1, 0x89ABCDEF\n"
- "sw $t0, 0(%[pMem])\n"
- "sw $t1, 4(%[pMem])\n"
- "li %[val], 0x55555555\n"
- "lw %[val], 0(%[pMem])\n"
- "lwl %[val], 5(%[pMem])\n"
- : [val] "=r" (result)
- : [pMem] "r" (pMem)
- : "t0", "t1"
- );
-
- if (0 == IsEndianBig())
- {
- if (0xCDEF4567 != result)
- return ERROR;
- }
- else
- {
- if (0xABCDEF67 != result)
- return ERROR;
- }
- return 0;
-
-}
-
-int Test10_LoadStore()
-{
- int *buf, i, result, data, err;
- volatile int *pPtr;
-
- buf = (int*)malloc(32*sizeof(int));
-// sputs("buf = ");
-// print_word((int)buf);
-// sputs("\n");
-
- while(1)
- {
- err = TEST10_ERROR;
- // Basic Load/Store
- pPtr = buf;
- *pPtr++ = 0x00000000;
- *pPtr++ = 0x55555555;
- *pPtr++ = 0xAAAAAAAA;
- *pPtr++ = 0xFFFFFFFF;
- pPtr = buf;
- if (*pPtr++ != 0x00000000)
- break;
- if (*pPtr++ != 0x55555555)
- break;
- if (*pPtr++ != 0xAAAAAAAA)
- break;
- if (*pPtr++ != 0xFFFFFFFF)
- break;
-
- // Filling from left
- pPtr = buf;
- data = 0x00000000;
- for (i=0; i < 32; i++)
- {
- *pPtr++ = data;
- data = data >> 1 | 0x80000000;
-
- }
- pPtr = buf;
- data = 0x00000000;
- for (i=0; i < 32; i++)
- {
-
- if (*pPtr++ != data)
- break;
-
- data = data >> 1 | 0x80000000;
- }
- if (i != 32)
- break;
-
- // Filling from right
- pPtr = buf;
- data = 0x00000000;
- for (i=0; i < 32; i++)
- {
- *pPtr++ = data;
- data = data << 1 | 1;
-
- }
- pPtr = buf;
- data = 0x00000000;
- for (i=0; i < 32; i++)
- {
-
- if (*pPtr++ != data)
- break;
-
- data = data << 1 | 1;
- }
- if (i != 32)
- break;
-
- // Walking ones
- pPtr = buf;
- data = 0x00000001;
- for (i=0; i < 32; i++)
- {
- *pPtr++ = data;
- data = data << 1;
-
- }
- pPtr = buf;
- data = 0x00000001;
- for (i=0; i < 32; i++)
- {
-
- if (*pPtr++ != data)
- break;
-
- data = data << 1;
- }
- if (i != 32)
- break;
-
- // Walking zeros
- pPtr = buf;
- data = 0xFFFFFFFE;
- for (i=0; i < 32; i++)
- {
- *pPtr++ = data;
- data = data << 1 | 1;
-
- }
- pPtr = buf;
- data = 0xFFFFFFFE;
- for (i=0; i < 32; i++)
- {
-
- if (*pPtr++ != data)
- break;
-
- data = data << 1 | 1;
-
- }
- if (i != 32)
- break;
-
- err = NO_ERROR;
- break;
- }
- free(buf);
-
- if (IS_ERROR(err))
- return err;
-
- if (IS_ERROR(non_aligned_load()))
- return TEST10_ERROR | 1;
-
- if (IS_ERROR(uncached_cachemiss_bug()))
- return TEST10_ERROR | 2;
-
- return NO_ERROR;
-
-}
-
-
-#define NUM_ELEMENTS 10000
-#define NUM_RUNS 3
-int Test11_AddSub()
-{
- int buf[NUM_ELEMENTS], result, i, j, diff, fill, num_right_elements, num_right_runs;
-
- fill = 0xAAAAAAAA;
-
- num_right_runs = 0;
-
- for (i=0; i < NUM_RUNS; i++)
- {
- for (j=0; j < NUM_ELEMENTS; j++)
- {
- buf[j] = fill;
- fill = ((fill ^ j) - 1) << 1;
- }
- num_right_elements = 2;
- result = fibonacci(i, i+1, buf, NUM_ELEMENTS);
- for (j=2; j < NUM_ELEMENTS; j++)
- {
- diff = buf[j] - buf[j-1];
- if (diff == buf[j-2])
- num_right_elements++;
- }
- if (num_right_elements == NUM_ELEMENTS)
- num_right_runs++;
-
- }
-
- if (num_right_runs != NUM_RUNS)
- return TEST11_ERROR;
-
- return NO_ERROR;
-}
-
-int Test12_MulDiv()
-{
- int mix, i, j;
- int s1, s2, sp, st;
- div_t div_res;
- long cl;
-
- cl = (long)clock();
- srand(cl);
- for (i=0; i < 100; i++)
- {
- for (j=1; j < 100; j++)
- {
- mix = (int)rand();
- mix = (mix << 8) ^ (mix << 16);
- s1 = (int)rand() ^ mix;
- mix = (int)rand();
- mix = (mix << 8) ^ (mix << 16);
- s2 = (int)rand() ^ mix;
- if (!s2)
- {
- fprintf(stderr, "Test12_MulDiv(): Division by zero!\n");
- fprintf(stderr, "Clock() was 0x%8.8X\n", cl);
- continue;
- }
-
- div_res = div(s1, s2);
-
- sp = s2*div_res.quot;
- st = div_res.rem + sp;
- if (st != s1)
- return TEST12_ERROR;
- }
- }
- return NO_ERROR;
-}
-
-int Test13_COP0_Load_Store(void)
-{
- int i,size;
- UINT32 *pSrc32, *pDst32;
-
- size = 0x2000;
- pSrc32 = (UINT32*)0xBFC00000;
- pDst32 = (UINT32*)calloc(size,sizeof(UINT32));
- for (i=0; i < size/4; i++)
- {
- CP0_TR_read_ptr(&pSrc32[i]);
- CP0_TR_write_ptr(&pDst32[i]);
- }
- for (i=size/4-1; i >= 0; i--)
- if (pDst32[i] != pSrc32[i])
- break;
-
- free(pDst32);
- i++;
- if (i)
- return TEST13_ERROR;
-
- return NO_ERROR;
-}
-
-int Test14_DCACHE_invalidate(void)
-{
- int i,size;
- UINT32 *pSrc32, *pDst32;
-
- size = 0x2000;
- pSrc32 = (UINT32*)0xBFC00000;
- pDst32 = (UINT32*)calloc(size,sizeof(UINT32));
- for (i=0; i < size/4; i++)
- {
- pDst32[i] = pSrc32[i];
- DCACHE_invalidate_at(&pDst32[i]);
- }
- for (i=size/4-1; i >= 0; i--)
- {
- DCACHE_invalidate_at(&pDst32[i]);
- if (pDst32[i] != pSrc32[i])
- break;
- }
-
- free(pDst32);
- i++;
- if (i)
- return TEST14_ERROR;
-
- pDst32 = (UINT32*)calloc(size,sizeof(UINT32));
- for (i=0; i < size/4; i++)
- {
- pDst32[i] = pSrc32[i];
- }
- DCACHE_invalidate_all();
- for (i=size/4-1; i >= 0; i--)
- if (pDst32[i] != pSrc32[i])
- break;
-
- free(pDst32);
- i++;
- if (i)
- return TEST14_ERROR;
-
- return NO_ERROR;
-}
-
-#define PI_SCALE 10000
-#define PI_MAXARR 2800
-#define PI_ARRINIT 2000
-
-int Test15_pi_calc()
-{
- int i, j, k;
- int carry = 0;
- int arr[PI_MAXARR+1];
- UINT32 int_part, result;
- UINT16 pi_res[200] = {0};
- UINT16 pi_ref[200] =
- {
- 3141,5926,5358,9793,2384,6264,3383,2795, 288,4197,1693,9937,5105,8209,7494,4592,3078,1640,6286,2089,9862,8034,8253,4211,
- 7067,9821,4808,6513,2823, 664,7093,8446, 955, 582,2317,2535,9408,1284,8111,7450,2841, 270,1938,5211, 555,9644,6229,4895,
- 4930,3819,6442,8810,9756,6593,3446,1284,7564,8233,7867,8316,5271,2019, 914,5648,5669,2346, 348,6104,5432,6648,2133,9360,
- 7260,2491,4127,3724,5870, 660,6315,5881,7488,1520,9209,6282,9254, 917,1536,4367,8925,9036, 11,3305,3054,8820,4665,2138,
- 4146,9519,4151,1609,4330,5727, 365,7595,9195,3092,1861,1738,1932,6117,9310,5118,5480,7446,2379,9627,4956,7351,8857,5272,
- 4891,2279,3818,3011,9491,2983,3673,3624,4065,6643, 860,2139,4946,3952,2473,7190,7021,7986, 943,7027,7053,9217,1762,9317,
- 6752,3846,7481,8467,6694, 513,2000,5681,2714,5263,5608,2778,5771,3427,5778,9609,1736,3717,8721,4684,4090,1224,9534,3014,
- 6549,5853,7105, 792,2796,8925,8923,5420,1995,6112,1290,2196, 864, 344,1815,9813,6297,7477,1309,9605,1870,7211,3499,9999,
- 8372,9780,4995,1059,7317,3281,6096,3185
- };
-
- // setbuf(stdout, NULL);
- k = 0;
- for (i = 0; i <= PI_MAXARR; ++i)
- arr[i] = PI_ARRINIT;
-
- for (i = PI_MAXARR; i; i -= 14)
- {
- int sum = 0;
- for (j = i; j > 0; --j)
- {
- sum = sum*j + PI_SCALE*arr[j];
- arr[j] = sum % (j*2-1);
- sum /= (j*2-1);
- }
- result = carry + sum/PI_SCALE;
- int_part = PI_SCALE * (result / PI_SCALE);
- pi_res[k] = (UINT16)(result - int_part);
- carry = sum % PI_SCALE;
- k++;
- }
-
- for (k=0; k < sizeof(pi_ref)/sizeof(UINT16); k++)
- {
- printf("%d", pi_res[k]);
- }
- printf("\n");
-
- if(memcmp(pi_res, pi_ref, sizeof(pi_ref)))
- return TEST15_ERROR;
-
- return NO_ERROR;
-}
-
-#define TEST_SIZE (16*1024*1024) // Bytes
-#define SMALL_TEST_SIZE (8192) // Bytes
-#define FLASH_SIZE (8*1024*1024) // Bytes
-
-int Test16_MemTest(void)
-{
- int result, i, j, cnt, size;
- UINT8 *ram8 = NULL;
- UINT16 *ram16 = NULL;
- UINT32 *ram32 = NULL;
- UINT32 volatile *pFlashIO = (UINT32*)SYS_FLASH_IO;
- UINT32 volatile *pFlashMem = (UINT32*)SYS_FLASH_MEM;
- UINT32 volatile *pROM = (UINT32*)0xBFC00000;
- UINT32 volatile *pVGA_src0 = (UINT32*)SYS_VGA_BLIT_SRC0;
- UINT32 volatile *pVGA_dst = (UINT32*)SYS_VGA_BLIT_DST;
- UINT32 volatile *pVGA_dimx_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_DIMX;
- UINT32 volatile *pVGA_dimx_dst = (UINT32*)SYS_VGA_BLIT_DST_DIMX;
- UINT32 volatile *pVGA_nx = (UINT32*)SYS_VGA_BLIT_NX;
- UINT32 volatile *pVGA_ny = (UINT32*)SYS_VGA_BLIT_NY;
- UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
- UINT32 volatile *pVGA_moffs_0 = (UINT32*)SYS_VGA_FB_FRONT;
-
-
- UINT32 *pSrc32, *pDst32;
- UINT32 start, end;
-
- // ----------------------------------------------------------
- // Memtest BEGIN
-/* printf("SSRAM Memory Test\r\n");
- printf("Small data test\r\n");
- printf("Write (32-Bit access)...");
- start = clock();
- for (j=0; j < TEST_SIZE/SMALL_TEST_SIZE; j++)
- for (i=0; i < SMALL_TEST_SIZE/4; i++)
- pSSRAM[i] = (UINT32)i;
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1000*(end-start)));
-
- PrintBuffer8((UINT8*)pSSRAM, 16, 256);
-
- printf("Verify (32-Bit access)...");
- start = clock();
- for (j=0; j < TEST_SIZE/SMALL_TEST_SIZE; j++)
- for (i=SMALL_TEST_SIZE/4-1; i >= 0; i--)
- if (pSSRAM[i] != (UINT32)i)
- break;
-
- end = clock();
- i++;
- if (i)
- printf("failed\r\n");
- else
- printf("passed (%.2f MByte/s)\n", (double)TEST_SIZE/(1000*(end-start)));
-*/
- // ----------------------------------------------------------
- pSrc32 = (UINT32*)calloc(TEST_SIZE/4,sizeof(UINT32));
- pDst32 = (UINT32*)calloc(TEST_SIZE/4,sizeof(UINT32));
-
- // Memtest BEGIN
- printf("Dump first 16 bytes of flash blocks\n");
- for (i=0; i < FLASH_SIZE; i += 0x40000)
- memdump((UINT8*)(pFlashIO+i/4), 0, 16, 16);
-
- printf("\n");
-
- printf("SDRAM Memory Test\n");
- printf("Test size %d kByte\n\n", TEST_SIZE/1024);
-
- ram8 = (UINT8*)pDst32;
- printf("Zeroize SDRAM (memset)...");
- start = clock();
- memset(ram8, 0, TEST_SIZE);
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- printf("Zeroize SDRAM (8-Bit access)...");
- start = clock();
- for (i=0; i < TEST_SIZE; i++)
- ram8[i] = (UINT8)0;
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- ram16 = (UINT16*)pDst32;
- printf("Zeroize SDRAM (16-Bit access)...");
- start = clock();
- for (i=0; i < TEST_SIZE/2; i++)
- ram16[i] = (UINT16)0;
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- ram32 = (UINT32*)pDst32;
- printf("Zeroize SDRAM (32-Bit access)...");
- start = clock();
- for (i=0; i < TEST_SIZE/4; i++)
- ram32[i] = (UINT32)0;
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- ram8 = (UINT8*)pDst32;
- printf("Write SDRAM (8-Bit access)...");
- start = clock();
- for (i=0; i < TEST_SIZE; i++)
- ram8[i] = (UINT8)i;
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- printf("Verify SDRAM (8-Bit access)...");
- start = clock();
- for (i=TEST_SIZE-1; i >= 0; i--)
- if (ram8[i] != (UINT8)i)
- break;
-
- end = clock();
- i++;
- if (i)
- {
- printf("failed\r\n");
- return TEST16_ERROR;
- }
- else
- printf("passed (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- ram16 = (UINT16*)pDst32;
- printf("Write SDRAM (16-Bit access)...");
- start = clock();
- for (i=0; i < TEST_SIZE/2; i++)
- ram16[i] = (UINT16)i;
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- printf("Verify SDRAM (16-Bit access)...");
- start = clock();
- for (i=TEST_SIZE/2-1; i >= 0; i--)
- if (ram16[i] != (UINT16)i)
- break;
-
- end = clock();
- i++;
- if (i)
- {
- printf("failed\r\n");
- return TEST16_ERROR;
- }
- else
- printf("passed (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
-
- ram32 = (UINT32*)pDst32;
- printf("Write SDRAM (32-Bit access)...");
- start = clock();
- for (i=0; i < TEST_SIZE/4; i++)
- {
- ram32[i] = (UINT32)i;
- }
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- printf("Verify SDRAM (32-Bit access)...");
- start = clock();
- for (i=TEST_SIZE/4-1; i >= 0; i--)
- {
- if (ram32[i] != (UINT32)i)
- break;
- }
-
- end = clock();
- i++;
- if (i)
- {
- printf("failed\r\n");
- return TEST16_ERROR;
- }
- else
- printf("passed (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- printf("\n");
- printf("Small data test (size = %d kByte)\n", SMALL_TEST_SIZE/1024);
- printf("Write SDRAM (32-Bit access)...");
- ram32 = (UINT32*)pDst32;
- start = clock();
- for (j=0; j < TEST_SIZE/SMALL_TEST_SIZE; j++)
- for (i=0; i < SMALL_TEST_SIZE/4; i++)
- ram32[i] = (UINT32)i;
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- // -------------------------------------------------------------------
- // Verify
- printf("Verify SDRAM (32-Bit access)...");
- start = clock();
- for (j=0; j < TEST_SIZE/SMALL_TEST_SIZE; j++)
- for (i=SMALL_TEST_SIZE/4-1; i >= 0; i--)
- if (ram32[i] != (UINT32)i)
- break;
-
- end = clock();
- i++;
- if (i)
- {
- printf("failed\r\n");
- return TEST16_ERROR;
- }
- else
- printf("passed (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
-
- for (i=1024; i < 4*65536; i *= 2)
- {
- printf("Memcpy() (%d kByte)...", i/1024);
- start = clock();
- for (j=0; j < TEST_SIZE/i; j++)
- memcpy(pDst32, pSrc32, i);
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
- }
- for (i=1024; i < 4*65536; i *= 2)
- {
- printf("__gfx_copy_32() (%d kByte)...", i/1024);
- start = clock();
- for (j=0; j < TEST_SIZE/i; j++)
- __gfx_copy_32(pDst32, pSrc32, i/32);
-
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
- }
- // -------------------------------------------------------------------
- printf("\n");
-
- printf("Memcpy() Flash(IO) => SDRAM \n");
- printf("Copying %d kBytes...", FLASH_SIZE/(1024));
- start = clock();
- memcpy(pDst32, (UINT32*)pFlashIO, FLASH_SIZE);
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
- printf("\n");
-
- printf("Memcpy() Flash(MEM) => SDRAM \n");
- printf("Copying %d kBytes...", FLASH_SIZE/(1024));
- start = clock();
- memcpy(pDst32, (UINT32*)pFlashMem, FLASH_SIZE);
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)TEST_SIZE/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
- printf("\n");
-
- interrupt_register(5, (void*)ISR_blitter_rdy);
- interrupt_enable(5);
- *pVGA_ctrl |= SYS_VGA_BIT_BLIT_FIN_INTEN;
- printf("Blitter speed test (scan disabled)...");
- *pVGA_src0 = (UINT32)pSrc32;
- *pVGA_dst = (UINT32)pDst32;
- *pVGA_dimx_src0 = (UINT32)0;
- *pVGA_dimx_dst = (UINT32)0;
- *pVGA_nx = (UINT32)TEST_SIZE/4 - 1;
- *pVGA_ny = (UINT32)0;
-
- start = clock();
- for (i=0; i < 10; i++)
- {
- _g_blitter_rdy = 0;
- *pVGA_ctrl |= SYS_VGA_BIT_BLIT_REQ;
- while (!_g_blitter_rdy);
- }
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)(10*TEST_SIZE)/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
- printf("\n");
-
- printf("Blitter speed test (scan enabled)...");
- *pVGA_ctrl |= SYS_VGA_BIT_MSTEN;
- sleep(500);
- *pVGA_src0 = (UINT32)pSrc32;
- *pVGA_dst = (UINT32)pDst32;
- *pVGA_dimx_src0 = (UINT32)0;
- *pVGA_dimx_dst = (UINT32)0;
- *pVGA_nx = (UINT32)TEST_SIZE/4 - 1;
- *pVGA_ny = (UINT32)0;
-
- start = clock();
- for (i=0; i < 10; i++)
- {
- _g_blitter_rdy = 0;
- *pVGA_ctrl |= SYS_VGA_BIT_BLIT_REQ;
- while (!_g_blitter_rdy);
- }
- end = clock();
- printf("done (%.2f MByte/s)\n", (double)(10*TEST_SIZE)/(1024*1024*(double)(end-start)/CLOCKS_PER_SEC));
- printf("\n");
- *pVGA_ctrl &= ~SYS_VGA_BIT_MSTEN;
- *pVGA_ctrl &= ~SYS_VGA_BIT_BLIT_FIN_INTEN;
- interrupt_disable(5);
-
- size = 0x2000;
- memcpy(pDst32, (UINT32*)pROM, size);
- printf("Verify boot ROM...");
- for (i=size/4-1; i >= 0; i--)
- if (pDst32[i] != pROM[i])
- break;
- i++;
- if (i)
- {
- printf("failed\r\n");
- return TEST16_ERROR;
- }
- else
- printf("passed\r\n");
-
- printf("Verify FLASH(IO) <=> FLASH(MEM)...");
- if (!memcmp((UINT32*)pFlashIO, (UINT32*)pFlashMem, FLASH_SIZE))
- printf("passed\r\n");
- else
- {
- printf("failed\r\n");
- return TEST16_ERROR;
- }
-
-// memdump((UINT8*)pSrc32, 0, 16, size);
-// memdump((UINT8*)0x40000000, 0, 16, 1024);
-
- // Memtest END
- // ----------------------------------------------------------
- free(pSrc32);
- free(pDst32);
-
- sputs("\r\n");
- return 0;
-}
-
-int main (void)
-{
- int result, i, j, cnt, size;
- UINT32 volatile *pUART_baud = (UINT32*)SYS_UART_BAUD;
- UINT32 volatile *pUART_stat = (UINT32*)SYS_UART_STAT;
- UINT32 volatile *pReg = (UINT32*)SYS_LED_PORT;
- UINT32 volatile *pReg_usec = (UINT32*)SYS_TIMER_USEC;
- UINT32 volatile *pReg_sec = (UINT32*)SYS_TIMER_SEC;
- UINT32 volatile *pSSRAM = (UINT32*)SYS_SSRAM_IO;
- UINT32 volatile *pTim_ctrl = (UINT32*)SYS_ITIM_CTRL;
- UINT32 volatile *pTim_stat = (UINT32*)SYS_ITIM_STAT;
- UINT32 volatile *pTim0_cnt = (UINT32*)SYS_ITIM0_CNT;
- UINT32 volatile *pTim0_cmp = (UINT32*)SYS_ITIM0_CMP;
- UINT32 volatile *pTim1_cnt = (UINT32*)SYS_ITIM1_CNT;
- UINT32 volatile *pTim1_cmp = (UINT32*)SYS_ITIM1_CMP;
- UINT32 volatile *pVGA_cgcol = (UINT32*)SYS_VGA_CGCOL;
- UINT32 volatile *pFlashPicture = (UINT32*)(SYS_FLASH_MEM + 0x00600000);
-
- UINT32 volatile *pVGA_src0 = (UINT32*)SYS_VGA_BLIT_SRC0;
- UINT32 volatile *pVGA_dst = (UINT32*)SYS_VGA_BLIT_DST;
- UINT32 volatile *pVGA_dimx_src0 = (UINT32*)SYS_VGA_BLIT_SRC0_DIMX;
- UINT32 volatile *pVGA_dimx_dst = (UINT32*)SYS_VGA_BLIT_DST_DIMX;
- UINT32 volatile *pVGA_nx = (UINT32*)SYS_VGA_BLIT_NX;
- UINT32 volatile *pVGA_ny = (UINT32*)SYS_VGA_BLIT_NY;
- UINT32 volatile *pVGA_ctrl = (UINT32*)SYS_VGA_CTRL;
- UINT32 volatile *pVGA_moffs_0 = (UINT32*)SYS_VGA_FB_FRONT;
-
- UINT32 screen_res_x, screen_res_y, screen_fps;
- UINT64 *pBuf64_0, *pBuf64_1;
- time_t curr_date;
- struct tm *pDate, date;
- UINT32 start, end;
- char sel[80];
- struct timeval time_sec;
-
-
- g_cnt = 1;
- Screen_clr();
-
- *pVGA_cgcol = 0x00FFFFFF;
-
- *pTim0_cnt = 0;
- *pTim1_cnt = 0;
- *pTim0_cmp = 0x4000;
- *pTim1_cmp = 100000000;
- *pTim_stat = (1 << 2) | (1 << 0);
- *pTim_ctrl = (3 << 2);
-
-// *pUART_baud = 1;
-
- setbuf(stdout, NULL);
- PrintCPUinfo();
-
- interrupt_register(3, handler3);
- fprintf(stderr, "UART interrupt registered.\n");
-
- interrupt_register(7, handler7);
- fprintf(stderr, "Timer interrupt registered.\n");
-
- calibrate_delay();
-
- printf("\n");
-
- printf("Aktuelles Datum\n");
- curr_date = time(NULL);
- pDate = gmtime(&curr_date);
- puts(asctime(pDate));
-
- if (curr_date < 2)
- {
- printf("Datum und Uhrzeit setzen? [j/N]: ");
- scanf("%s", sel);
- if (toupper(sel[0]) == 'J')
- {
- do
- {
- printf("Datum\n");
- printf("Jahr : ");
- scanf("%d", &date.tm_year);
- printf("Monat : ");
- scanf("%d", &date.tm_mon);
- printf("Tag : ");
- scanf("%d", &date.tm_mday);
-
- printf("Uhrzeit\n");
- printf("Stunde : ");
- scanf("%d", &date.tm_hour);
- printf("Minute : ");
- scanf("%d", &date.tm_min);
- printf("Sekunde : ");
- scanf("%d", &date.tm_sec);
-
- date.tm_year -= 1900;
- date.tm_mon -= 1;
- time_sec.tv_sec = mktime(&date);
- time_sec.tv_usec = 0;
- settimeofday(&time_sec, NULL);
-
- printf("Datum\n");
- curr_date = time(NULL);
- pDate = gmtime(&curr_date);
- puts(asctime(pDate));
- printf("\nOK? [J/n]: ");
- scanf("%s", sel);
- printf("sel=%d\n", (int)sel[0]);
-
-
- } while(toupper(sel[0]) == 'N');
- }
- }
- srand(clock());
- *pReg = uncached_cachemiss_bug();
- Test16_MemTest();
-
- printf("pf = %08X\n", (UINT32)pf());
- *pf() = 0x1234;
- printf("*pf = %08X\n", (UINT32)*pf());
-
- box_create(&box, 32, 32);
- GFX_init(&gfx);
-
- start = clock();
- for (i=0; i < 100000; i++)
- {
- GFX_box_draw_direct(&gfx, &box, (UINT32)rand()%800, (UINT32)rand()%600, (UINT32)rand());
- }
-
- end = clock();
- printf("Fillrate %f rect/s\n", (float)i/((float)(end-start)/CLOCKS_PER_SEC));
- sleep(2000);
-
- GFX_frame(&gfx, GFX_FRAME_SYNC);
- GFX_set_background(&gfx, pFlashPicture, 800, 600, 1, 1);
- posx = posy = 0;
- GFX_show(&gfx);
-
-// while(1)
- {
- // Blitter test
- fprintf(stderr, "Blit start\n");
- *pVGA_src0 = (UINT32)*pFlashPicture;
- *pVGA_dst = (UINT32)*pVGA_moffs_0;
- *pVGA_dimx_src0 = (UINT32)4*800;
- *pVGA_dimx_dst = (UINT32)4*800;
- *pVGA_nx = (UINT32)800 - 1;
- *pVGA_ny = (UINT32)600 - 1;
- *pVGA_ctrl |= SYS_VGA_BIT_BLIT_REQ;
- while (*pVGA_ctrl & SYS_VGA_BIT_BLIT_BSY);
-
- fprintf(stderr, "Blit end\n");
- sleep(250);
-
- // Blitter test
- fprintf(stderr, "Blit start\n");
- *pVGA_src0 = (UINT32)gfx.pBG;
- *pVGA_dst = (UINT32)*pVGA_moffs_0;
- *pVGA_dimx_src0 = (UINT32)4*800;
- *pVGA_dimx_dst = (UINT32)4*800;
- *pVGA_nx = (UINT32)800 - 1;
- *pVGA_ny = (UINT32)600 - 1;
- *pVGA_ctrl |= SYS_VGA_BIT_BLIT_REQ;
- while (*pVGA_ctrl & SYS_VGA_BIT_BLIT_BSY);
-
- fprintf(stderr, "Blit end\n");
- sleep(1000);
- }
-
-
- interrupt_enable(7);
- interrupt_enable(3);
- *pTim_ctrl |= 3;
- *pUART_stat |= (1 << 6);
-
- cnt = 0;
- while (1)
- {
- for (i=0; i < 100000; i++)
- {
- interrupt_disable(7);
- }
- for (i=0; i < 100000; i++)
- {
- interrupt_enable(7);
- }
-
- *pReg = cnt & 0x3FFFFFFF;
-
- printf("-------------------------------------------\n");
- printf("-- LoadStore ------------------------------\n");
- printf("-------------------------------------------\n");
- result = Test10_LoadStore();
- if (IS_ERROR(result))
- break;
- printf("passed\n\n");
-
- printf("-------------------------------------------\n");
- printf("-- AddSub ---------------------------------\n");
- printf("-------------------------------------------\n");
- result = Test11_AddSub();
- if (IS_ERROR(result))
- break;
- printf("passed\n\n");
-
- printf("-------------------------------------------\n");
- printf("-- MulDiv ---------------------------------\n");
- printf("-------------------------------------------\n");
- result = Test12_MulDiv();
- if (IS_ERROR(result))
- break;
- printf("passed\n\n");
-
- printf("-------------------------------------------\n");
- printf("-- Cop0 LWZ0 and SWC0 ---------------------\n");
- printf("-------------------------------------------\n");
- result = Test13_COP0_Load_Store();
- if (IS_ERROR(result))
- break;
- printf("passed\n\n");
-
- printf("-------------------------------------------\n");
- printf("-- D-Cache invalidate ---------------------\n");
- printf("-------------------------------------------\n");
- result = Test14_DCACHE_invalidate();
- if (IS_ERROR(result))
- break;
- printf("passed\n\n");
-
- printf("-------------------------------------------\n");
- printf("-- PI calc --------------------------------\n");
- printf("-------------------------------------------\n");
- result = Test15_pi_calc();
- if (IS_ERROR(result))
- break;
- printf("passed\n\n");
-
- printf("-------------------------------------------\n");
- printf("-- Paranoia -------------------------------\n");
- printf("-------------------------------------------\n");
- paranoia(1, NULL);
- printf("passed\n\n");
-
-// printf("-------------------------------------------\n");
-// printf("-- Mem Test -------------------------------\n");
-// printf("-------------------------------------------\n");
-// result = Test16_MemTest();
-// if (IS_ERROR(result))
-// break;
-// printf("passed\n\n");
-
- printf("Iteration %d: Passed\n", cnt);
- curr_date = time(NULL);
- pDate = gmtime(&curr_date);
- puts(asctime(pDate));
- cnt++;
- *pTim0_cmp = 0x4000 + (UINT32)(rand() & 0x00FFFFFF);
- *pTim_ctrl |= 1;
-
-// printf("V=%.17e\n", pow((double)cnt-1, (double)cnt));
- }
- *pReg = 0x40000000 | cnt;
- fprintf(stderr, "Failed with error %8.8X\n", result);
-
- return 1;
-
-}
-
diff --git a/lib/CPUs/MIPS/bsp/examples/testlibusb.c b/lib/CPUs/MIPS/bsp/examples/testlibusb.c
deleted file mode 100644
index 5b48601..0000000
--- a/lib/CPUs/MIPS/bsp/examples/testlibusb.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/* testlibusb.c */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include "tiffio.h"
-
-
-#define BUFLEN (256*1024)
-#define FLASHSIZE (2*1024*1024)
-int main(int argc, char *argv[])
-{
- char *pBuf;
- int ret, i, xfer_cnt, filesize, size;
- char string[256];
- double start, end;
- struct timeval t;
- FILE *pFile;
- TIFF *pTif;
- ttag_t config, photometric;
- uint16 nSamples, nBits;
- uint32 width, height;
- uint32* raster;
-
- typedef struct _scmd_t
- {
- unsigned sync;
- unsigned code;
- unsigned len;
- } cmd_t;
-
- cmd_t cmd_read = {0xC24755AA, 2, BUFLEN};
- cmd_t cmd_write = {0xC24755AA, 1, BUFLEN};
- cmd_t cmd_flash_read = {0xC24755AA, 3, FLASHSIZE};
- cmd_t cmd_flash_write = {0xC24755AA, 4, FLASHSIZE};
-
- libusb_context *pCtx;
- libusb_device_handle *handle;
- size_t cnt;
-
- ret = libusb_init(&pCtx);
- if (ret != LIBUSB_SUCCESS)
- {
- printf("Error %08X\n", ret);
- return 1;
- }
-
- libusb_set_debug(pCtx, 3);
-
- handle = libusb_open_device_with_vid_pid (pCtx, 0x04B4, 0x7200);
- if (!handle)
- {
- printf("Error on opening device\n");
- return 1;
- }
-
- pBuf = (char*)malloc(BUFLEN);
- memset(pBuf, 0, BUFLEN);
-
- // ------------------------------------------------------
- printf("Send command\n");
- // ------------------------------------------------------
- ret = libusb_bulk_transfer (handle, 0x01, (char*)&cmd_write, sizeof(cmd_t), &xfer_cnt, 5000);
- if (ret != LIBUSB_SUCCESS)
- {
- printf("Error %08X\n", ret);
- return 1;
- }
- gettimeofday(&t, NULL);
- start = t.tv_sec + 1E-6*t.tv_usec;
- ret = libusb_bulk_transfer(handle, 0x01, (char*)pBuf, cmd_write.len, &xfer_cnt, 5000);
- size = xfer_cnt;
- gettimeofday(&t, NULL);
- end = t.tv_sec + 1E-6*t.tv_usec;
- if (ret != LIBUSB_SUCCESS)
- {
- printf("Error %08X\n", ret);
- return 1;
- }
- printf("Sent %d bytes\n", size);
- printf("Data rate: %.2f kbyte/s\n", (double)size/(1024*(end-start)));
-
- // ------------------------------------------------------
- printf("Read command\n");
- // ------------------------------------------------------
- ret = libusb_bulk_transfer(handle, 0x01, (char*)&cmd_read, sizeof(cmd_t), &xfer_cnt, 5000);
- if (ret != LIBUSB_SUCCESS)
- {
- printf("Error %08X\n", ret);
- return 1;
- }
- gettimeofday(&t, NULL);
- start = t.tv_sec + 1E-6*t.tv_usec;
- ret = libusb_bulk_transfer(handle, 0x82, (char*)pBuf, cmd_read.len, &xfer_cnt, 5000);
- size = xfer_cnt;
- gettimeofday(&t, NULL);
- end = t.tv_sec + 1E-6*t.tv_usec;
- if (ret != LIBUSB_SUCCESS)
- {
- printf("Error %08X\n", ret);
- return 1;
- }
- printf("Received %d bytes\n", size);
- printf("Data rate: %.2f kbyte/s\n", (double)size/(1024*(end-start)));
- free(pBuf);
-
- // ------------------------------------------------------
- printf("Read Flash\n");
- // ------------------------------------------------------
- pBuf = (char*)malloc(FLASHSIZE);
- memset(pBuf, 0, FLASHSIZE);
- ret = libusb_bulk_transfer(handle, 0x01, (char*)&cmd_flash_read, sizeof(cmd_t), &xfer_cnt, 5000);
- if (ret != LIBUSB_SUCCESS)
- {
- printf("Error %08X\n", ret);
- return 1;
- }
-
- gettimeofday(&t, NULL);
- start = t.tv_sec + 1E-6*t.tv_usec;
- ret = libusb_bulk_transfer(handle, 0x82, (char*)pBuf, cmd_flash_read.len, &xfer_cnt, 500000);
- size = xfer_cnt;
- gettimeofday(&t, NULL);
- end = t.tv_sec + 1E-6*t.tv_usec;
- if (ret != LIBUSB_SUCCESS)
- {
- printf("Error %08X\n", ret);
- return 1;
- }
- printf("Received %d bytes\n", size);
- printf("Data rate: %.2f kbyte/s\n", (double)size/(1024*(end-start)));
-
- pFile = fopen("./flash.bin", "wb");
- fwrite(pBuf, 1, size, pFile);
- fclose(pFile);
- free(pBuf);
-
- if (argc > 1)
- {
- // ------------------------------------------------------
- printf("Write Flash (File = %s)\n", argv[1]);
- // ------------------------------------------------------
- pTif = TIFFOpen(argv[1],"r");
- if (!pTif)
- {
- printf("Unable to open TIFF-file!\n");
- return 1;
- }
- ret = TIFFGetField(pTif, TIFFTAG_IMAGEWIDTH, &width);
- ret = TIFFGetField(pTif, TIFFTAG_IMAGELENGTH, &height);
-
- printf("TIFFTAG_IMAGEWIDTH = %d\n", width);
- printf("TIFFTAG_IMAGELENGTH = %d\n", height);
-
- filesize = width * height * sizeof (uint32);
-
- raster = (uint32*) _TIFFmalloc(filesize);
- if (raster != NULL)
- {
- ret = TIFFReadRGBAImageOriented(pTif, width, height, raster, ORIENTATION_TOPLEFT, 0);
- if (!ret)
- {
- printf("Unable to reading TIFF-file!\n");
- return 1;
- }
- }
- TIFFClose(pTif);
-
- printf ("File size = %d\n", filesize);
- if (filesize > FLASHSIZE)
- {
- printf("Cannot write flash: image to large!\n");
- return 1;
- }
-
- cmd_flash_write.len = filesize;
- ret = libusb_bulk_transfer(handle, 0x01, (char*)&cmd_flash_write, sizeof(cmd_t), &xfer_cnt, 5000);
- if (ret != LIBUSB_SUCCESS)
- {
- printf("Error %08X\n", ret);
- return 1;
- }
-
- gettimeofday(&t, NULL);
- start = t.tv_sec + 1E-6*t.tv_usec;
- size = 0;
- ret = libusb_bulk_transfer(handle, 0x01, (char*)raster, filesize, &xfer_cnt, 500000);
- if (ret != LIBUSB_SUCCESS)
- {
- printf("Error %08X\n", ret);
- return 1;
- }
- size += xfer_cnt;
- gettimeofday(&t, NULL);
- end = t.tv_sec + 1E-6*t.tv_usec;
- printf("Sent %d bytes\n", size);
- printf("Data rate: %.2f kbyte/s\n", (double)size/(1024*(end-start)));
-
- _TIFFfree(raster);
-
- }
-
- libusb_close(handle);
- libusb_exit(pCtx);
- return 0;
-
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/ucb.c b/lib/CPUs/MIPS/bsp/examples/ucb.c
deleted file mode 100644
index d3b9a82..0000000
--- a/lib/CPUs/MIPS/bsp/examples/ucb.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "libsys.h"
-
-int uncached_cachemiss_bug(UINT32* pMem)
-{
- UINT32 result;
-
- pMem[0] = 0x12345678;
- pMem[1] = 0xFFFFFFFF;
-
- DCACHE_invalidate_all();
-
- __asm__
- (
- "lui $s0, 0xA000\n"
- "lw $a0, 32($s0)\n"
- "or $s1, $a0, $0\n"
- "or $a2, $0, $0\n"
- "addiu $a2, 1\n"
- "sw $a2, 32($s0)\n"
-// "lw $a1, 0(%[pMem])\n"
- "lw $a0, 32($s0)\n"
- "lw $a2, 4(%[pMem])\n"
- "lw $a1, 0(%[pMem])\n"
- "nop\n"
- "sw $s1, 8($s0)\n"
- "or %[val], $a0, $0\n"
- : [val] "=r" (result)
- : [pMem] "r" (pMem)
- : "a0", "a1", "a2", "s0", "s1"
- );
- return result;
-}
-
-int main()
-{
- UINT32 volatile *pLed = (UINT32*)SYS_LED_PORT;
- int buf[256], res;
-
- res = uncached_cachemiss_bug(buf);
- *pLed = res;
-
- return res;
-
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/whet.c b/lib/CPUs/MIPS/bsp/examples/whet.c
deleted file mode 100644
index d939910..0000000
--- a/lib/CPUs/MIPS/bsp/examples/whet.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * @(#)whet.c 1.1
- */
-
-/*
- * Whetstone benchmark in C. This program is a translation of the
- * original Algol version in "A Synthetic Benchmark" by H.J. Curnow
- * and B.A. Wichman in Computer Journal, Vol 19 #1, February 1976.
- *
- * Used to test compiler optimization and floating point performance.
- */
-
-/*
- * Compile with -DMEASURE_TIME for time measurement.
- *
- * Compile with -DPOUT to print intermediate results.
- * Running this benchmark without printing the intermediate results is
- * contrary to the authors' intentions! But using serial I/O can draw back
- * the performance extremely when low baud rate communication is used.
- */
-#define MEASURE_TIME 1
-//#define POUT 1
-
-#define ITERATIONS 10 /* 10 Million Whetstone instructions */
-
-#include
-#include
-
-#ifdef MEASURE_TIME
-#include
-unsigned long Begin_Time,End_Time,Total_Time;
-double whetstones;
-#endif
-
-#define Pout(n, j, k, x1, x2, x3, x4) pout(n, j, k, x1, x2, x3, x4);
-
-double xx1, xx2, xx3, xx4, x, y, z, t, t1, t2;
-double e1[4];
-unsigned int i, j, k, l, n1, n2, n3, n4, n6, n7, n8, n9, n10, n11;
-
-main()
-{
- printf("\nWhetstone Benchmark\n\n");
-
- printf( "%d iterations\n", ITERATIONS );
-
-#ifdef MEASURE_TIME
- Begin_Time = clock();
-#endif
-
- /* initialize constants */
-
- t = 0.499975;
- t1 = 0.50025;
- t2 = 2.0;
-
- /* set values of module weights */
-
- n1 = 0 * ITERATIONS;
- n2 = 12 * ITERATIONS;
- n3 = 14 * ITERATIONS;
- n4 = 345 * ITERATIONS;
- n6 = 210 * ITERATIONS;
- n7 = 32 * ITERATIONS;
- n8 = 899 * ITERATIONS;
- n9 = 616 * ITERATIONS;
- n10 = 0 * ITERATIONS;
- n11 = 93 * ITERATIONS;
-
-/* MODULE 1: simple identifiers */
-
- xx1 = 1.0;
- xx2 = xx3 = xx4 = -1.0;
-
- for(i = 1; i <= n1; i += 1) {
- xx1 = ( xx1 + xx2 + xx3 - xx4 ) * t;
- xx2 = ( xx1 + xx2 - xx3 + xx4 ) * t;
- xx3 = ( xx1 - xx2 + xx3 + xx4 ) * t;
- xx4 = (-xx1 + xx2 + xx3 + xx4 ) * t;
- }
-#ifdef POUT
- Pout(n1, n1, n1, xx1, xx2, xx3, xx4);
-#endif
-
-
-/* MODULE 2: array elements */
-
- e1[0] = 1.0;
- e1[1] = e1[2] = e1[3] = -1.0;
-
- for (i = 1; i <= n2; i +=1) {
- e1[0] = ( e1[0] + e1[1] + e1[2] - e1[3] ) * t;
- e1[1] = ( e1[0] + e1[1] - e1[2] + e1[3] ) * t;
- e1[2] = ( e1[0] - e1[1] + e1[2] + e1[3] ) * t;
- e1[3] = (-e1[0] + e1[1] + e1[2] + e1[3] ) * t;
- }
-#ifdef POUT
- Pout(n2, n3, n2, e1[0], e1[1], e1[2], e1[3]);
-#endif
-
-/* MODULE 3: array as parameter */
-
- for (i = 1; i <= n3; i += 1)
- pa(e1);
-#ifdef POUT
- Pout(n3, n2, n2, e1[0], e1[1], e1[2], e1[3]);
-#endif
-
-/* MODULE 4: conditional jumps */
-
- j = 1;
- for (i = 1; i <= n4; i += 1) {
- if (j == 1)
- j = 2;
- else
- j = 3;
-
- if (j > 2)
- j = 0;
- else
- j = 1;
-
- if (j < 1 )
- j = 1;
- else
- j = 0;
- }
-#ifdef POUT
- Pout(n4, j, j, xx1, xx2, xx3, xx4);
-#endif
-
-/* MODULE 5: omitted */
-
-/* MODULE 6: integer arithmetic */
-
- j = 1;
- k = 2;
- l = 3;
-
- for (i = 1; i <= n6; i += 1) {
- j = j * (k - j) * (l -k);
- k = l * k - (l - j) * k;
- l = (l - k) * (k + j);
-
- e1[l - 2] = j + k + l; /* C arrays are zero based */
- e1[k - 2] = j * k * l;
- }
-#ifdef POUT
- Pout(n6, j, k, e1[0], e1[1], e1[2], e1[3]);
-#endif
-
-/* MODULE 7: trig. functions */
-
- x = y = 0.5;
-
- for(i = 1; i <= n7; i +=1) {
- x = t * atan(t2*sin(x)*cos(x)/(cos(x+y)+cos(x-y)-1.0));
- y = t * atan(t2*sin(y)*cos(y)/(cos(x+y)+cos(x-y)-1.0));
- }
-#ifdef POUT
- Pout(n7, j, k, x, x, y, y);
-#endif
-
-/* MODULE 8: procedure calls */
-
- x = y = z = 1.0;
-
- for (i = 1; i <= n8; i +=1)
- p3(x, y, &z);
-#ifdef POUT
- Pout(n8, j, k, x, y, z, z);
-#endif
-
-/* MODULE9: array references */
-
- j = 1;
- k = 2;
- l = 3;
-
- e1[0] = 1.0;
- e1[1] = 2.0;
- e1[2] = 3.0;
-
- for(i = 1; i <= n9; i += 1)
- p0();
-#ifdef POUT
- Pout(n9, j, k, e1[0], e1[1], e1[2], e1[3]);
-#endif
-
-/* MODULE10: integer arithmetic */
-
- j = 2;
- k = 3;
-
- for(i = 1; i <= n10; i +=1) {
- j = j + k;
- k = j + k;
- j = k - j;
- k = k - j - j;
- }
-#ifdef POUT
- Pout(n10, j, k, xx1, xx2, xx3, xx4);
-#endif
-
-/* MODULE11: standard functions */
-
- x = 0.75;
- for(i = 1; i <= n11; i +=1)
- x = sqrt( exp( log(x) / t1));
-
-#ifdef POUT
- Pout(n11, j, k, x, x, x, x);
-#endif
-
-#ifdef MEASURE_TIME
- End_Time = clock();
-
- Total_Time = End_Time - Begin_Time; /* in 1/ seconds */
-
- whetstones = (1e5 * ITERATIONS * CLOCKS_PER_SEC) / Total_Time;
- printf("\nWhetstone runs in %ld clock ticks (%d). %ld Kwhets/second\n",
- Total_Time, CLOCKS_PER_SEC, (long) whetstones / 1000 );
-#endif
-}
-
-pa(e)
-double e[4];
-{
- register int j;
-
- j = 0;
- lab:
- e[0] = ( e[0] + e[1] + e[2] - e[3] ) * t;
- e[1] = ( e[0] + e[1] - e[2] + e[3] ) * t;
- e[2] = ( e[0] - e[1] + e[2] + e[3] ) * t;
- e[3] = ( -e[0] + e[1] + e[2] + e[3] ) / t2;
- j += 1;
- if (j < 6)
- goto lab;
-}
-
-p3(x, y, z)
-double x, y, *z;
-{
- x = t * (x + y);
- y = t * (x + y);
- *z = (x + y) /t2;
-}
-
-p0()
-{
- e1[j] = e1[k];
- e1[k] = e1[l];
- e1[l] = e1[j];
-}
-
-#ifdef POUT
-pout(n, j, k, x1, x2, x3, x4)
-unsigned int n, j, k;
-double x1, x2, x3, x4;
-{
- printf("%5u %5u %5u %11.3e %11.3e %11.3e %11.3e\n",
- n, j, k, x1, x2, x3, x4);
-}
-#endif
diff --git a/lib/CPUs/MIPS/bsp/examples/xcpt.c b/lib/CPUs/MIPS/bsp/examples/xcpt.c
deleted file mode 100644
index a6eca43..0000000
--- a/lib/CPUs/MIPS/bsp/examples/xcpt.c
+++ /dev/null
@@ -1,139 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include "libsys.h"
-#include "xcpt.h"
-#include "irq.h"
-
-static fp_xcpt_t g_xcpt_handler[MAX_NUM_XCPT] = {NULL};
-
-char *_xcpt_code_str[MAX_NUM_XCPT] =
-{
- "Int", "Mod", "TLBL", "TLBS", "AdEL", "AdES", "IBE", "DBE",
- "Sys", "Bp", "RI", "CpU", "Ov", "Tr", "NCD/VCEI", "MC/FPE",
- "Res(16)", "Res(17)", "Res(18)", "Res(19)", "Res(20)", "Res(21)", "Res(22)", "WATCH",
- "Res(24)", "Res(25)", "Res(26)", "Res(27)", "Res(28)", "Res(29)", "Res(30)", "VCED"
- };
-
-void xcpt_register(int xcpt_num, fp_xcpt_t fp)
-{
- if ((xcpt_num >= Mod) && (xcpt_num <= VCED))
- g_xcpt_handler[xcpt_num] = fp;
-
-}
-
-int _xcpt_dispatch(struct xcptcontext * xcp)
-{
- int xcpt_code, result, i;
-
- xcpt_code = ((0xFF & xcp->cr) >> 2);
-
- result = XCPT_ERR_NOTHANDLED;
- switch(xcpt_code)
- {
- case Int:
- result = _irq_dispatch(xcp);
- break;
-
- default:
- if (g_xcpt_handler[xcpt_code])
- {
- result = (g_xcpt_handler[xcpt_code])(xcp);
- }
- break;
- }
- return result;
-}
-
-int _xcpt_deliver(struct xcptcontext * _xcp)
-{
-
- int exc_code;
- volatile int *pInstr;
-
- /* This function gets called by the low-level exception handler. */
- if (_xcpt_dispatch(_xcp) == XCPT_ERR_NOTHANDLED)
- {
- sputs("\n");
- PRINT_REG(" Status : ", _xcp->sr);
- PRINT_REG(" Cause : ", _xcp->cr);
- PRINT_REG(" EPC : ", _xcp->epc);
- PRINT_REG("BadAddr : ", _xcp->baddr);
- sputs("\n");
- PRINT_REG(" MDLO : ", _xcp->mdlo);
- PRINT_REG(" MDHI : ", _xcp->mdhi);
-
- sputs("\n");
-
- sputs("Registers:\n");
- PRINT_REG(" 0 (ze) : ", _xcp->regs[0]);
- PRINT_REG(" 1 (at) : ", _xcp->regs[1]);
- PRINT_REG(" 2 (v0) : ", _xcp->regs[2]);
- PRINT_REG(" 3 (v1) : ", _xcp->regs[3]);
- sputs("\n");
- PRINT_REG(" 4 (a0) : ", _xcp->regs[4]);
- PRINT_REG(" 5 (a1) : ", _xcp->regs[5]);
- PRINT_REG(" 6 (a2) : ", _xcp->regs[6]);
- PRINT_REG(" 7 (a3) : ", _xcp->regs[7]);
- sputs("\n");
- PRINT_REG(" 8 (t0) : ", _xcp->regs[8]);
- PRINT_REG(" 9 (t1) : ", _xcp->regs[9]);
- PRINT_REG("10 (t2) : ", _xcp->regs[10]);
- PRINT_REG("11 (t3) : ", _xcp->regs[11]);
- sputs("\n");
- PRINT_REG("12 (t4) : ", _xcp->regs[12]);
- PRINT_REG("13 (t5) : ", _xcp->regs[13]);
- PRINT_REG("14 (t6) : ", _xcp->regs[14]);
- PRINT_REG("15 (t7) : ", _xcp->regs[15]);
- sputs("\n");
- PRINT_REG("16 (s0) : ", _xcp->regs[16]);
- PRINT_REG("17 (s1) : ", _xcp->regs[17]);
- PRINT_REG("18 (s2) : ", _xcp->regs[18]);
- PRINT_REG("19 (s3) : ", _xcp->regs[19]);
- sputs("\n");
- PRINT_REG("20 (s4) : ", _xcp->regs[20]);
- PRINT_REG("21 (s5) : ", _xcp->regs[21]);
- PRINT_REG("22 (s6) : ", _xcp->regs[22]);
- PRINT_REG("23 (s7) : ", _xcp->regs[23]);
- sputs("\n");
- PRINT_REG("24 (t8) : ", _xcp->regs[24]);
- PRINT_REG("25 (t9) : ", _xcp->regs[25]);
- PRINT_REG("26 (k0) : ", _xcp->regs[26]);
- PRINT_REG("27 (k1) : ", _xcp->regs[27]);
- sputs("\n");
- PRINT_REG("28 (gp) : ", _xcp->regs[28]);
- PRINT_REG("29 (sp) : ", _xcp->regs[29]);
- PRINT_REG("30 (fp) : ", _xcp->regs[30]);
- PRINT_REG("31 (ra) : ", _xcp->regs[31]);
- sputs("\n");
- sputs("\n");
-
- exc_code = (_xcp->cr >> 2) & 0x1F;
-
- sputs("Unhandled exception <");
- sputs(_xcpt_code_str[exc_code]);
- sputs("> at PC : ");
-
- if (_xcp->cr & 0x80000000)
- {
- pInstr = (int*)(_xcp->epc + 4);
- }
- else
- {
- pInstr = (int*)(_xcp->epc);
- }
- print_word((int)pInstr);
- sputs("\n");
-
- sputs("Instruction at exception address : ");
- print_word(*pInstr);
- sputs("\n");
-
- sputs("Terminate.\n");
- _exit(exc_code);
- }
-
- return 0;
-}
diff --git a/lib/CPUs/MIPS/bsp/examples/xcpt.h b/lib/CPUs/MIPS/bsp/examples/xcpt.h
deleted file mode 100644
index 7958912..0000000
--- a/lib/CPUs/MIPS/bsp/examples/xcpt.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef XCPT_H
-#define XCPT_H
-
-#define MAX_NUM_XCPT 32
-#define XCPT_ERR_NOTHANDLED 0x80000000
-
-typedef enum
-{
- Int = 0, Mod = 1, TLBL = 2, TLBS = 3, AdEL = 4, AdES = 5,
- IBE = 6, DBE = 7, Syscall = 8, Bp = 9, RI = 10, CpU = 11,
- Ov = 12, TRAP = 13, VCEI = 14, FPE = 15, C2E = 16, Watch = 23, VCED = 31
-
-} EXCEPTION_CODE;
-
-typedef unsigned int reg_t;
-
-typedef struct xcptcontext
-{
- /* This is the exception context frame that is passed to the exception
- handlers. It gets filled in by the low-level exception handler in
- "machine.S". An assembler version of this structure can be found at the
- bottom of "machine.H".*/
- reg_t sr; /* Status Register */
- reg_t cr; /* Cause Register */
- reg_t epc; /* PC at time of exception. */
- reg_t baddr;
- reg_t regs[32]; /* Copy of all general purpose registers */
- reg_t mdlo; /* HI/LO registers (used for memory management) */
- reg_t mdhi;
- reg_t count; /* Timer registers */
- reg_t compare;
- struct xcptcontext * prev; /* To link exceptions. (unused for now) */
- unsigned xclass; /* Priority class of this exception. (unused for now). */
-
-} EXCEPTION_CONTEXT;
-
-typedef int (*fp_xcpt_t)(struct xcptcontext * xcp);
-
-#define PRINT_REG(tag_str, reg) \
- sputs(tag_str); \
- print_word(reg); \
- sputs(" ");
-
-
-#define PRINT_REG_CHG(tag_str, reg, chg_tag) \
- sputs(tag_str); \
- print_word(reg); \
- sputs(chg_tag); \
- sputs(" ");
-
-
-// Public functions
-void xcpt_register(int xcpt_num, fp_xcpt_t fp);
-
-#endif // XCPT_H
diff --git a/lib/CPUs/MIPS/bsp/examples/xcpt_asm.h b/lib/CPUs/MIPS/bsp/examples/xcpt_asm.h
deleted file mode 100644
index 5735422..0000000
--- a/lib/CPUs/MIPS/bsp/examples/xcpt_asm.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef XCPT_ASM_H
-#define XCPT_ASM_H
-
-/* LEAF - declare leaf routine */
-#define LEAF(symbol) \
- .globl symbol; \
- .align 2; \
- .type symbol, @function; \
- .ent symbol, 0; \
-symbol: .frame sp, 0, ra
-
-/* END - mark end of function */
-#define END(function) \
- .end function; \
- .size function, .-function
-
-/* Exception stack size */
-#define XCP_SIZE 32768
-
-/* save location for registers */
-#define XCP_SR 0
-#define XCP_CR 4
-#define XCP_EPC 8
-#define XCP_BADDR 12
-#define XCP_ZERO 16
-#define XCP_AT 20
-#define XCP_V0 24
-#define XCP_V1 28
-#define XCP_A0 32
-#define XCP_A1 36
-#define XCP_A2 40
-#define XCP_A3 44
-#define XCP_T0 48
-#define XCP_T1 52
-#define XCP_T2 56
-#define XCP_T3 60
-#define XCP_T4 64
-#define XCP_T5 68
-#define XCP_T6 72
-#define XCP_T7 76
-#define XCP_S0 80
-#define XCP_S1 84
-#define XCP_S2 88
-#define XCP_S3 92
-#define XCP_S4 96
-#define XCP_S5 100
-#define XCP_S6 104
-#define XCP_S7 108
-#define XCP_T8 112
-#define XCP_T9 116
-#define XCP_JP 116
-#define XCP_K0 120
-#define XCP_K1 124
-#define XCP_GP 128
-#define XCP_SP 132
-#define XCP_S8 136
-#define XCP_FP 136
-#define XCP_RA 140
-#define XCP_MDLO 144
-#define XCP_MDHI 148
-#define XCP_COUNT 152
-#define XCP_COMPARE 156
-#define XCP_PREV 160
-#define XCP_CLASS 164
-
-
-#endif /* XCPT_ASM_H */
diff --git a/lib/CPUs/MIPS/dist/gpl-3.0.txt b/lib/CPUs/MIPS/dist/gpl-3.0.txt
deleted file mode 100644
index 94a9ed0..0000000
--- a/lib/CPUs/MIPS/dist/gpl-3.0.txt
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/lib/CPUs/MIPS/dist/makedist.R12 b/lib/CPUs/MIPS/dist/makedist.R12
deleted file mode 100644
index 0d74ee1..0000000
--- a/lib/CPUs/MIPS/dist/makedist.R12
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-USE_TAG=MIPS_R12
-PROJECT="mips_sys"
-DIST_DIR="./release/mips.r12"
-
-echo Log for $USE_TAG >$USE_TAG.log
-
-# ---------------------------------------------------------------
-# Export files tagged for this release
-# To avoid CVS-problems with renamed files: Don't tag on per file basis.
-# => Tag upper directory then delete tag from unwanted files!!!
-
-# Release notes
-cvs export -l -d $DIST_DIR/ -r $USE_TAG VHDL/lib/CPUs/MIPS/dist >>$USE_TAG.log
-
-# VHDL files
-cvs export -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/misc >>$USE_TAG.log
-cvs export -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/uart >>$USE_TAG.log
-cvs export -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/FIFO/src >>$USE_TAG.log
-cvs export -l -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/CPUs/MIPS/src >>$USE_TAG.log
-cvs export -l -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/CPUs/MIPS/src/core >>$USE_TAG.log
-
-# Simulation files
-cvs export -l -d $DIST_DIR/sim/ -r $USE_TAG VHDL/lib/CPUs/MIPS/sim >>$USE_TAG.log
-
-# Documentation files
-cvs export -d $DIST_DIR/doc/ -r $USE_TAG VHDL/lib/CPUs/MIPS/doc >>$USE_TAG.log
-rm -f $DIST_DIR/doc/*.vsd
-
-# Tools
-cvs export -d $DIST_DIR/tools/ -r $USE_TAG VHDL/lib/CPUs/MIPS/tools >>$USE_TAG.log
diff --git a/lib/CPUs/MIPS/dist/makedist.R13 b/lib/CPUs/MIPS/dist/makedist.R13
deleted file mode 100644
index be6da72..0000000
--- a/lib/CPUs/MIPS/dist/makedist.R13
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-USE_TAG=MIPS_R13
-PROJECT="mips_sys"
-DIST_DIR="./release/mips.r13"
-
-echo Log for $USE_TAG >$USE_TAG.log
-
-# ---------------------------------------------------------------
-# Export files tagged for this release
-# To avoid CVS-problems with renamed files: Don't tag on per file basis.
-# => Tag upper directory then delete tag from unwanted files!!!
-
-# Release notes
-cvs export -l -d $DIST_DIR/ -r $USE_TAG VHDL/lib/CPUs/MIPS/dist >>$USE_TAG.log
-
-# VHDL files
-cvs export -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/misc >>$USE_TAG.log
-cvs export -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/uart >>$USE_TAG.log
-cvs export -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/FIFO/src >>$USE_TAG.log
-cvs export -l -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/CPUs/MIPS/src >>$USE_TAG.log
-cvs export -l -d $DIST_DIR/src/ -r $USE_TAG VHDL/lib/CPUs/MIPS/src/core >>$USE_TAG.log
-
-# Simulation files
-cvs export -l -d $DIST_DIR/sim/ -r $USE_TAG VHDL/lib/CPUs/MIPS/sim >>$USE_TAG.log
-
-# Documentation files
-cvs export -d $DIST_DIR/doc/ -r $USE_TAG VHDL/lib/CPUs/MIPS/doc >>$USE_TAG.log
-rm -f $DIST_DIR/doc/*.vsd
-
-# Tools
-cvs export -d $DIST_DIR/tools/ -r $USE_TAG VHDL/lib/CPUs/MIPS/tools >>$USE_TAG.log
diff --git a/lib/CPUs/MIPS/dist/notes.txt b/lib/CPUs/MIPS/dist/notes.txt
deleted file mode 100644
index 78f7c0f..0000000
--- a/lib/CPUs/MIPS/dist/notes.txt
+++ /dev/null
@@ -1,100 +0,0 @@
------------------------------------------------------------------
-Changes in release 13
------------------------------------------------------------------
-- mips_biu.vhd: added asynchronous BUS-FIFOs to support different clocks for CPU and BUS
-- mips_dcache.vhd: improved instant-RAW stall behavior (faster execution)
-- uart_WB.vhd: added simulate_TX generic for plain TX output in simulation log
-
------------------------------------------------------------------
-Changes in release 12
------------------------------------------------------------------
-- reworked GCC-toolchain: Valid mips*-elf-binaries are now compiled and linked
- using a single mips*-elf-gcc command.
- To use: Copy $THIS_RELEASE/bsp/toolchain/specs to $MIPS_GCC_PREFIX/lib/gcc/mipsel-elf/$GCC_VERSION/,
- and see bsp/examples/Makefile gcc usage
- GCC-provided crt*-functions are now called without problems.
- In summary: The toolchain is now more compliant to the intentional use of GCC.
-- mips_biu.vhd: Addresses 0xA0000000..0xBFFFFFFF are now un-dcached for memory-mapped I/O,
- which is now compliant to literature.
-- gpio_wb.vhd: Timer hard-reset is now removed. This helps to keep current time in case of CPU hard-reset.
-- new bsp-example source: gunzip
-- updated drawing 'mips_jbus_timing.pdf'
-- added drawing 'memory_map.pdf'
-- moved COP0 from mips_pipeline.vhd to mips_top.vhd. Created new cop-interface for later COPz connection.
-- added I/D-cache info (size and linesize) to upper 16 bits of PrID-Register.
- Example of reading cache info is done in bsp/examples/testbench::PrintCPUinfo()
-- simplified instruction decoder in mips_instr.vhd. Now there are less warnings during synthesis.
- Removed idecode_rom.vhd from project as consequence.
-- added cop0 instructions to invalidate I-cache and D-Cache
-- added copz instructions lwcz and swcz
-- gpio_wb.vhd: added 32 bit timer with interrupt and auto reload
-- added debugger in libsys. New files are mipsdis.c/h and dbg.c/h
-- exception handlers can now be registered to any exception type
-- bugfix mips_pipeline/mips_cop: cop0 registers were not written during exception commit. Cop registers now behave like general registers.
-- added pin 'eb' to mips_top.vhd to select CPU-endianess at reset time (eb = 0 : little-endian, eb = 1 : big-endian)
-- Status register bit 'RE'= 1 (bit 25) reverses endianess in user-mode
-- Status register bit 'TS' (TLB Shutdown, bit 21) is tied high to indicate the absence of an MMU.
-- uart_wb.vhd: added interrupt enable
-- Interrupt pending flags (IP) are not anymore masked by Interrupt mask flags (IM) in H/W.
- Masking has to be done in S/W. H/W masking was removed because it isn't MIPS-compliant.
-- added NMI/RST pin (more MIPS compliant). Transition Asserting/Deasserting causes exception.
- Exception vector is reset (0xBFC00000). It's a soft-reset, which can help debugging. NMI/RST is not maskable.
- Using NMI/RST as reset is dangerous because periphery may not be reseted. Has to be done in S/W.
- Drawback of using NMI/RST: Unitialized/unreseted periphery may cause trouble (e.g. firing unwanted interrupts), but I think you know that already.
-- Bootloader: Startup.S now invalidates I/D-Caches at boot.
-- uart_wb.vhd: fixed crappy tx-empty interrupt, Added Tx-IRQ acknowledge.
-- Bugfix in mips_pipeline: register bypass with same target register, used for unaligned loads (LWL, LWR), was incorrect.
- Newlib's MIPS-optimized version of memcpy() uses this for unaligned copy which revealed the bug.
- Symptom: Consecutive load instructions without nops using same target register (which is legal) like
- lw $1, 0(mem)
- lwl $1, 1(mem)
- or
- lwl $1, 0(mem)
- lwr $1, 1(mem)
- or similar, lead to incorrect result. Now it's fixed.
-- Bugfix mips_biu: instructions uncached LW => cached LW (with cache-miss) was buggy.
- Symptom:
- ...
- 1.: lw $a0, 32($s0) # Uncached load from memory mapped I/O
- 2.: lw $a2, 4($v0) # Cached load and cache-miss.
- # $a0 receives same value as $a2.
- # CPU skips writing $a0 due to busy flag of D-Cache,
- # which is already active in the previous cycle
- ...
-
------------------------------------------------------------------
-Changes in release 11
------------------------------------------------------------------
-- bugfix in mips_pipeline: pc_is_branch is now initialized at reset
- (fixes CPU unrecoverable state after reset)
-- reverted "optimization" in mips_dcache, which behaved buggy during exceptions
-- new example source: test_exception
-- minor changes in libsys
-- added async_port_timing in doc
-- examples/testbench: date set now really works
-
------------------------------------------------------------------
-Changes in release 10b
------------------------------------------------------------------
-- bugfix: fixed compiler bug (missing nop after lw) in bootloader,
- which caused exception during boot
-
------------------------------------------------------------------
-Changes in release 10a
------------------------------------------------------------------
-async_port_wb:
-- added byte enable for async_port
-
-bootloader.c
-- bugfix: fixed compiler bug (missing nop after lw)
-
-mips-core
-- bugfix: SEL_O lines are also asserted correctly during reads
-
-tools/romgen
-- TCL-Jtag now compatible with Chipscope 10.1
-
-mips_sys.c
-- use byte enable for sram and flash
-
-
diff --git a/lib/CPUs/MIPS/doc/J-MIPS.txt b/lib/CPUs/MIPS/doc/J-MIPS.txt
deleted file mode 100644
index 43448cb..0000000
--- a/lib/CPUs/MIPS/doc/J-MIPS.txt
+++ /dev/null
@@ -1,109 +0,0 @@
------------------------------------------------------------------
-J-MIPS Features
------------------------------------------------------------------
-
-- Synchrones Design
-- Portable Beschreibung in VHDL
-- Kompatible zur GNU Toolchain (Binutils, GCC, Newlib)
-- Befehle kompatibel mit MIPS-1 ISA (z.B. MIPS R3000)
-- 5-Stufige Pipeline und Hazardvermeidung durch Forwarding
-- 64Bit Multiplier (32Bit Operanden), 12 Cycles Latenz
-- 64Bit Divider (32Bit Operanden), 36 Cycles Latenz
-- Coprocessor 0 (COP0) für Exceptionhandling
-- Direct-mapped Instruction Cache mit variabler Größe, 8-words per Line
-- Direct-mapped Data Cache mit variabler Größe, 8-words per Line
-- J-Bus kompatible Bus Interface Unit (J-Bus ist im wesentlichen FIFO interface mit 'wichtigen' Signalnamen)
-- 1,2 DMIPS/MHz mit 16Kbyte I/D-Cache (Dhrystone 2.1, GCC 4.3)
-- Endianness umschaltbar zur Hard-reset Zeit
-- Unterschiedliche Frequenzen für CPU und BUS möglich
-
------------------------------------------------------------------
-Known Limitations
------------------------------------------------------------------
-- keine MMU
-- keine Unterstützung für Bus exceptions IBE und DBE
-- kein externes Coprocessor interface (COP1..3) für z.B. FPU
-- Befehle für Cop1..3 nicht implementiert:
- CFCz, CTCz, COPz, MFCz, MTCz, LWCz, SWCz
- Benutzung dieser Befehle führt zur Exception 'RI' (Reserved Instruction)
-- nicht alle COP0 Register/Bits vorhanden.
-
------------------------------------------------------------------
-Known Bugs
------------------------------------------------------------------
-- es gibt bestimmt noch nicht entdeckte Bugs
-
------------------------------------------------------------------
-Known Optimizations
------------------------------------------------------------------
-- Area: Multiplier als technologieabhängiges Primitive instanzieren
-- Area: Auf Divider verzichten
-- Area: Auf Multiplier verzichten
-- Area vs. Speed: Bei Hazards Pipeline-stall statt Forwarding.
- Durch Stalling geringerer Befehlsdurchsatz dafür weniger Logik.
- Weniger Logik bedeutet vielleicht wieder auch größere Taktfrequenz.
-
------------------------------------------------------------------
-Known ToDos
------------------------------------------------------------------
-- Unterstützung für Bus exceptions IBE und DBE
-- Externes COP1..3 interface, fehlende COP-Befehle implementieren
-- Optimierungen evaluieren und ggf. durchführen
-
------------------------------------------------------------------
-Synthesis results
------------------------------------------------------------------
-Virtex-4 XC4VSX35-10
-
-Config: 16Kbyte I/D-Cache
-
-Number of Slices 2387 15360 15%
-Number of Slice Flip Flops 1784 30720 5%
-Number of 4 input LUTs 3962 30720 12%
-Number of FIFO16/RAMB16s 18 192 9%
-
-Speed: 110MHz nach Synthesis
-
------------------------------------------------------------------
-Virtex-1 XCV1000-4
-
-Config: 4Kbyte I/D-Cache
-
-Number of Slices 2045 13824 16%
-Number of Slice Flip Flops 1783 27648 7%
-Number of 4 input LUTs 3923 27648 15%
-Number of FIFO16/RAMB16s 20 32 62%
-
-Speed: 30MHz nach Synthesis
-
------------------------------------------------------------------
-Performance bei 100MHz
-- GCC ohne Small-data section
-- MIPS Rev. 9
------------------------------------------------------------------
-I/D-Cache Dhrystone-2.1 RipeMD-160 Whetstone Stanford Queens(12x12)
-1k 32 DMIPS 5 Mbit/s 345 kwhets/s 47/767 2,135s
-2k 51 DMIPS 5 Mbit/s 534 kwhets/s 38/561 2,134s
-4k 72 DMIPS 5 Mbit/s 623 kwhets/s 36/259 2,121s
-8k 98 DMIPS 10 Mbit/s 1149 kwhets/s 31/228 1,938s
-16k 115 DMIPS 17 Mbit/s 1234 kwhets/s 23/225 1,938s
-32k 115 DMIPS 17 Mbit/s 1285 kwhets/s 24/218 1,938s
-64k 115 DMIPS 17 Mbit/s 1285 kwhets/s 20/221 1,938s
-
------------------------------------------------------------------
-Performance bei 100MHz
-- GCC mit Small-data section
-- MIPS Rev. 9
------------------------------------------------------------------
-I/D-Cache Dhrystone-2.1 RipeMD-160 Whetstone Stanford Queens(12x12)
-16k 117 DMIPS 17 Mbit/s 1236 kwhets/s 24/230 1,811s
-
------------------------------------------------------------------
-Performance bei 100MHz
-- GCC mit Small-data section
-- MIPS Rev. 10
------------------------------------------------------------------
-I/D-Cache Dhrystone-2.1 RipeMD-160 Whetstone Stanford Queens(12x12)
-16k 120 DMIPS 17 Mbit/s 1242 kwhets/s 25/219 1,803s
-
-
diff --git a/lib/CPUs/MIPS/doc/async_port_timing.pdf b/lib/CPUs/MIPS/doc/async_port_timing.pdf
deleted file mode 100644
index 8e2a4d2..0000000
Binary files a/lib/CPUs/MIPS/doc/async_port_timing.pdf and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/memory_map.pdf b/lib/CPUs/MIPS/doc/memory_map.pdf
deleted file mode 100644
index a5f3a40..0000000
Binary files a/lib/CPUs/MIPS/doc/memory_map.pdf and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/memory_map.vsd b/lib/CPUs/MIPS/doc/memory_map.vsd
deleted file mode 100644
index 720cf6a..0000000
Binary files a/lib/CPUs/MIPS/doc/memory_map.vsd and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/mips_biu.pdf b/lib/CPUs/MIPS/doc/mips_biu.pdf
deleted file mode 100644
index 74f2564..0000000
Binary files a/lib/CPUs/MIPS/doc/mips_biu.pdf and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/mips_drawings.vsd b/lib/CPUs/MIPS/doc/mips_drawings.vsd
deleted file mode 100644
index 4da74c8..0000000
Binary files a/lib/CPUs/MIPS/doc/mips_drawings.vsd and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/mips_jbus_timing.pdf b/lib/CPUs/MIPS/doc/mips_jbus_timing.pdf
deleted file mode 100644
index ce0b05d..0000000
Binary files a/lib/CPUs/MIPS/doc/mips_jbus_timing.pdf and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/mips_pipeline.pdf b/lib/CPUs/MIPS/doc/mips_pipeline.pdf
deleted file mode 100644
index 71c529e..0000000
Binary files a/lib/CPUs/MIPS/doc/mips_pipeline.pdf and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/mips_pipeline_stages.pdf b/lib/CPUs/MIPS/doc/mips_pipeline_stages.pdf
deleted file mode 100644
index b05de04..0000000
Binary files a/lib/CPUs/MIPS/doc/mips_pipeline_stages.pdf and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/mips_sys.vsd b/lib/CPUs/MIPS/doc/mips_sys.vsd
deleted file mode 100644
index 6c62de1..0000000
Binary files a/lib/CPUs/MIPS/doc/mips_sys.vsd and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/mips_sys_ml402.pdf b/lib/CPUs/MIPS/doc/mips_sys_ml402.pdf
deleted file mode 100644
index 566ddaf..0000000
Binary files a/lib/CPUs/MIPS/doc/mips_sys_ml402.pdf and /dev/null differ
diff --git a/lib/CPUs/MIPS/doc/toolchain/howto_build.txt b/lib/CPUs/MIPS/doc/toolchain/howto_build.txt
deleted file mode 100644
index 270be3b..0000000
--- a/lib/CPUs/MIPS/doc/toolchain/howto_build.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-# ---------------------------------------------------------------
-# 1. Binutils bauen und installieren
-# ---------------------------------------------------------------
-> tar -xzf binutils-2.19.tar.gz
-> mkdir binutils-2.19_build
-> cd binutils-2.19_build
-
-> ../binutils-2.19/configure --target=mipsel-elf --prefix=/usr/local
-> make
-> make install
-
-# ---------------------------------------------------------------
-# 2. GCC bootstrapping
-# ---------------------------------------------------------------
-> tar -xzf gcc-4.3.2.tar.gz
-> mkdir gcc-4.3.2_build
-> cd gcc-4.3.2_build
-> ../gcc-4.3.2/configure --target=mipsel-elf --prefix=/usr/local --enable-languages="c,c++" --without-headers --with-newlib --with-float=soft --disable-multilib
-> CFLAGS_FOR_TARGET="-mno-gpopt" make all-gcc
-> make info-gcc
-> make install-gcc
-
-# ---------------------------------------------------------------
-# 3. Newlib bauen und installieren
-# ---------------------------------------------------------------
-> tar -xzf newlib-1.16.0.tar.gz
-! Bug in newlib-1.16.0/newlib/libc/machine/mips/strlen.c.
- Newlib von Hand patchen (32-bit MIPS targets):
- "lbu $3,0($4)\n"
- "nop\n" <= nop einfügen
- "bnez $3,1b\n"
-
-> mkdir newlib-1.16.0_build
-> cd newlib-1.16.0_build
-> ../newlib-1.16.0/configure --target=mipsel-elf --prefix=/usr/local --with-float=soft --disable-multilib
-> TARGET_CFLAGS="-mno-gpopt" make all
-> make install
-
-# ---------------------------------------------------------------
-# 4. GCC bauen und installieren
-# ---------------------------------------------------------------
-> cd gcc-4.3.2_build
-> ../gcc-4.3.2/configure --target=mipsel-elf --prefix=/usr/local --enable-languages="c,c++" --disable-shared --with-newlib --with-float=soft --disable-multilib
-> CFLAGS_FOR_TARGET="-mno-gpopt" make all
-> make info
-> make install
diff --git a/lib/CPUs/MIPS/doc/toolchain/make.sh b/lib/CPUs/MIPS/doc/toolchain/make.sh
deleted file mode 100644
index 1568da9..0000000
--- a/lib/CPUs/MIPS/doc/toolchain/make.sh
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/sh
-TARGET=mipsel-elf
-PREFIX=/usr/local
-
-SRC_BINUTILS=binutils-2.19
-SRC_GCC=gcc-4.3.3
-SRC_NEWLIB=newlib-1.16.0
-SRC_GMP=gmp-4.2.4
-SRC_MPFR=mpfr-2.4.0
-
-# ---------------------------------------------------------------
-# 1. Binutils bauen und installieren
-# ---------------------------------------------------------------
-if [ ! -e $SRC_BINUTILS.tar.bz2 ]; then
- echo Downloading $SRC_BINUTILS
- wget ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.gnu.org/binutils/$SRC_BINUTILS.tar.bz2 || exit 1
-else
- echo Skipped downloading $SRC_BINUTILS
-fi
-
-if [ ! -e ./$SRC_BINUTILS ]; then
- echo Unpacking $SRC_BINUTILS
- tar -xjf $SRC_BINUTILS.tar.bz2 || exit 1
-else
- echo Skipped unpacking $SRC_BINUTILS
-fi
-
-if [ ! -e ./$SRC_BINUTILS-build ]; then
- echo Building $SRC_BINUTILS
- mkdir -p $SRC_BINUTILS-build
- cd $SRC_BINUTILS-build
- ../$SRC_BINUTILS/configure --target=$TARGET --prefix=$PREFIX || exit 1
- make || exit 1
- make install || exit 1
- cd ..
-else
- echo $SRC_BINUTILS is already built.
-fi
-
-# ---------------------------------------------------------------
-# 2. GMP bauen und installieren
-# ---------------------------------------------------------------
-if [ ! -e $SRC_GMP.tar.bz2 ]; then
- echo Downloading $SRC_GMP
- wget http://ftp.sunet.se/pub/gnu/gmp/$SRC_GMP.tar.bz2 || exit 1
-else
- echo Skipped downloading $SRC_GMP
-fi
-
-if [ ! -e ./$SRC_GMP ]; then
- echo Unpacking $SRC_GMP
- tar -xjf $SRC_GMP.tar.bz2 || exit 1
-else
- echo Skipped unpacking $SRC_GMP
-fi
-
-if [ ! -e ./$SRC_GMP-build ]; then
- echo Building $SRC_GMP
- mkdir -p $SRC_GMP-build
- cd $SRC_GMP-build
- ../$SRC_GMP/configure --prefix=$PREFIX || exit 1
- make || exit 1
- make check || exit 1
- make install || exit 1
- cd ..
-else
- echo $SRC_GMP is already built.
-fi
-
-# ---------------------------------------------------------------
-# 3. MPFR bauen und installieren
-# ---------------------------------------------------------------
-if [ ! -e $SRC_MPFR.tar.bz2 ]; then
- echo Downloading $SRC_MPFR
- wget http://www.mpfr.org/mpfr-current/$SRC_MPFR.tar.bz2 || exit 1
-else
- echo Skipped downloading $SRC_MPFR
-fi
-
-if [ ! -e ./$SRC_MPFR ]; then
- echo Unpacking $SRC_MPFR
- tar -xjf $SRC_MPFR.tar.bz2 || exit 1
-else
- echo Skipped unpacking $SRC_MPFR
-fi
-
-if [ ! -e ./$SRC_MPFR-build ]; then
- echo Building $SRC_MPFR
- mkdir -p $SRC_MPFR-build
- cd $SRC_MPFR-build
- ../$SRC_MPFR/configure --prefix=$PREFIX || exit 1
- make || exit 1
- make check || exit 1
- make install || exit 1
- cd ..
-else
- echo $SRC_MPFR is already built.
-fi
-
-# ---------------------------------------------------------------
-# 4. GCC & newlib bauen und installieren
-# ---------------------------------------------------------------
-if [ ! -e $SRC_NEWLIB.tar.gz ]; then
- echo Downloading $SRC_NEWLIB
- wget ftp://sources.redhat.com/pub/newlib/$SRC_NEWLIB.tar.gz || exit 1
-else
- echo Skipped downloading $SRC_NEWLIB
-fi
-
-if [ ! -e ./$SRC_NEWLIB ]; then
- echo Unpacking $SRC_NEWLIB
- tar -xzf $SRC_NEWLIB.tar.gz || exit 1
- if [ -e $SRC_NEWLIB-jens.patch ]; then
- echo Patching $SRC_NEWLIB
- patch -p0 < $SRC_NEWLIB-jens.patch || exit 1
- fi
-else
- echo Skipped unpacking $SRC_NEWLIB
-fi
-
-if [ ! -e $SRC_GCC.tar.bz2 ]; then
- echo Downloading $SRC_GCC
- wget ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.gnu.org/gcc/$SRC_GCC/$SRC_GCC.tar.bz2 || exit 1
-else
- echo Skipped downloading $SRC_GCC
-fi
-
-if [ ! -e ./$SRC_GCC ]; then
- echo Unpacking $SRC_GCC
- tar -xjf $SRC_GCC.tar.bz2 || exit 1
- cd ./$SRC_GCC
- ln -sf ../$SRC_NEWLIB/newlib/ .
- cd ..
-else
- echo Skipped unpacking $SRC_GCC
-fi
-
-if [ ! -e ./$SRC_GCC-build ]; then
- echo Building $SRC_GCC
- mkdir -p $SRC_GCC-build
- cd $SRC_GCC-build
- ../$SRC_GCC/configure --target=$TARGET --prefix=$PREFIX --with-float=soft --with-newlib --verbose --enable-languages="c,c++" || exit 1
- LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PREFIX/lib make all || exit 1
- make info || exit 1
- make install || exit 1
- cd ..
- echo $PREFIX/lib >/etc/ld.so.conf.d/local.conf
- ldconfig
-else
- echo $SRC_GCC is already built.
-fi
diff --git a/lib/CPUs/MIPS/doc/toolchain/newlib-1.16.0-jens.patch b/lib/CPUs/MIPS/doc/toolchain/newlib-1.16.0-jens.patch
deleted file mode 100644
index bf61a14..0000000
--- a/lib/CPUs/MIPS/doc/toolchain/newlib-1.16.0-jens.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur newlib-1.16.0/newlib/libc/machine/mips/strlen.c newlib-1.16.0-fixed/newlib/libc/machine/mips/strlen.c
---- newlib-1.16.0/newlib/libc/machine/mips/strlen.c 2002-03-14 03:41:43.000000000 +0100
-+++ newlib-1.16.0-fixed/newlib/libc/machine/mips/strlen.c 2009-02-14 15:52:58.000000000 +0100
-@@ -60,6 +60,7 @@
- " addiu $2,$4,1\n"
- "\n"
- "1: lbu $3,0($4)\n"
-+ " nop\n"
- " bnez $3,1b\n"
- " addiu $4,$4,1\n"
- "\n"
diff --git a/lib/CPUs/MIPS/doc/toolchain/newlib-1.17.0-jens.patch b/lib/CPUs/MIPS/doc/toolchain/newlib-1.17.0-jens.patch
deleted file mode 100644
index bc28abc..0000000
--- a/lib/CPUs/MIPS/doc/toolchain/newlib-1.17.0-jens.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur newlib-1.17.0/newlib/libc/machine/mips/strlen.c newlib-1.17.0-fixed/newlib/libc/machine/mips/strlen.c
---- newlib-1.17.0/newlib/libc/machine/mips/strlen.c 2002-03-14 03:41:43.000000000 +0100
-+++ newlib-1.17.0-fixed/newlib/libc/machine/mips/strlen.c 2009-02-14 15:45:19.000000000 +0100
-@@ -60,6 +60,7 @@
- " addiu $2,$4,1\n"
- "\n"
- "1: lbu $3,0($4)\n"
-+ " nop\n"
- " bnez $3,1b\n"
- " addiu $4,$4,1\n"
- "\n"
diff --git a/lib/CPUs/MIPS/sim/ModelSim SE .lnk b/lib/CPUs/MIPS/sim/ModelSim SE .lnk
deleted file mode 100644
index d30cd7a..0000000
Binary files a/lib/CPUs/MIPS/sim/ModelSim SE .lnk and /dev/null differ
diff --git a/lib/CPUs/MIPS/sim/asm/exception.s b/lib/CPUs/MIPS/sim/asm/exception.s
deleted file mode 100644
index 20c0aaa..0000000
--- a/lib/CPUs/MIPS/sim/asm/exception.s
+++ /dev/null
@@ -1,249 +0,0 @@
- .file "exception.s"
-
- .section .kdata,"a"
- .align 2
-_k_stack: .space 256, 0
-_k_msg1: .asciiz "Exception at "
-_k_msg2: .asciiz "EPC : "
-_k_msg3: .asciiz "Cause : "
-_k_msg4: .asciiz "Status : "
-_k_msg5: .asciiz "BadVAddr : "
-_k_crlf: .asciiz "\r\n"
-_k_hextbl: .ascii "0123456789ABCDEF"
-
- .section .ktext,"ax"
- .align 2
-
- .equ LED_STAT, 0x80000000
- .equ UART_DATA, 0x80000004
- .equ UART_STAT, 0x80000008
-
- .macro kpush reg
- addiu $sp, 4
- sw \reg, 0($sp)
- .endm
-
- .macro kpop reg
- lw \reg, 0($sp)
- addiu $sp, -4
- .endm
-
-_exc_handler:
-
- sw $sp, _k_stack
- la $sp, _k_stack
- kpush $8
- kpush $9
- kpush $10
- kpush $11
- kpush $12
- kpush $31
-
- .set noreorder
- # Get BadVAddr
- mfc0 $10, $8
- kpush $10
- # Get Status
- mfc0 $10, $12
- kpush $10
- # Get Cause
- mfc0 $10, $13
- kpush $10
- srl $10, 29
- andi $11, $10, 4
- # Get EPC
- mfc0 $10, $14
- kpush $10
-
- # Get real EPC
- addu $10, $11
- kpush $10
-
- # Print CRLF
- la $11, _k_crlf
- jal _kputs
- nop
-
- # Print real EPC
- la $11, _k_msg1
- jal _kputs
- nop
- kpop $10
- jal _kprint_word
- nop
- la $11, _k_crlf
- jal _kputs
- nop
-
- # Print EPC
- la $11, _k_msg2
- jal _kputs
- nop
- kpop $10
- jal _kprint_word
- nop
- la $11, _k_crlf
- jal _kputs
- nop
-
- # Print Cause
- la $11, _k_msg3
- jal _kputs
- nop
- kpop $10
- jal _kprint_word
- nop
- la $11, _k_crlf
- jal _kputs
- nop
-
- # Print Status
- la $11, _k_msg4
- jal _kputs
- nop
- kpop $10
- jal _kprint_word
- nop
- la $11, _k_crlf
- jal _kputs
- nop
-
- # Print BadVAddr
- la $11, _k_msg5
- jal _kputs
- nop
- kpop $10
- jal _kprint_word
- nop
- la $11, _k_crlf
- jal _kputs
- nop
-
- # Set Error LED and ExcCode LEDs
- # Get Cause
- mfc0 $26, $13
- li $27, LED_STAT
- srl $26, 2
- andi $26, 0x000F
- or $26, $27
- sw $26, 0($27)
-
- # wait for exception = 0
-$w4x: mfc0 $26, $13
- nop
- srl $26, 8
- andi $26, 1
- bnez $26, $w4x
- nop
-
- # Get return address
- mfc0 $26, $14
-
- kpop $31
- kpop $12
- kpop $11
- kpop $10
- kpop $9
- kpop $8
- lw $sp, _k_stack
-
- # Return
- jr $26
- rfe
- .set reorder
-
-# word = $10
-_kprint_word:
- .set noreorder
- kpush $31
- kpush $10
- srl $10, 16
- jal _kprint_halfword
- nop
- kpop $10
- jal _kprint_halfword
- nop
- kpop $31
- jr $31
- nop
- .set noreorder
-
-# halfword = $10
-_kprint_halfword:
- .set noreorder
- kpush $31
- kpush $10
- srl $10, 8
- jal _kprint_byte
- nop
- kpop $10
- jal _kprint_byte
- nop
- kpop $31
- jr $31
- nop
- .set noreorder
-
-# byte = $10
-_kprint_byte:
- .set noreorder
- kpush $31
- kpush $10
- srl $10, 4
- jal _kprint_nibble
- nop
- kpop $10
- jal _kprint_nibble
- nop
- kpop $31
- jr $31
- nop
- .set noreorder
-
-_kprint_nibble:
- .set noreorder
- kpush $31
- kpush $10
- la $12, _k_hextbl
- andi $10, 0xF
- addu $12, $10
- lbu $10, 0($12)
- jal _ksaus
- nop
- kpop $10
- kpop $31
- jr $31
- nop
- .set noreorder
-
-# char = $10
-_ksaus:
- .set noreorder
- li $8, UART_STAT
- lbu $8, 0($8)
- li $9, UART_DATA
- andi $8, 0x02
- bnez $8, _ksaus
- nop
- j $31
- sb $10, 0($9)
- .set reorder
-
-_kputs:
- .set noreorder
- kpush $11
- kpush $31
-$kpl: lbu $10, 0($11)
- addiu $11, 1
- blez $10, $kpex
- nop
- jal _ksaus
- nop
- j $kpl
- nop
-$kpex: kpop $31
- kpop $11
- jr $31
- nop
- .set reorder
-
diff --git a/lib/CPUs/MIPS/sim/asm/faculty.c b/lib/CPUs/MIPS/sim/asm/faculty.c
deleted file mode 100644
index 5419715..0000000
--- a/lib/CPUs/MIPS/sim/asm/faculty.c
+++ /dev/null
@@ -1,96 +0,0 @@
-//#include
-//#include
-//#include
-
-int faculty(int f0, int *pDst, int len)
-{
- int i=0;
-
- pDst[i++] = f0;
-
- for (; i < len; i++)
- {
- pDst[i] = pDst[i-1] * i;
- }
-
- return i;
-}
-
-#define NUM_ELEMENTS 20
-
-void saus(char c)
-{
- volatile char *pUART_stat = (char*)0x80000008;
- volatile char *pUART_data = (char*)0x80000004;
-
- while((0x02 & *pUART_stat) != 0);
-
- *pUART_data = c;
-}
-
-int sputs(char *pStr)
-{
- char *start;
- start = pStr;
-
- while(*pStr)
- saus(*(pStr++));
-
- return pStr - start;
-}
-
-void print_word(int word)
-{
- int i;
- unsigned char c, nibble;
-
- for (i=0; i < 8; i++)
-
- {
- nibble = (char)((word >> 28) & 0xF);
- word <<= 4;
-
- if (nibble < 10)
- c = nibble + '0';
- else
- c = nibble + 'A' - 10;
-
- saus(c);
- }
-
-}
-
-int main (void)
-{
- int buf[NUM_ELEMENTS], result, i, j, cnt;
- volatile int *pReg = (int*)0x80000000;
- volatile char *pUART_data = (char*)0x80000004;
- volatile char *pUART_ctrl = (char*)0x80000008;
- volatile char *pUART_baud = (char*)0x80000009;
- char msg[] = "MIPS R3000 CPU\r\nReady\r\n";
-
- *pUART_baud = 0x35;
- *pUART_ctrl = 0x55;
-
- cnt = 0;
- memset(buf, 0, sizeof(buf));
-
- sputs(msg);
-
- buf[NUM_ELEMENTS-1] = 1;
- while (1)
- {
- result = faculty(buf[NUM_ELEMENTS-1], buf, NUM_ELEMENTS);
-
- for (i=0; i < NUM_ELEMENTS; i++)
- {
- print_word(buf[i]);
- saus(13);
- saus(10);
- }
- cnt++;
-
- while(1);
- }
-}
-
diff --git a/lib/CPUs/MIPS/sim/asm/faculty.s b/lib/CPUs/MIPS/sim/asm/faculty.s
deleted file mode 100644
index 9bbdd09..0000000
--- a/lib/CPUs/MIPS/sim/asm/faculty.s
+++ /dev/null
@@ -1,255 +0,0 @@
- .file 1 "faculty.c"
- .set nobopt
- .text
- .align 2
- .globl faculty
- .ent faculty
-faculty:
- .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0
- .mask 0x00000000,0
- .fmask 0x00000000,0
- li $7,1 # 0x1
- slt $2,$7,$6
- .set noreorder
- .set nomacro
- beq $2,$0,$L7
- sw $4,0($5)
- .set macro
- .set reorder
-
- addiu $5,$5,4
-$L5:
- lw $2,-4($5)
- mult $2,$7
- addiu $7,$7,1
- slt $3,$7,$6
- mflo $2
- sw $2,0($5)
- .set noreorder
- .set nomacro
- bne $3,$0,$L5
- addiu $5,$5,4
- .set macro
- .set reorder
-
-$L7:
- .set noreorder
- .set nomacro
- j $31
- move $2,$7
- .set macro
- .set reorder
-
- .end faculty
- .align 2
- .globl saus
- .ent saus
-saus:
- .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0
- .mask 0x00000000,0
- .fmask 0x00000000,0
- li $2,-2147483648 # 0xffffffff80000000
- sll $4,$4,24
- sra $4,$4,24
- ori $5,$2,0x4
- ori $3,$2,0x8
-$L10:
- lbu $2,0($3)
- andi $2,$2,0x2
- bne $2,$0,$L10
- sb $4,0($5)
- j $31
- .end saus
- .align 2
- .globl sputs
- .ent sputs
-sputs:
- .frame $sp,32,$31 # vars= 0, regs= 3/0, args= 16, gp= 0
- .mask 0x80030000,-8
- .fmask 0x00000000,0
- addiu $sp,$sp,-32
- sw $17,20($sp)
- sw $16,16($sp)
- sw $31,24($sp)
- move $16,$4
- lb $4,0($4)
- .set noreorder
- .set nomacro
- j $L18
- move $17,$16
- .set macro
- .set reorder
-
-$L19:
- .set noreorder
- .set nomacro
- jal saus
- addiu $16,$16,1
- .set macro
- .set reorder
-
- lb $4,0($16)
-$L18:
- .set noreorder
- .set nomacro
- bne $4,$0,$L19
- subu $2,$16,$17
- .set macro
- .set reorder
-
- lw $31,24($sp)
- lw $17,20($sp)
- lw $16,16($sp)
- .set noreorder
- .set nomacro
- j $31
- addiu $sp,$sp,32
- .set macro
- .set reorder
-
- .end sputs
- .align 2
- .globl print_word
- .ent print_word
-print_word:
- .frame $sp,32,$31 # vars= 0, regs= 3/0, args= 16, gp= 0
- .mask 0x80030000,-8
- .fmask 0x00000000,0
- addiu $sp,$sp,-32
- sw $17,20($sp)
- sw $16,16($sp)
- sw $31,24($sp)
- move $16,$4
- li $17,7 # 0x7
- srl $3,$16,28
-$L29:
- sltu $2,$3,10
- addiu $17,$17,-1
- sll $16,$16,4
- .set noreorder
- .set nomacro
- bne $2,$0,$L25
- addiu $4,$3,48
- .set macro
- .set reorder
-
- addiu $4,$3,55
-$L25:
- jal saus
- .set noreorder
- .set nomacro
- bgez $17,$L29
- srl $3,$16,28
- .set macro
- .set reorder
-
- lw $31,24($sp)
- lw $17,20($sp)
- lw $16,16($sp)
- .set noreorder
- .set nomacro
- j $31
- addiu $sp,$sp,32
- .set macro
- .set reorder
-
- .end print_word
- .section .rodata.str1.4,"aMS",@progbits,1
- .align 2
-$LC0:
- .ascii "MIPS R3000 CPU\r\n"
- .ascii "Ready\r\n\000"
- .text
- .align 2
- .globl main
- .ent main
-main:
- .frame $sp,136,$31 # vars= 104, regs= 3/0, args= 16, gp= 0
- .mask 0x80030000,-8
- .fmask 0x00000000,0
- lw $2,$LC0
- lw $3,$LC0+4
- addiu $sp,$sp,-136
- sw $2,96($sp)
- sw $3,100($sp)
- lw $2,$LC0+8
- lw $3,$LC0+12
- sw $2,104($sp)
- sw $3,108($sp)
- lw $2,$LC0+16
- lw $3,$LC0+20
- li $7,-2147483648 # 0xffffffff80000000
- ori $8,$7,0x9
- sw $2,112($sp)
- sw $3,116($sp)
- ori $7,$7,0x8
- li $3,85
- sw $16,120($sp)
- li $2,53
- addiu $16,$sp,16
- sb $2,0($8)
- move $4,$16
- sb $3,0($7)
- move $5,$0
- li $6,80 # 0x50
- sw $31,128($sp)
- .set noreorder
- .set nomacro
- jal memset
- sw $17,124($sp)
- .set macro
- .set reorder
-
- .set noreorder
- .set nomacro
- jal sputs
- addiu $4,$sp,96
- .set macro
- .set reorder
-
- li $3,1 # 0x1
- sw $3,92($sp)
- li $4,1 # 0x1
- move $5,$16
- li $6,20 # 0x14
- .set noreorder
- .set nomacro
- jal faculty
- move $17,$16
- .set macro
- .set reorder
-
- li $16,19 # 0x13
-$L36:
- lw $4,0($17)
- .set noreorder
- .set nomacro
- jal print_word
- addiu $16,$16,-1
- .set macro
- .set reorder
-
- .set noreorder
- .set nomacro
- jal saus
- li $4,13 # 0xd
- .set macro
- .set reorder
-
- .set noreorder
- .set nomacro
- jal saus
- li $4,10 # 0xa
- .set macro
- .set reorder
-
- .set noreorder
- .set nomacro
- bgez $16,$L36
- addiu $17,$17,4
- .set macro
- .set reorder
-
-$L37:
- j $L37
- .end main
diff --git a/lib/CPUs/MIPS/sim/asm/fibonacci.c b/lib/CPUs/MIPS/sim/asm/fibonacci.c
deleted file mode 100644
index b707efb..0000000
--- a/lib/CPUs/MIPS/sim/asm/fibonacci.c
+++ /dev/null
@@ -1,179 +0,0 @@
-//#include