trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_watchdog.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_clock_module.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_clock_module.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_clock_module.v (nonexistent)
@@ -1,339 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_clock_module.v
-//
-// *Module Description:
-// Basic clock module implementation.
-// Since the openMSP430 mainly targets FPGA and hobby
-// designers. The clock structure has been greatly
-// symplified in order to ease integration.
-// See online wiki for more info.
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_defines.v"
-`endif
-
-module omsp_clock_module (
-
-// OUTPUTs
- aclk_en, // ACLK enable
- cpu_en_s, // Enable CPU code execution (synchronous)
- dbg_clk, // Debug unit clock
- dbg_en_s, // Debug interface enable (synchronous)
- dbg_rst, // Debug unit reset
- mclk, // Main system clock
- per_dout, // Peripheral data output
- por, // Power-on reset
- puc_rst, // Main system reset
- smclk_en, // SMCLK enable
-
-// INPUTs
- cpu_en, // Enable CPU code execution (asynchronous)
- dbg_cpu_reset, // Reset CPU from debug interface
- dbg_en, // Debug interface enable (asynchronous)
- dco_clk, // Fast oscillator (fast clock)
- lfxt_clk, // Low frequency oscillator (typ 32kHz)
- oscoff, // Turns off LFXT1 clock input
- per_addr, // Peripheral address
- per_din, // Peripheral data input
- per_en, // Peripheral enable (high active)
- per_we, // Peripheral write enable (high active)
- reset_n, // Reset Pin (low active, asynchronous)
- scg1, // System clock generator 1. Turns off the SMCLK
- wdt_reset // Watchdog-timer reset
-);
-
-// OUTPUTs
-//=========
-output aclk_en; // ACLK enable
-output cpu_en_s; // Enable CPU code execution (synchronous)
-output dbg_clk; // Debug unit clock
-output dbg_en_s; // Debug unit enable (synchronous)
-output dbg_rst; // Debug unit reset
-output mclk; // Main system clock
-output [15:0] per_dout; // Peripheral data output
-output por; // Power-on reset
-output puc_rst; // Main system reset
-output smclk_en; // SMCLK enable
-
-// INPUTs
-//=========
-input cpu_en; // Enable CPU code execution (asynchronous)
-input dbg_cpu_reset;// Reset CPU from debug interface
-input dbg_en; // Debug interface enable (asynchronous)
-input dco_clk; // Fast oscillator (fast clock)
-input lfxt_clk; // Low frequency oscillator (typ 32kHz)
-input oscoff; // Turns off LFXT1 clock input
-input [13:0] per_addr; // Peripheral address
-input [15:0] per_din; // Peripheral data input
-input per_en; // Peripheral enable (high active)
-input [1:0] per_we; // Peripheral write enable (high active)
-input reset_n; // Reset Pin (low active, asynchronous)
-input scg1; // System clock generator 1. Turns off the SMCLK
-input wdt_reset; // Watchdog-timer reset
-
-
-//=============================================================================
-// 1) PARAMETER DECLARATION
-//=============================================================================
-
-// Register base address (must be aligned to decoder bit width)
-parameter [14:0] BASE_ADDR = 15'h0050;
-
-// Decoder bit width (defines how many bits are considered for address decoding)
-parameter DEC_WD = 4;
-
-// Register addresses offset
-parameter [DEC_WD-1:0] BCSCTL1 = 'h7,
- BCSCTL2 = 'h8;
-
-// Register one-hot decoder utilities
-parameter DEC_SZ = 2**DEC_WD;
-parameter [DEC_SZ-1:0] BASE_REG = {{DEC_SZ-1{1'b0}}, 1'b1};
-
-// Register one-hot decoder
-parameter [DEC_SZ-1:0] BCSCTL1_D = (BASE_REG << BCSCTL1),
- BCSCTL2_D = (BASE_REG << BCSCTL2);
-
-
-//============================================================================
-// 2) REGISTER DECODER
-//============================================================================
-
-// Local register selection
-wire reg_sel = per_en & (per_addr[13:DEC_WD-1]==BASE_ADDR[14:DEC_WD]);
-
-// Register local address
-wire [DEC_WD-1:0] reg_addr = {1'b0, per_addr[DEC_WD-2:0]};
-
-// Register address decode
-wire [DEC_SZ-1:0] reg_dec = (BCSCTL1_D & {DEC_SZ{(reg_addr==(BCSCTL1 >>1))}}) |
- (BCSCTL2_D & {DEC_SZ{(reg_addr==(BCSCTL2 >>1))}});
-
-// Read/Write probes
-wire reg_lo_write = per_we[0] & reg_sel;
-wire reg_hi_write = per_we[1] & reg_sel;
-wire reg_read = ~|per_we & reg_sel;
-
-// Read/Write vectors
-wire [DEC_SZ-1:0] reg_hi_wr = reg_dec & {DEC_SZ{reg_hi_write}};
-wire [DEC_SZ-1:0] reg_lo_wr = reg_dec & {DEC_SZ{reg_lo_write}};
-wire [DEC_SZ-1:0] reg_rd = reg_dec & {DEC_SZ{reg_read}};
-
-
-//============================================================================
-// 3) REGISTERS
-//============================================================================
-
-// BCSCTL1 Register
-//--------------
-reg [7:0] bcsctl1;
-wire bcsctl1_wr = BCSCTL1[0] ? reg_hi_wr[BCSCTL1] : reg_lo_wr[BCSCTL1];
-wire [7:0] bcsctl1_nxt = BCSCTL1[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) bcsctl1 <= 8'h00;
- else if (bcsctl1_wr) bcsctl1 <= bcsctl1_nxt & 8'h30; // Mask unused bits
-
-
-// BCSCTL2 Register
-//--------------
-reg [7:0] bcsctl2;
-wire bcsctl2_wr = BCSCTL2[0] ? reg_hi_wr[BCSCTL2] : reg_lo_wr[BCSCTL2];
-wire [7:0] bcsctl2_nxt = BCSCTL2[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) bcsctl2 <= 8'h00;
- else if (bcsctl2_wr) bcsctl2 <= bcsctl2_nxt & 8'h0e; // Mask unused bits
-
-
-//============================================================================
-// 4) DATA OUTPUT GENERATION
-//============================================================================
-
-// Data output mux
-wire [15:0] bcsctl1_rd = {8'h00, (bcsctl1 & {8{reg_rd[BCSCTL1]}})} << (8 & {4{BCSCTL1[0]}});
-wire [15:0] bcsctl2_rd = {8'h00, (bcsctl2 & {8{reg_rd[BCSCTL2]}})} << (8 & {4{BCSCTL2[0]}});
-
-wire [15:0] per_dout = bcsctl1_rd |
- bcsctl2_rd;
-
-
-//=============================================================================
-// 5) CLOCK GENERATION
-//=============================================================================
-
-// Synchronize CPU_EN signal
-//---------------------------------------
-`ifdef SYNC_CPU_EN
-omsp_sync_cell sync_cell_cpu_en (
- .data_out (cpu_en_s),
- .clk (mclk),
- .data_in (cpu_en),
- .rst (por)
-);
-`else
- assign cpu_en_s = cpu_en;
-`endif
-
-// Synchronize LFXT_CLK & edge detection
-//---------------------------------------
-wire lfxt_clk_s;
-
-omsp_sync_cell sync_cell_lfxt_clk (
- .data_out (lfxt_clk_s),
- .clk (mclk),
- .data_in (lfxt_clk),
- .rst (por)
-);
-
-reg lfxt_clk_dly;
-
-always @ (posedge mclk or posedge por)
- if (por) lfxt_clk_dly <= 1'b0;
- else lfxt_clk_dly <= lfxt_clk_s;
-
-wire lfxt_clk_en = (lfxt_clk_s & ~lfxt_clk_dly) & ~(oscoff & ~bcsctl2[`SELS]);
-
-
-// Generate main system clock
-//----------------------------
-
-wire mclk = dco_clk;
-wire mclk_n = !dco_clk;
-
-
-// Generate ACLK
-//----------------------------
-
-reg aclk_en;
-reg [2:0] aclk_div;
-
-wire aclk_en_nxt = lfxt_clk_en & ((bcsctl1[`DIVAx]==2'b00) ? 1'b1 :
- (bcsctl1[`DIVAx]==2'b01) ? aclk_div[0] :
- (bcsctl1[`DIVAx]==2'b10) ? &aclk_div[1:0] :
- &aclk_div[2:0]);
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) aclk_en <= 1'b0;
- else aclk_en <= aclk_en_nxt & cpu_en_s;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) aclk_div <= 3'h0;
- else if ((bcsctl1[`DIVAx]!=2'b00) & lfxt_clk_en) aclk_div <= aclk_div+3'h1;
-
-
-// Generate SMCLK
-//----------------------------
-
-reg smclk_en;
-reg [2:0] smclk_div;
-
-wire smclk_in = ~scg1 & (bcsctl2[`SELS] ? lfxt_clk_en : 1'b1);
-
-wire smclk_en_nxt = smclk_in & ((bcsctl2[`DIVSx]==2'b00) ? 1'b1 :
- (bcsctl2[`DIVSx]==2'b01) ? smclk_div[0] :
- (bcsctl2[`DIVSx]==2'b10) ? &smclk_div[1:0] :
- &smclk_div[2:0]);
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) smclk_en <= 1'b0;
- else smclk_en <= smclk_en_nxt & cpu_en_s;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) smclk_div <= 3'h0;
- else if ((bcsctl2[`DIVSx]!=2'b00) & smclk_in) smclk_div <= smclk_div+3'h1;
-
-
-// Generate DBG_CLK
-//----------------------------
-
-assign dbg_clk = mclk;
-
-
-//=============================================================================
-// 6) RESET GENERATION
-//=============================================================================
-
-// Generate synchronized POR
-wire por_n;
-wire por_reset_a = !reset_n;
-
-omsp_sync_cell sync_cell_por (
- .data_out (por_n),
- .clk (mclk),
- .data_in (1'b1),
- .rst (por_reset_a)
-);
-
-wire por = ~por_n;
-
-
-// Generate main system reset
-wire puc_rst_comb = por | wdt_reset | dbg_cpu_reset;
-reg puc_rst;
-always @(posedge mclk or posedge puc_rst_comb)
- if (puc_rst_comb) puc_rst <= 1'b1;
- else puc_rst <= 1'b0;
-
-
-// Generate debug unit reset
-`ifdef DBG_EN
-wire dbg_rst_n;
-
- `ifdef SYNC_DBG_EN
- omsp_sync_cell sync_cell_dbg_en (
- .data_out (dbg_rst_n),
- .clk (mclk),
- .data_in (dbg_en),
- .rst (por)
- );
- `else
-assign dbg_rst_n = dbg_en;
- `endif
-
-`else
-wire dbg_rst_n = 1'b0;
-`endif
-
-wire dbg_en_s = dbg_rst_n;
-wire dbg_rst = ~dbg_rst_n;
-
-
-endmodule // omsp_clock_module
-
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_clock_module.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_execution_unit.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_execution_unit.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_execution_unit.v (nonexistent)
@@ -1,382 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_execution_unit.v
-//
-// *Module Description:
-// openMSP430 Execution unit
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_defines.v"
-`endif
-
-module omsp_execution_unit (
-
-// OUTPUTs
- cpuoff, // Turns off the CPU
- dbg_reg_din, // Debug unit CPU register data input
- gie, // General interrupt enable
- mab, // Memory address bus
- mb_en, // Memory bus enable
- mb_wr, // Memory bus write transfer
- mdb_out, // Memory data bus output
- oscoff, // Turns off LFXT1 clock input
- pc_sw, // Program counter software value
- pc_sw_wr, // Program counter software write
- scg1, // System clock generator 1. Turns off the SMCLK
-
-// INPUTs
- dbg_halt_st, // Halt/Run status from CPU
- dbg_mem_dout, // Debug unit data output
- dbg_reg_wr, // Debug unit CPU register write
- e_state, // Execution state
- exec_done, // Execution completed
- inst_ad, // Decoded Inst: destination addressing mode
- inst_as, // Decoded Inst: source addressing mode
- inst_alu, // ALU control signals
- inst_bw, // Decoded Inst: byte width
- inst_dest, // Decoded Inst: destination (one hot)
- inst_dext, // Decoded Inst: destination extended instruction word
- inst_irq_rst, // Decoded Inst: reset interrupt
- inst_jmp, // Decoded Inst: Conditional jump
- inst_mov, // Decoded Inst: mov instruction
- inst_sext, // Decoded Inst: source extended instruction word
- inst_so, // Decoded Inst: Single-operand arithmetic
- inst_src, // Decoded Inst: source (one hot)
- inst_type, // Decoded Instruction type
- mclk, // Main system clock
- mdb_in, // Memory data bus input
- pc, // Program counter
- pc_nxt, // Next PC value (for CALL & IRQ)
- puc_rst // Main system reset
-);
-
-// OUTPUTs
-//=========
-output cpuoff; // Turns off the CPU
-output [15:0] dbg_reg_din; // Debug unit CPU register data input
-output gie; // General interrupt enable
-output [15:0] mab; // Memory address bus
-output mb_en; // Memory bus enable
-output [1:0] mb_wr; // Memory bus write transfer
-output [15:0] mdb_out; // Memory data bus output
-output oscoff; // Turns off LFXT1 clock input
-output [15:0] pc_sw; // Program counter software value
-output pc_sw_wr; // Program counter software write
-output scg1; // System clock generator 1. Turns off the SMCLK
-
-// INPUTs
-//=========
-input dbg_halt_st; // Halt/Run status from CPU
-input [15:0] dbg_mem_dout; // Debug unit data output
-input dbg_reg_wr; // Debug unit CPU register write
-input [3:0] e_state; // Execution state
-input exec_done; // Execution completed
-input [7:0] inst_ad; // Decoded Inst: destination addressing mode
-input [7:0] inst_as; // Decoded Inst: source addressing mode
-input [11:0] inst_alu; // ALU control signals
-input inst_bw; // Decoded Inst: byte width
-input [15:0] inst_dest; // Decoded Inst: destination (one hot)
-input [15:0] inst_dext; // Decoded Inst: destination extended instruction word
-input inst_irq_rst; // Decoded Inst: reset interrupt
-input [7:0] inst_jmp; // Decoded Inst: Conditional jump
-input inst_mov; // Decoded Inst: mov instruction
-input [15:0] inst_sext; // Decoded Inst: source extended instruction word
-input [7:0] inst_so; // Decoded Inst: Single-operand arithmetic
-input [15:0] inst_src; // Decoded Inst: source (one hot)
-input [2:0] inst_type; // Decoded Instruction type
-input mclk; // Main system clock
-input [15:0] mdb_in; // Memory data bus input
-input [15:0] pc; // Program counter
-input [15:0] pc_nxt; // Next PC value (for CALL & IRQ)
-input puc_rst; // Main system reset
-
-
-//=============================================================================
-// 1) INTERNAL WIRES/REGISTERS/PARAMETERS DECLARATION
-//=============================================================================
-
-wire [15:0] alu_out;
-wire [15:0] alu_out_add;
-wire [3:0] alu_stat;
-wire [3:0] alu_stat_wr;
-wire [15:0] op_dst;
-wire [15:0] op_src;
-wire [15:0] reg_dest;
-wire [15:0] reg_src;
-wire [15:0] mdb_in_bw;
-wire [15:0] mdb_in_val;
-wire [3:0] status;
-
-
-//=============================================================================
-// 2) REGISTER FILE
-//=============================================================================
-
-wire reg_dest_wr = ((e_state==`E_EXEC) & (
- (inst_type[`INST_TO] & inst_ad[`DIR] & ~inst_alu[`EXEC_NO_WR]) |
- (inst_type[`INST_SO] & inst_as[`DIR] & ~(inst_so[`PUSH] | inst_so[`CALL] | inst_so[`RETI])) |
- inst_type[`INST_JMP])) | dbg_reg_wr;
-
-wire reg_sp_wr = (((e_state==`E_IRQ_1) | (e_state==`E_IRQ_3)) & ~inst_irq_rst) |
- ((e_state==`E_DST_RD) & ((inst_so[`PUSH] & ~inst_as[`IDX] &
- ~((inst_as[`INDIR] | inst_as[`INDIR_I]) & inst_src[1])) |
- inst_so[`CALL])) |
- ((e_state==`E_SRC_AD) & (inst_so[`PUSH] & inst_as[`IDX])) |
- ((e_state==`E_SRC_RD) & (inst_so[`PUSH] & ((inst_as[`INDIR] | inst_as[`INDIR_I]) & inst_src[1])));
-
-wire reg_sr_wr = (e_state==`E_DST_RD) & inst_so[`RETI];
-
-wire reg_sr_clr = (e_state==`E_IRQ_2);
-
-wire reg_pc_call = ((e_state==`E_EXEC) & inst_so[`CALL]) |
- ((e_state==`E_DST_WR) & inst_so[`RETI]);
-
-wire reg_incr = (exec_done & inst_as[`INDIR_I]) |
- ((e_state==`E_SRC_RD) & inst_so[`RETI]) |
- ((e_state==`E_EXEC) & inst_so[`RETI]);
-
-assign dbg_reg_din = reg_dest;
-
-
-omsp_register_file register_file_0 (
-
-// OUTPUTs
- .cpuoff (cpuoff), // Turns off the CPU
- .gie (gie), // General interrupt enable
- .oscoff (oscoff), // Turns off LFXT1 clock input
- .pc_sw (pc_sw), // Program counter software value
- .pc_sw_wr (pc_sw_wr), // Program counter software write
- .reg_dest (reg_dest), // Selected register destination content
- .reg_src (reg_src), // Selected register source content
- .scg1 (scg1), // System clock generator 1. Turns off the SMCLK
- .status (status), // R2 Status {V,N,Z,C}
-
-// INPUTs
- .alu_stat (alu_stat), // ALU Status {V,N,Z,C}
- .alu_stat_wr (alu_stat_wr), // ALU Status write {V,N,Z,C}
- .inst_bw (inst_bw), // Decoded Inst: byte width
- .inst_dest (inst_dest), // Register destination selection
- .inst_src (inst_src), // Register source selection
- .mclk (mclk), // Main system clock
- .pc (pc), // Program counter
- .puc_rst (puc_rst), // Main system reset
- .reg_dest_val (alu_out), // Selected register destination value
- .reg_dest_wr (reg_dest_wr), // Write selected register destination
- .reg_pc_call (reg_pc_call), // Trigger PC update for a CALL instruction
- .reg_sp_val (alu_out_add), // Stack Pointer next value
- .reg_sp_wr (reg_sp_wr), // Stack Pointer write
- .reg_sr_clr (reg_sr_clr), // Status register clear for interrupts
- .reg_sr_wr (reg_sr_wr), // Status Register update for RETI instruction
- .reg_incr (reg_incr) // Increment source register
-);
-
-
-//=============================================================================
-// 3) SOURCE OPERAND MUXING
-//=============================================================================
-// inst_as[`DIR] : Register direct. -> Source is in register
-// inst_as[`IDX] : Register indexed. -> Source is in memory, address is register+offset
-// inst_as[`INDIR] : Register indirect.
-// inst_as[`INDIR_I]: Register indirect autoincrement.
-// inst_as[`SYMB] : Symbolic (operand is in memory at address PC+x).
-// inst_as[`IMM] : Immediate (operand is next word in the instruction stream).
-// inst_as[`ABS] : Absolute (operand is in memory at address x).
-// inst_as[`CONST] : Constant.
-
-wire src_reg_src_sel = (e_state==`E_IRQ_0) |
- (e_state==`E_IRQ_2) |
- ((e_state==`E_SRC_RD) & ~inst_as[`ABS]) |
- ((e_state==`E_SRC_WR) & ~inst_as[`ABS]) |
- ((e_state==`E_EXEC) & inst_as[`DIR] & ~inst_type[`INST_JMP]);
-
-wire src_reg_dest_sel = (e_state==`E_IRQ_1) |
- (e_state==`E_IRQ_3) |
- ((e_state==`E_DST_RD) & (inst_so[`PUSH] | inst_so[`CALL])) |
- ((e_state==`E_SRC_AD) & inst_so[`PUSH] & inst_as[`IDX]);
-
-wire src_mdb_in_val_sel = ((e_state==`E_DST_RD) & inst_so[`RETI]) |
- ((e_state==`E_EXEC) & (inst_as[`INDIR] | inst_as[`INDIR_I] |
- inst_as[`IDX] | inst_as[`SYMB] |
- inst_as[`ABS]));
-
-wire src_inst_dext_sel = ((e_state==`E_DST_RD) & ~(inst_so[`PUSH] | inst_so[`CALL])) |
- ((e_state==`E_DST_WR) & ~(inst_so[`PUSH] | inst_so[`CALL] |
- inst_so[`RETI]));
-
-wire src_inst_sext_sel = ((e_state==`E_EXEC) & (inst_type[`INST_JMP] | inst_as[`IMM] |
- inst_as[`CONST] | inst_so[`RETI]));
-
-
-assign op_src = src_reg_src_sel ? reg_src :
- src_reg_dest_sel ? reg_dest :
- src_mdb_in_val_sel ? mdb_in_val :
- src_inst_dext_sel ? inst_dext :
- src_inst_sext_sel ? inst_sext : 16'h0000;
-
-
-//=============================================================================
-// 4) DESTINATION OPERAND MUXING
-//=============================================================================
-// inst_ad[`DIR] : Register direct.
-// inst_ad[`IDX] : Register indexed.
-// inst_ad[`SYMB] : Symbolic (operand is in memory at address PC+x).
-// inst_ad[`ABS] : Absolute (operand is in memory at address x).
-
-
-wire dst_inst_sext_sel = ((e_state==`E_SRC_RD) & (inst_as[`IDX] | inst_as[`SYMB] |
- inst_as[`ABS])) |
- ((e_state==`E_SRC_WR) & (inst_as[`IDX] | inst_as[`SYMB] |
- inst_as[`ABS]));
-
-wire dst_mdb_in_bw_sel = ((e_state==`E_DST_WR) & inst_so[`RETI]) |
- ((e_state==`E_EXEC) & ~(inst_ad[`DIR] | inst_type[`INST_JMP] |
- inst_type[`INST_SO]) & ~inst_so[`RETI]);
-
-wire dst_fffe_sel = (e_state==`E_IRQ_0) |
- (e_state==`E_IRQ_1) |
- (e_state==`E_IRQ_3) |
- ((e_state==`E_DST_RD) & (inst_so[`PUSH] | inst_so[`CALL]) & ~inst_so[`RETI]) |
- ((e_state==`E_SRC_AD) & inst_so[`PUSH] & inst_as[`IDX]) |
- ((e_state==`E_SRC_RD) & inst_so[`PUSH] & (inst_as[`INDIR] | inst_as[`INDIR_I]) & inst_src[1]);
-
-wire dst_reg_dest_sel = ((e_state==`E_DST_RD) & ~(inst_so[`PUSH] | inst_so[`CALL] | inst_ad[`ABS] | inst_so[`RETI])) |
- ((e_state==`E_DST_WR) & ~inst_ad[`ABS]) |
- ((e_state==`E_EXEC) & (inst_ad[`DIR] | inst_type[`INST_JMP] |
- inst_type[`INST_SO]) & ~inst_so[`RETI]);
-
-
-assign op_dst = dbg_halt_st ? dbg_mem_dout :
- dst_inst_sext_sel ? inst_sext :
- dst_mdb_in_bw_sel ? mdb_in_bw :
- dst_reg_dest_sel ? reg_dest :
- dst_fffe_sel ? 16'hfffe : 16'h0000;
-
-
-//=============================================================================
-// 5) ALU
-//=============================================================================
-
-wire exec_cycle = (e_state==`E_EXEC);
-
-omsp_alu alu_0 (
-
-// OUTPUTs
- .alu_out (alu_out), // ALU output value
- .alu_out_add (alu_out_add), // ALU adder output value
- .alu_stat (alu_stat), // ALU Status {V,N,Z,C}
- .alu_stat_wr (alu_stat_wr), // ALU Status write {V,N,Z,C}
-
-// INPUTs
- .dbg_halt_st (dbg_halt_st), // Halt/Run status from CPU
- .exec_cycle (exec_cycle), // Instruction execution cycle
- .inst_alu (inst_alu), // ALU control signals
- .inst_bw (inst_bw), // Decoded Inst: byte width
- .inst_jmp (inst_jmp), // Decoded Inst: Conditional jump
- .inst_so (inst_so), // Single-operand arithmetic
- .op_dst (op_dst), // Destination operand
- .op_src (op_src), // Source operand
- .status (status) // R2 Status {V,N,Z,C}
-);
-
-
-//=============================================================================
-// 6) MEMORY INTERFACE
-//=============================================================================
-
-// Detect memory read/write access
-assign mb_en = ((e_state==`E_IRQ_1) & ~inst_irq_rst) |
- ((e_state==`E_IRQ_3) & ~inst_irq_rst) |
- ((e_state==`E_SRC_RD) & ~inst_as[`IMM]) |
- (e_state==`E_SRC_WR) |
- ((e_state==`E_EXEC) & inst_so[`RETI]) |
- ((e_state==`E_DST_RD) & ~inst_type[`INST_SO]
- & ~inst_mov) |
- (e_state==`E_DST_WR);
-
-wire [1:0] mb_wr_msk = inst_alu[`EXEC_NO_WR] ? 2'b00 :
- ~inst_bw ? 2'b11 :
- alu_out_add[0] ? 2'b10 : 2'b01;
-assign mb_wr = ({2{(e_state==`E_IRQ_1)}} |
- {2{(e_state==`E_IRQ_3)}} |
- {2{(e_state==`E_DST_WR)}} |
- {2{(e_state==`E_SRC_WR)}}) & mb_wr_msk;
-
-// Memory address bus
-assign mab = alu_out_add[15:0];
-
-// Memory data bus output
-reg [15:0] mdb_out_nxt;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) mdb_out_nxt <= 16'h0000;
- else if (e_state==`E_DST_RD) mdb_out_nxt <= pc_nxt;
- else if ((e_state==`E_EXEC & ~inst_so[`CALL]) |
- (e_state==`E_IRQ_0) | (e_state==`E_IRQ_2)) mdb_out_nxt <= alu_out;
-
-assign mdb_out = inst_bw ? {2{mdb_out_nxt[7:0]}} : mdb_out_nxt;
-
-// Format memory data bus input depending on BW
-reg mab_lsb;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) mab_lsb <= 1'b0;
- else if (mb_en) mab_lsb <= alu_out_add[0];
-
-assign mdb_in_bw = ~inst_bw ? mdb_in :
- mab_lsb ? {2{mdb_in[15:8]}} : mdb_in;
-
-// Memory data bus input buffer (buffer after a source read)
-reg mdb_in_buf_en;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) mdb_in_buf_en <= 1'b0;
- else mdb_in_buf_en <= (e_state==`E_SRC_RD);
-
-reg mdb_in_buf_valid;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) mdb_in_buf_valid <= 1'b0;
- else if (e_state==`E_EXEC) mdb_in_buf_valid <= 1'b0;
- else if (mdb_in_buf_en) mdb_in_buf_valid <= 1'b1;
-
-reg [15:0] mdb_in_buf;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) mdb_in_buf <= 16'h0000;
- else if (mdb_in_buf_en) mdb_in_buf <= mdb_in_bw;
-
-assign mdb_in_val = mdb_in_buf_valid ? mdb_in_buf : mdb_in_bw;
-
-
-endmodule // omsp_execution_unit
-
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_execution_unit.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_mem_backbone.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_mem_backbone.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_mem_backbone.v (nonexistent)
@@ -1,256 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_mem_backbone.v
-//
-// *Module Description:
-// Memory interface backbone (decoder + arbiter)
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_defines.v"
-`endif
-
-module omsp_mem_backbone (
-
-// OUTPUTs
- dbg_mem_din, // Debug unit Memory data input
- dmem_addr, // Data Memory address
- dmem_cen, // Data Memory chip enable (low active)
- dmem_din, // Data Memory data input
- dmem_wen, // Data Memory write enable (low active)
- eu_mdb_in, // Execution Unit Memory data bus input
- fe_mdb_in, // Frontend Memory data bus input
- fe_pmem_wait, // Frontend wait for Instruction fetch
- per_addr, // Peripheral address
- per_din, // Peripheral data input
- per_we, // Peripheral write enable (high active)
- per_en, // Peripheral enable (high active)
- pmem_addr, // Program Memory address
- pmem_cen, // Program Memory chip enable (low active)
- pmem_din, // Program Memory data input (optional)
- pmem_wen, // Program Memory write enable (low active) (optional)
-
-// INPUTs
- dbg_halt_st, // Halt/Run status from CPU
- dbg_mem_addr, // Debug address for rd/wr access
- dbg_mem_dout, // Debug unit data output
- dbg_mem_en, // Debug unit memory enable
- dbg_mem_wr, // Debug unit memory write
- dmem_dout, // Data Memory data output
- eu_mab, // Execution Unit Memory address bus
- eu_mb_en, // Execution Unit Memory bus enable
- eu_mb_wr, // Execution Unit Memory bus write transfer
- eu_mdb_out, // Execution Unit Memory data bus output
- fe_mab, // Frontend Memory address bus
- fe_mb_en, // Frontend Memory bus enable
- mclk, // Main system clock
- per_dout, // Peripheral data output
- pmem_dout, // Program Memory data output
- puc_rst // Main system reset
-);
-
-// OUTPUTs
-//=========
-output [15:0] dbg_mem_din; // Debug unit Memory data input
-output [`DMEM_MSB:0] dmem_addr; // Data Memory address
-output dmem_cen; // Data Memory chip enable (low active)
-output [15:0] dmem_din; // Data Memory data input
-output [1:0] dmem_wen; // Data Memory write enable (low active)
-output [15:0] eu_mdb_in; // Execution Unit Memory data bus input
-output [15:0] fe_mdb_in; // Frontend Memory data bus input
-output fe_pmem_wait; // Frontend wait for Instruction fetch
-output [13:0] per_addr; // Peripheral address
-output [15:0] per_din; // Peripheral data input
-output [1:0] per_we; // Peripheral write enable (high active)
-output per_en; // Peripheral enable (high active)
-output [`PMEM_MSB:0] pmem_addr; // Program Memory address
-output pmem_cen; // Program Memory chip enable (low active)
-output [15:0] pmem_din; // Program Memory data input (optional)
-output [1:0] pmem_wen; // Program Memory write enable (low active) (optional)
-
-// INPUTs
-//=========
-input dbg_halt_st; // Halt/Run status from CPU
-input [15:0] dbg_mem_addr; // Debug address for rd/wr access
-input [15:0] dbg_mem_dout; // Debug unit data output
-input dbg_mem_en; // Debug unit memory enable
-input [1:0] dbg_mem_wr; // Debug unit memory write
-input [15:0] dmem_dout; // Data Memory data output
-input [14:0] eu_mab; // Execution Unit Memory address bus
-input eu_mb_en; // Execution Unit Memory bus enable
-input [1:0] eu_mb_wr; // Execution Unit Memory bus write transfer
-input [15:0] eu_mdb_out; // Execution Unit Memory data bus output
-input [14:0] fe_mab; // Frontend Memory address bus
-input fe_mb_en; // Frontend Memory bus enable
-input mclk; // Main system clock
-input [15:0] per_dout; // Peripheral data output
-input [15:0] pmem_dout; // Program Memory data output
-input puc_rst; // Main system reset
-
-
-//=============================================================================
-// 1) DECODER
-//=============================================================================
-
-// RAM Interface
-//------------------
-
-// Execution unit access
-wire eu_dmem_cen = ~(eu_mb_en & (eu_mab>=(`DMEM_BASE>>1)) &
- (eu_mab<((`DMEM_BASE+`DMEM_SIZE)>>1)));
-wire [15:0] eu_dmem_addr = {1'b0, eu_mab}-(`DMEM_BASE>>1);
-
-// Debug interface access
-wire dbg_dmem_cen = ~(dbg_mem_en & (dbg_mem_addr[15:1]>=(`DMEM_BASE>>1)) &
- (dbg_mem_addr[15:1]<((`DMEM_BASE+`DMEM_SIZE)>>1)));
-wire [15:0] dbg_dmem_addr = {1'b0, dbg_mem_addr[15:1]}-(`DMEM_BASE>>1);
-
-
-// RAM Interface
-wire [`DMEM_MSB:0] dmem_addr = ~dbg_dmem_cen ? dbg_dmem_addr[`DMEM_MSB:0] : eu_dmem_addr[`DMEM_MSB:0];
-wire dmem_cen = dbg_dmem_cen & eu_dmem_cen;
-wire [1:0] dmem_wen = ~(dbg_mem_wr | eu_mb_wr);
-wire [15:0] dmem_din = ~dbg_dmem_cen ? dbg_mem_dout : eu_mdb_out;
-
-
-// ROM Interface
-//------------------
-parameter PMEM_OFFSET = (16'hFFFF-`PMEM_SIZE+1);
-
-// Execution unit access (only read access are accepted)
-wire eu_pmem_cen = ~(eu_mb_en & ~|eu_mb_wr & (eu_mab>=(PMEM_OFFSET>>1)));
-wire [15:0] eu_pmem_addr = eu_mab-(PMEM_OFFSET>>1);
-
-// Front-end access
-wire fe_pmem_cen = ~(fe_mb_en & (fe_mab>=(PMEM_OFFSET>>1)));
-wire [15:0] fe_pmem_addr = fe_mab-(PMEM_OFFSET>>1);
-
-// Debug interface access
-wire dbg_pmem_cen = ~(dbg_mem_en & (dbg_mem_addr[15:1]>=(PMEM_OFFSET>>1)));
-wire [15:0] dbg_pmem_addr = {1'b0, dbg_mem_addr[15:1]}-(PMEM_OFFSET>>1);
-
-
-// ROM Interface (Execution unit has priority)
-wire [`PMEM_MSB:0] pmem_addr = ~dbg_pmem_cen ? dbg_pmem_addr[`PMEM_MSB:0] :
- ~eu_pmem_cen ? eu_pmem_addr[`PMEM_MSB:0] : fe_pmem_addr[`PMEM_MSB:0];
-wire pmem_cen = fe_pmem_cen & eu_pmem_cen & dbg_pmem_cen;
-wire [1:0] pmem_wen = ~dbg_mem_wr;
-wire [15:0] pmem_din = dbg_mem_dout;
-
-wire fe_pmem_wait = (~fe_pmem_cen & ~eu_pmem_cen);
-
-
-// Peripherals
-//--------------------
-wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:`PER_AWIDTH+1]=={15-`PER_AWIDTH{1'b0}});
-wire eu_per_en = eu_mb_en & (eu_mab[14:`PER_AWIDTH] =={15-`PER_AWIDTH{1'b0}});
-
-wire [15:0] per_din = dbg_mem_en ? dbg_mem_dout : eu_mdb_out;
-wire [1:0] per_we = dbg_mem_en ? dbg_mem_wr : eu_mb_wr;
-wire per_en = dbg_mem_en ? dbg_per_en : eu_per_en;
-wire [`PER_MSB:0] per_addr_mux = dbg_mem_en ? dbg_mem_addr[`PER_MSB+1:1] : eu_mab[`PER_MSB:0];
-wire [14:0] per_addr_ful = {{15-`PER_AWIDTH{1'b0}}, per_addr_mux};
-wire [13:0] per_addr = per_addr_ful[13:0];
-
-reg [15:0] per_dout_val;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) per_dout_val <= 16'h0000;
- else per_dout_val <= per_dout;
-
-
-// Frontend data Mux
-//---------------------------------
-// Whenever the frontend doesn't access the ROM, backup the data
-
-// Detect whenever the data should be backuped and restored
-reg fe_pmem_cen_dly;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) fe_pmem_cen_dly <= 1'b0;
- else fe_pmem_cen_dly <= fe_pmem_cen;
-
-wire fe_pmem_save = ( fe_pmem_cen & ~fe_pmem_cen_dly) & ~dbg_halt_st;
-wire fe_pmem_restore = (~fe_pmem_cen & fe_pmem_cen_dly) | dbg_halt_st;
-
-reg [15:0] pmem_dout_bckup;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) pmem_dout_bckup <= 16'h0000;
- else if (fe_pmem_save) pmem_dout_bckup <= pmem_dout;
-
-// Mux between the ROM data and the backup
-reg pmem_dout_bckup_sel;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) pmem_dout_bckup_sel <= 1'b0;
- else if (fe_pmem_save) pmem_dout_bckup_sel <= 1'b1;
- else if (fe_pmem_restore) pmem_dout_bckup_sel <= 1'b0;
-
-assign fe_mdb_in = pmem_dout_bckup_sel ? pmem_dout_bckup : pmem_dout;
-
-
-// Execution-Unit data Mux
-//---------------------------------
-
-// Select between peripherals, RAM and ROM
-reg [1:0] eu_mdb_in_sel;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) eu_mdb_in_sel <= 2'b00;
- else eu_mdb_in_sel <= {~eu_pmem_cen, per_en};
-
-// Mux
-assign eu_mdb_in = eu_mdb_in_sel[1] ? pmem_dout :
- eu_mdb_in_sel[0] ? per_dout_val : dmem_dout;
-
-// Debug interface data Mux
-//---------------------------------
-
-// Select between peripherals, RAM and ROM
-`ifdef DBG_EN
-reg [1:0] dbg_mem_din_sel;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) dbg_mem_din_sel <= 2'b00;
- else dbg_mem_din_sel <= {~dbg_pmem_cen, dbg_per_en};
-
-`else
-wire [1:0] dbg_mem_din_sel = 2'b00;
-`endif
-
-// Mux
-assign dbg_mem_din = dbg_mem_din_sel[1] ? pmem_dout :
- dbg_mem_din_sel[0] ? per_dout_val : dmem_dout;
-
-
-endmodule // omsp_mem_backbone
-
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/openMSP430_undefines.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/openMSP430.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/openMSP430.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/openMSP430.v (nonexistent)
@@ -1,515 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: openMSP430.v
-//
-// *Module Description:
-// openMSP430 Top level file
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_defines.v"
-`endif
-
-module openMSP430 (
-
-// OUTPUTs
- aclk_en, // ACLK enable
- dbg_freeze, // Freeze peripherals
- dbg_uart_txd, // Debug interface: UART TXD
- dmem_addr, // Data Memory address
- dmem_cen, // Data Memory chip enable (low active)
- dmem_din, // Data Memory data input
- dmem_wen, // Data Memory write enable (low active)
- irq_acc, // Interrupt request accepted (one-hot signal)
- mclk, // Main system clock
- per_addr, // Peripheral address
- per_din, // Peripheral data input
- per_we, // Peripheral write enable (high active)
- per_en, // Peripheral enable (high active)
- pmem_addr, // Program Memory address
- pmem_cen, // Program Memory chip enable (low active)
- pmem_din, // Program Memory data input (optional)
- pmem_wen, // Program Memory write enable (low active) (optional)
- puc_rst, // Main system reset
- smclk_en, // SMCLK enable
-
-// INPUTs
- cpu_en, // Enable CPU code execution (asynchronous)
- dbg_en, // Debug interface enable (asynchronous)
- dbg_uart_rxd, // Debug interface: UART RXD (asynchronous)
- dco_clk, // Fast oscillator (fast clock)
- dmem_dout, // Data Memory data output
- irq, // Maskable interrupts
- lfxt_clk, // Low frequency oscillator (typ 32kHz)
- nmi, // Non-maskable interrupt (asynchronous)
- per_dout, // Peripheral data output
- pmem_dout, // Program Memory data output
- reset_n // Reset Pin (low active, asynchronous)
-);
-
-// OUTPUTs
-//=========
-output aclk_en; // ACLK enable
-output dbg_freeze; // Freeze peripherals
-output dbg_uart_txd; // Debug interface: UART TXD
-output [`DMEM_MSB:0] dmem_addr; // Data Memory address
-output dmem_cen; // Data Memory chip enable (low active)
-output [15:0] dmem_din; // Data Memory data input
-output [1:0] dmem_wen; // Data Memory write enable (low active)
-output [13:0] irq_acc; // Interrupt request accepted (one-hot signal)
-output mclk; // Main system clock
-output [13:0] per_addr; // Peripheral address
-output [15:0] per_din; // Peripheral data input
-output [1:0] per_we; // Peripheral write enable (high active)
-output per_en; // Peripheral enable (high active)
-output [`PMEM_MSB:0] pmem_addr; // Program Memory address
-output pmem_cen; // Program Memory chip enable (low active)
-output [15:0] pmem_din; // Program Memory data input (optional)
-output [1:0] pmem_wen; // Program Memory write enable (low active) (optional)
-output puc_rst; // Main system reset
-output smclk_en; // SMCLK enable
-
-
-// INPUTs
-//=========
-input cpu_en; // Enable CPU code execution (asynchronous)
-input dbg_en; // Debug interface enable (asynchronous)
-input dbg_uart_rxd; // Debug interface: UART RXD (asynchronous)
-input dco_clk; // Fast oscillator (fast clock)
-input [15:0] dmem_dout; // Data Memory data output
-input [13:0] irq; // Maskable interrupts
-input lfxt_clk; // Low frequency oscillator (typ 32kHz)
-input nmi; // Non-maskable interrupt (asynchronous)
-input [15:0] per_dout; // Peripheral data output
-input [15:0] pmem_dout; // Program Memory data output
-input reset_n; // Reset Pin (active low, asynchronous)
-
-
-
-//=============================================================================
-// 1) INTERNAL WIRES/REGISTERS/PARAMETERS DECLARATION
-//=============================================================================
-
-wire [7:0] inst_ad;
-wire [7:0] inst_as;
-wire [11:0] inst_alu;
-wire inst_bw;
-wire inst_irq_rst;
-wire inst_mov;
-wire [15:0] inst_dest;
-wire [15:0] inst_dext;
-wire [15:0] inst_sext;
-wire [7:0] inst_so;
-wire [15:0] inst_src;
-wire [2:0] inst_type;
-wire [7:0] inst_jmp;
-wire [3:0] e_state;
-wire exec_done;
-wire decode_noirq;
-wire cpu_en_s;
-wire cpuoff;
-wire oscoff;
-wire scg1;
-wire por;
-wire gie;
-
-wire [15:0] eu_mab;
-wire [15:0] eu_mdb_in;
-wire [15:0] eu_mdb_out;
-wire [1:0] eu_mb_wr;
-wire eu_mb_en;
-wire [15:0] fe_mab;
-wire [15:0] fe_mdb_in;
-wire fe_mb_en;
-wire fe_pmem_wait;
-
-wire pc_sw_wr;
-wire [15:0] pc_sw;
-wire [15:0] pc;
-wire [15:0] pc_nxt;
-
-wire nmie;
-wire nmi_acc;
-wire nmi_evt;
-
-wire wdtie;
-wire wdtifg_set;
-wire wdtpw_error;
-wire wdttmsel;
-wire wdt_irq;
-wire wdt_reset;
-
-wire dbg_clk;
-wire dbg_rst;
-wire dbg_en_s;
-wire dbg_halt_st;
-wire dbg_halt_cmd;
-wire dbg_mem_en;
-wire dbg_reg_wr;
-wire dbg_cpu_reset;
-wire [15:0] dbg_mem_addr;
-wire [15:0] dbg_mem_dout;
-wire [15:0] dbg_mem_din;
-wire [15:0] dbg_reg_din;
-wire [1:0] dbg_mem_wr;
-
-wire [15:0] per_dout_or;
-wire [15:0] per_dout_sfr;
-wire [15:0] per_dout_wdog;
-wire [15:0] per_dout_mpy;
-wire [15:0] per_dout_clk;
-
-
-//=============================================================================
-// 2) GLOBAL CLOCK & RESET MANAGEMENT
-//=============================================================================
-
-omsp_clock_module clock_module_0 (
-
-// OUTPUTs
- .aclk_en (aclk_en), // ACLK enablex
- .cpu_en_s (cpu_en_s), // Enable CPU code execution (synchronous)
- .dbg_clk (dbg_clk), // Debug unit clock
- .dbg_en_s (dbg_en_s), // Debug interface enable (synchronous)
- .dbg_rst (dbg_rst), // Debug unit reset
- .mclk (mclk), // Main system clock
- .per_dout (per_dout_clk), // Peripheral data output
- .por (por), // Power-on reset
- .puc_rst (puc_rst), // Main system reset
- .smclk_en (smclk_en), // SMCLK enable
-
-// INPUTs
- .cpu_en (cpu_en), // Enable CPU code execution (asynchronous)
- .dbg_cpu_reset(dbg_cpu_reset), // Reset CPU from debug interface
- .dbg_en (dbg_en), // Debug interface enable (asynchronous)
- .dco_clk (dco_clk), // Fast oscillator (fast clock)
- .lfxt_clk (lfxt_clk), // Low frequency oscillator (typ 32kHz)
- .oscoff (oscoff), // Turns off LFXT1 clock input
- .per_addr (per_addr), // Peripheral address
- .per_din (per_din), // Peripheral data input
- .per_en (per_en), // Peripheral enable (high active)
- .per_we (per_we), // Peripheral write enable (high active)
- .reset_n (reset_n), // Reset Pin (low active, asynchronous)
- .scg1 (scg1), // System clock generator 1. Turns off the SMCLK
- .wdt_reset (wdt_reset) // Watchdog-timer reset
-);
-
-
-//=============================================================================
-// 3) FRONTEND (<=> FETCH & DECODE)
-//=============================================================================
-
-omsp_frontend frontend_0 (
-
-// OUTPUTs
- .dbg_halt_st (dbg_halt_st), // Halt/Run status from CPU
- .decode_noirq (decode_noirq), // Frontend decode instruction
- .e_state (e_state), // Execution state
- .exec_done (exec_done), // Execution completed
- .inst_ad (inst_ad), // Decoded Inst: destination addressing mode
- .inst_as (inst_as), // Decoded Inst: source addressing mode
- .inst_alu (inst_alu), // ALU control signals
- .inst_bw (inst_bw), // Decoded Inst: byte width
- .inst_dest (inst_dest), // Decoded Inst: destination (one hot)
- .inst_dext (inst_dext), // Decoded Inst: destination extended instruction word
- .inst_irq_rst (inst_irq_rst), // Decoded Inst: Reset interrupt
- .inst_jmp (inst_jmp), // Decoded Inst: Conditional jump
- .inst_mov (inst_mov), // Decoded Inst: mov instruction
- .inst_sext (inst_sext), // Decoded Inst: source extended instruction word
- .inst_so (inst_so), // Decoded Inst: Single-operand arithmetic
- .inst_src (inst_src), // Decoded Inst: source (one hot)
- .inst_type (inst_type), // Decoded Instruction type
- .irq_acc (irq_acc), // Interrupt request accepted
- .mab (fe_mab), // Frontend Memory address bus
- .mb_en (fe_mb_en), // Frontend Memory bus enable
- .nmi_acc (nmi_acc), // Non-Maskable interrupt request accepted
- .pc (pc), // Program counter
- .pc_nxt (pc_nxt), // Next PC value (for CALL & IRQ)
-
-// INPUTs
- .cpu_en_s (cpu_en_s), // Enable CPU code execution (synchronous)
- .cpuoff (cpuoff), // Turns off the CPU
- .dbg_halt_cmd (dbg_halt_cmd), // Halt CPU command
- .dbg_reg_sel (dbg_mem_addr[3:0]), // Debug selected register for rd/wr access
- .fe_pmem_wait (fe_pmem_wait), // Frontend wait for Instruction fetch
- .gie (gie), // General interrupt enable
- .irq (irq), // Maskable interrupts
- .mclk (mclk), // Main system clock
- .mdb_in (fe_mdb_in), // Frontend Memory data bus input
- .nmi_evt (nmi_evt), // Non-maskable interrupt event
- .pc_sw (pc_sw), // Program counter software value
- .pc_sw_wr (pc_sw_wr), // Program counter software write
- .puc_rst (puc_rst), // Main system reset
- .wdt_irq (wdt_irq) // Watchdog-timer interrupt
-);
-
-
-//=============================================================================
-// 4) EXECUTION UNIT
-//=============================================================================
-
-omsp_execution_unit execution_unit_0 (
-
-// OUTPUTs
- .cpuoff (cpuoff), // Turns off the CPU
- .dbg_reg_din (dbg_reg_din), // Debug unit CPU register data input
- .mab (eu_mab), // Memory address bus
- .mb_en (eu_mb_en), // Memory bus enable
- .mb_wr (eu_mb_wr), // Memory bus write transfer
- .mdb_out (eu_mdb_out), // Memory data bus output
- .oscoff (oscoff), // Turns off LFXT1 clock input
- .pc_sw (pc_sw), // Program counter software value
- .pc_sw_wr (pc_sw_wr), // Program counter software write
- .scg1 (scg1), // System clock generator 1. Turns off the SMCLK
-
-// INPUTs
- .dbg_halt_st (dbg_halt_st), // Halt/Run status from CPU
- .dbg_mem_dout (dbg_mem_dout), // Debug unit data output
- .dbg_reg_wr (dbg_reg_wr), // Debug unit CPU register write
- .e_state (e_state), // Execution state
- .exec_done (exec_done), // Execution completed
- .gie (gie), // General interrupt enable
- .inst_ad (inst_ad), // Decoded Inst: destination addressing mode
- .inst_as (inst_as), // Decoded Inst: source addressing mode
- .inst_alu (inst_alu), // ALU control signals
- .inst_bw (inst_bw), // Decoded Inst: byte width
- .inst_dest (inst_dest), // Decoded Inst: destination (one hot)
- .inst_dext (inst_dext), // Decoded Inst: destination extended instruction word
- .inst_irq_rst (inst_irq_rst), // Decoded Inst: reset interrupt
- .inst_jmp (inst_jmp), // Decoded Inst: Conditional jump
- .inst_mov (inst_mov), // Decoded Inst: mov instruction
- .inst_sext (inst_sext), // Decoded Inst: source extended instruction word
- .inst_so (inst_so), // Decoded Inst: Single-operand arithmetic
- .inst_src (inst_src), // Decoded Inst: source (one hot)
- .inst_type (inst_type), // Decoded Instruction type
- .mclk (mclk), // Main system clock
- .mdb_in (eu_mdb_in), // Memory data bus input
- .pc (pc), // Program counter
- .pc_nxt (pc_nxt), // Next PC value (for CALL & IRQ)
- .puc_rst (puc_rst) // Main system reset
-);
-
-
-//=============================================================================
-// 5) MEMORY BACKBONE
-//=============================================================================
-
-omsp_mem_backbone mem_backbone_0 (
-
-// OUTPUTs
- .dbg_mem_din (dbg_mem_din), // Debug unit Memory data input
- .dmem_addr (dmem_addr), // Data Memory address
- .dmem_cen (dmem_cen), // Data Memory chip enable (low active)
- .dmem_din (dmem_din), // Data Memory data input
- .dmem_wen (dmem_wen), // Data Memory write enable (low active)
- .eu_mdb_in (eu_mdb_in), // Execution Unit Memory data bus input
- .fe_mdb_in (fe_mdb_in), // Frontend Memory data bus input
- .fe_pmem_wait (fe_pmem_wait), // Frontend wait for Instruction fetch
- .per_addr (per_addr), // Peripheral address
- .per_din (per_din), // Peripheral data input
- .per_we (per_we), // Peripheral write enable (high active)
- .per_en (per_en), // Peripheral enable (high active)
- .pmem_addr (pmem_addr), // Program Memory address
- .pmem_cen (pmem_cen), // Program Memory chip enable (low active)
- .pmem_din (pmem_din), // Program Memory data input (optional)
- .pmem_wen (pmem_wen), // Program Memory write enable (low active) (optional)
-
-// INPUTs
- .dbg_halt_st (dbg_halt_st), // Halt/Run status from CPU
- .dbg_mem_addr (dbg_mem_addr), // Debug address for rd/wr access
- .dbg_mem_dout (dbg_mem_dout), // Debug unit data output
- .dbg_mem_en (dbg_mem_en), // Debug unit memory enable
- .dbg_mem_wr (dbg_mem_wr), // Debug unit memory write
- .dmem_dout (dmem_dout), // Data Memory data output
- .eu_mab (eu_mab[15:1]), // Execution Unit Memory address bus
- .eu_mb_en (eu_mb_en), // Execution Unit Memory bus enable
- .eu_mb_wr (eu_mb_wr), // Execution Unit Memory bus write transfer
- .eu_mdb_out (eu_mdb_out), // Execution Unit Memory data bus output
- .fe_mab (fe_mab[15:1]), // Frontend Memory address bus
- .fe_mb_en (fe_mb_en), // Frontend Memory bus enable
- .mclk (mclk), // Main system clock
- .per_dout (per_dout_or), // Peripheral data output
- .pmem_dout (pmem_dout), // Program Memory data output
- .puc_rst (puc_rst) // Main system reset
-);
-
-
-//=============================================================================
-// 6) SPECIAL FUNCTION REGISTERS
-//=============================================================================
-
-omsp_sfr sfr_0 (
-
-// OUTPUTs
- .nmie (nmie), // Non-maskable interrupt enable
- .per_dout (per_dout_sfr), // Peripheral data output
- .wdt_irq (wdt_irq), // Watchdog-timer interrupt
- .wdt_reset (wdt_reset), // Watchdog-timer reset
- .wdtie (wdtie), // Watchdog-timer interrupt enable
-
-// INPUTs
- .mclk (mclk), // Main system clock
- .nmi_acc (nmi_acc), // Non-Maskable interrupt request accepted
- .per_addr (per_addr), // Peripheral address
- .per_din (per_din), // Peripheral data input
- .per_en (per_en), // Peripheral enable (high active)
- .per_we (per_we), // Peripheral write enable (high active)
- .por (por), // Power-on reset
- .puc_rst (puc_rst), // Main system reset
- .wdtifg_clr (irq_acc[10]), // Clear Watchdog-timer interrupt flag
- .wdtifg_set (wdtifg_set), // Set Watchdog-timer interrupt flag
- .wdtpw_error (wdtpw_error), // Watchdog-timer password error
- .wdttmsel (wdttmsel) // Watchdog-timer mode select
-);
-
-
-//=============================================================================
-// 7) WATCHDOG TIMER
-//=============================================================================
-
-omsp_watchdog watchdog_0 (
-
-// OUTPUTs
- .nmi_evt (nmi_evt), // NMI Event
- .per_dout (per_dout_wdog), // Peripheral data output
- .wdtifg_set (wdtifg_set), // Set Watchdog-timer interrupt flag
- .wdtpw_error (wdtpw_error), // Watchdog-timer password error
- .wdttmsel (wdttmsel), // Watchdog-timer mode select
-
-// INPUTs
- .aclk_en (aclk_en), // ACLK enable
- .dbg_freeze (dbg_freeze), // Freeze Watchdog counter
- .mclk (mclk), // Main system clock
- .nmi (nmi), // Non-maskable interrupt (asynchronous)
- .nmie (nmie), // Non-maskable interrupt enable
- .per_addr (per_addr), // Peripheral address
- .per_din (per_din), // Peripheral data input
- .per_en (per_en), // Peripheral enable (high active)
- .per_we (per_we), // Peripheral write enable (high active)
- .puc_rst (puc_rst), // Main system reset
- .smclk_en (smclk_en), // SMCLK enable
- .wdtie (wdtie) // Watchdog-timer interrupt enable
-);
-
-
-//=============================================================================
-// 8) HARDWARE MULTIPLIER
-//=============================================================================
-`ifdef MULTIPLIER
-omsp_multiplier multiplier_0 (
-
-// OUTPUTs
- .per_dout (per_dout_mpy), // Peripheral data output
-
-// INPUTs
- .mclk (mclk), // Main system clock
- .per_addr (per_addr), // Peripheral address
- .per_din (per_din), // Peripheral data input
- .per_en (per_en), // Peripheral enable (high active)
- .per_we (per_we), // Peripheral write enable (high active)
- .puc_rst (puc_rst) // Main system reset
-);
-`else
-assign per_dout_mpy = 16'h0000;
-`endif
-
-//=============================================================================
-// 9) PERIPHERALS' OUTPUT BUS
-//=============================================================================
-
-assign per_dout_or = per_dout |
- per_dout_clk |
- per_dout_sfr |
- per_dout_wdog |
- per_dout_mpy;
-
-
-//=============================================================================
-// 10) DEBUG INTERFACE
-//=============================================================================
-
-`ifdef DBG_EN
-omsp_dbg dbg_0 (
-
-// OUTPUTs
- .dbg_freeze (dbg_freeze), // Freeze peripherals
- .dbg_halt_cmd (dbg_halt_cmd), // Halt CPU command
- .dbg_mem_addr (dbg_mem_addr), // Debug address for rd/wr access
- .dbg_mem_dout (dbg_mem_dout), // Debug unit data output
- .dbg_mem_en (dbg_mem_en), // Debug unit memory enable
- .dbg_mem_wr (dbg_mem_wr), // Debug unit memory write
- .dbg_reg_wr (dbg_reg_wr), // Debug unit CPU register write
- .dbg_cpu_reset(dbg_cpu_reset), // Reset CPU from debug interface
- .dbg_uart_txd (dbg_uart_txd), // Debug interface: UART TXD
-
-// INPUTs
- .cpu_en_s (cpu_en_s), // Enable CPU code execution (synchronous)
- .dbg_clk (dbg_clk), // Debug unit clock
- .dbg_en_s (dbg_en_s), // Debug interface enable (synchronous)
- .dbg_halt_st (dbg_halt_st), // Halt/Run status from CPU
- .dbg_mem_din (dbg_mem_din), // Debug unit Memory data input
- .dbg_reg_din (dbg_reg_din), // Debug unit CPU register data input
- .dbg_rst (dbg_rst), // Debug unit reset
- .dbg_uart_rxd (dbg_uart_rxd), // Debug interface: UART RXD (asynchronous)
- .decode_noirq (decode_noirq), // Frontend decode instruction
- .eu_mab (eu_mab), // Execution-Unit Memory address bus
- .eu_mb_en (eu_mb_en), // Execution-Unit Memory bus enable
- .eu_mb_wr (eu_mb_wr), // Execution-Unit Memory bus write transfer
- .eu_mdb_in (eu_mdb_in), // Memory data bus input
- .eu_mdb_out (eu_mdb_out), // Memory data bus output
- .exec_done (exec_done), // Execution completed
- .fe_mb_en (fe_mb_en), // Frontend Memory bus enable
- .fe_mdb_in (fe_mdb_in), // Frontend Memory data bus input
- .pc (pc), // Program counter
- .puc_rst (puc_rst) // Main system reset
-);
-
-`else
-assign dbg_freeze = ~cpu_en_s;
-assign dbg_halt_cmd = 1'b0;
-assign dbg_mem_addr = 16'h0000;
-assign dbg_mem_dout = 16'h0000;
-assign dbg_mem_en = 1'b0;
-assign dbg_mem_wr = 2'b00;
-assign dbg_reg_wr = 1'b0;
-assign dbg_cpu_reset = 1'b0;
-assign dbg_uart_txd = 1'b0;
-`endif
-
-
-endmodule // openMSP430
-
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_sync_cell.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_frontend.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_frontend.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_frontend.v (nonexistent)
@@ -1,820 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_frontend.v
-//
-// *Module Description:
-// openMSP430 Instruction fetch and decode unit
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_defines.v"
-`endif
-
-module omsp_frontend (
-
-// OUTPUTs
- dbg_halt_st, // Halt/Run status from CPU
- decode_noirq, // Frontend decode instruction
- e_state, // Execution state
- exec_done, // Execution completed
- inst_ad, // Decoded Inst: destination addressing mode
- inst_as, // Decoded Inst: source addressing mode
- inst_alu, // ALU control signals
- inst_bw, // Decoded Inst: byte width
- inst_dest, // Decoded Inst: destination (one hot)
- inst_dext, // Decoded Inst: destination extended instruction word
- inst_irq_rst, // Decoded Inst: Reset interrupt
- inst_jmp, // Decoded Inst: Conditional jump
- inst_mov, // Decoded Inst: mov instruction
- inst_sext, // Decoded Inst: source extended instruction word
- inst_so, // Decoded Inst: Single-operand arithmetic
- inst_src, // Decoded Inst: source (one hot)
- inst_type, // Decoded Instruction type
- irq_acc, // Interrupt request accepted (one-hot signal)
- mab, // Frontend Memory address bus
- mb_en, // Frontend Memory bus enable
- nmi_acc, // Non-Maskable interrupt request accepted
- pc, // Program counter
- pc_nxt, // Next PC value (for CALL & IRQ)
-
-// INPUTs
- cpu_en_s, // Enable CPU code execution (synchronous)
- cpuoff, // Turns off the CPU
- dbg_halt_cmd, // Halt CPU command
- dbg_reg_sel, // Debug selected register for rd/wr access
- fe_pmem_wait, // Frontend wait for Instruction fetch
- gie, // General interrupt enable
- irq, // Maskable interrupts
- mclk, // Main system clock
- mdb_in, // Frontend Memory data bus input
- nmi_evt, // Non-maskable interrupt event
- pc_sw, // Program counter software value
- pc_sw_wr, // Program counter software write
- puc_rst, // Main system reset
- wdt_irq // Watchdog-timer interrupt
-);
-
-// OUTPUTs
-//=========
-output dbg_halt_st; // Halt/Run status from CPU
-output decode_noirq; // Frontend decode instruction
-output [3:0] e_state; // Execution state
-output exec_done; // Execution completed
-output [7:0] inst_ad; // Decoded Inst: destination addressing mode
-output [7:0] inst_as; // Decoded Inst: source addressing mode
-output [11:0] inst_alu; // ALU control signals
-output inst_bw; // Decoded Inst: byte width
-output [15:0] inst_dest; // Decoded Inst: destination (one hot)
-output [15:0] inst_dext; // Decoded Inst: destination extended instruction word
-output inst_irq_rst; // Decoded Inst: Reset interrupt
-output [7:0] inst_jmp; // Decoded Inst: Conditional jump
-output inst_mov; // Decoded Inst: mov instruction
-output [15:0] inst_sext; // Decoded Inst: source extended instruction word
-output [7:0] inst_so; // Decoded Inst: Single-operand arithmetic
-output [15:0] inst_src; // Decoded Inst: source (one hot)
-output [2:0] inst_type; // Decoded Instruction type
-output [13:0] irq_acc; // Interrupt request accepted (one-hot signal)
-output [15:0] mab; // Frontend Memory address bus
-output mb_en; // Frontend Memory bus enable
-output nmi_acc; // Non-Maskable interrupt request accepted
-output [15:0] pc; // Program counter
-output [15:0] pc_nxt; // Next PC value (for CALL & IRQ)
-
-// INPUTs
-//=========
-input cpu_en_s; // Enable CPU code execution (synchronous)
-input cpuoff; // Turns off the CPU
-input dbg_halt_cmd; // Halt CPU command
-input [3:0] dbg_reg_sel; // Debug selected register for rd/wr access
-input fe_pmem_wait; // Frontend wait for Instruction fetch
-input gie; // General interrupt enable
-input [13:0] irq; // Maskable interrupts
-input mclk; // Main system clock
-input [15:0] mdb_in; // Frontend Memory data bus input
-input nmi_evt; // Non-maskable interrupt event
-input [15:0] pc_sw; // Program counter software value
-input pc_sw_wr; // Program counter software write
-input puc_rst; // Main system reset
-input wdt_irq; // Watchdog-timer interrupt
-
-
-//=============================================================================
-// 1) UTILITY FUNCTIONS
-//=============================================================================
-
-// 16 bits one-hot decoder
-function [15:0] one_hot16;
- input [3:0] binary;
- begin
- one_hot16 = 16'h0000;
- one_hot16[binary] = 1'b1;
- end
-endfunction
-
-// 8 bits one-hot decoder
-function [7:0] one_hot8;
- input [2:0] binary;
- begin
- one_hot8 = 8'h00;
- one_hot8[binary] = 1'b1;
- end
-endfunction
-
-
-//=============================================================================
-// 2) Parameter definitions
-//=============================================================================
-
-//
-// 2.1) Instruction State machine definitons
-//-------------------------------------------
-
-parameter I_IRQ_FETCH = `I_IRQ_FETCH;
-parameter I_IRQ_DONE = `I_IRQ_DONE;
-parameter I_DEC = `I_DEC; // New instruction ready for decode
-parameter I_EXT1 = `I_EXT1; // 1st Extension word
-parameter I_EXT2 = `I_EXT2; // 2nd Extension word
-parameter I_IDLE = `I_IDLE; // CPU is in IDLE mode
-
-//
-// 2.2) Execution State machine definitons
-//-------------------------------------------
-
-parameter E_IRQ_0 = `E_IRQ_0;
-parameter E_IRQ_1 = `E_IRQ_1;
-parameter E_IRQ_2 = `E_IRQ_2;
-parameter E_IRQ_3 = `E_IRQ_3;
-parameter E_IRQ_4 = `E_IRQ_4;
-parameter E_SRC_AD = `E_SRC_AD;
-parameter E_SRC_RD = `E_SRC_RD;
-parameter E_SRC_WR = `E_SRC_WR;
-parameter E_DST_AD = `E_DST_AD;
-parameter E_DST_RD = `E_DST_RD;
-parameter E_DST_WR = `E_DST_WR;
-parameter E_EXEC = `E_EXEC;
-parameter E_JUMP = `E_JUMP;
-parameter E_IDLE = `E_IDLE;
-
-
-//=============================================================================
-// 3) FRONTEND STATE MACHINE
-//=============================================================================
-
-// The wire "conv" is used as state bits to calculate the next response
-reg [2:0] i_state;
-reg [2:0] i_state_nxt;
-
-reg [1:0] inst_sz;
-wire [1:0] inst_sz_nxt;
-wire irq_detect;
-wire [2:0] inst_type_nxt;
-wire is_const;
-reg [15:0] sconst_nxt;
-reg [3:0] e_state_nxt;
-
-// CPU on/off through the debug interface or cpu_en port
-wire cpu_halt_cmd = dbg_halt_cmd | ~cpu_en_s;
-
-// States Transitions
-always @(i_state or inst_sz or inst_sz_nxt or pc_sw_wr or exec_done or
- irq_detect or cpuoff or cpu_halt_cmd or e_state)
- case(i_state)
- I_IDLE : i_state_nxt = (irq_detect & ~cpu_halt_cmd) ? I_IRQ_FETCH :
- (~cpuoff & ~cpu_halt_cmd) ? I_DEC : I_IDLE;
- I_IRQ_FETCH: i_state_nxt = I_IRQ_DONE;
- I_IRQ_DONE : i_state_nxt = I_DEC;
- I_DEC : i_state_nxt = irq_detect ? I_IRQ_FETCH :
- (cpuoff | cpu_halt_cmd) & exec_done ? I_IDLE :
- cpu_halt_cmd & (e_state==E_IDLE) ? I_IDLE :
- pc_sw_wr ? I_DEC :
- ~exec_done & ~(e_state==E_IDLE) ? I_DEC : // Wait in decode state
- (inst_sz_nxt!=2'b00) ? I_EXT1 : I_DEC; // until execution is completed
- I_EXT1 : i_state_nxt = irq_detect ? I_IRQ_FETCH :
- pc_sw_wr ? I_DEC :
- (inst_sz!=2'b01) ? I_EXT2 : I_DEC;
- I_EXT2 : i_state_nxt = irq_detect ? I_IRQ_FETCH : I_DEC;
- default : i_state_nxt = I_IRQ_FETCH;
- endcase
-
-// State machine
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) i_state <= I_IRQ_FETCH;
- else i_state <= i_state_nxt;
-
-// Utility signals
-wire decode_noirq = ((i_state==I_DEC) & (exec_done | (e_state==E_IDLE)));
-wire decode = decode_noirq | irq_detect;
-wire fetch = ~((i_state==I_DEC) & ~(exec_done | (e_state==E_IDLE))) & ~(e_state_nxt==E_IDLE);
-
-// Debug interface cpu status
-reg dbg_halt_st;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) dbg_halt_st <= 1'b0;
- else dbg_halt_st <= cpu_halt_cmd & (i_state_nxt==I_IDLE);
-
-
-//=============================================================================
-// 4) INTERRUPT HANDLING
-//=============================================================================
-
-// Detect nmi interrupt
-reg inst_nmi;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_nmi <= 1'b0;
- else if (nmi_evt) inst_nmi <= 1'b1;
- else if (i_state==I_IRQ_DONE) inst_nmi <= 1'b0;
-
-
-// Detect reset interrupt
-reg inst_irq_rst;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_irq_rst <= 1'b1;
- else if (exec_done) inst_irq_rst <= 1'b0;
-
-// Detect other interrupts
-assign irq_detect = (inst_nmi | ((|irq | wdt_irq) & gie)) & ~cpu_halt_cmd & ~dbg_halt_st & (exec_done | (i_state==I_IDLE));
-
-// Select interrupt vector
-reg [3:0] irq_num;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) irq_num <= 4'hf;
- else if (irq_detect) irq_num <= inst_nmi ? 4'he :
- irq[13] ? 4'hd :
- irq[12] ? 4'hc :
- irq[11] ? 4'hb :
- (irq[10] | wdt_irq) ? 4'ha :
- irq[9] ? 4'h9 :
- irq[8] ? 4'h8 :
- irq[7] ? 4'h7 :
- irq[6] ? 4'h6 :
- irq[5] ? 4'h5 :
- irq[4] ? 4'h4 :
- irq[3] ? 4'h3 :
- irq[2] ? 4'h2 :
- irq[1] ? 4'h1 :
- irq[0] ? 4'h0 : 4'hf;
-
-wire [15:0] irq_addr = {11'h7ff, irq_num, 1'b0};
-
-// Interrupt request accepted
-wire [15:0] irq_acc_all = one_hot16(irq_num) & {16{(i_state==I_IRQ_FETCH)}};
-wire [13:0] irq_acc = irq_acc_all[13:0];
-wire nmi_acc = irq_acc_all[14];
-
-
-//=============================================================================
-// 5) FETCH INSTRUCTION
-//=============================================================================
-
-//
-// 5.1) PROGRAM COUNTER & MEMORY INTERFACE
-//-----------------------------------------
-
-// Program counter
-reg [15:0] pc;
-
-// Compute next PC value
-wire [15:0] pc_incr = pc + {14'h0000, fetch, 1'b0};
-wire [15:0] pc_nxt = pc_sw_wr ? pc_sw :
- (i_state==I_IRQ_FETCH) ? irq_addr :
- (i_state==I_IRQ_DONE) ? mdb_in : pc_incr;
-
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) pc <= 16'h0000;
- else pc <= pc_nxt;
-
-// Check if ROM has been busy in order to retry ROM access
-reg pmem_busy;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) pmem_busy <= 1'b0;
- else pmem_busy <= fe_pmem_wait;
-
-// Memory interface
-wire [15:0] mab = pc_nxt;
-wire mb_en = fetch | pc_sw_wr | (i_state==I_IRQ_FETCH) | pmem_busy | (dbg_halt_st & ~cpu_halt_cmd);
-
-
-//
-// 5.2) INSTRUCTION REGISTER
-//--------------------------------
-
-// Instruction register
-wire [15:0] ir = mdb_in;
-
-// Detect if source extension word is required
-wire is_sext = (inst_as[`IDX] | inst_as[`SYMB] | inst_as[`ABS] | inst_as[`IMM]);
-
-// Detect if destination extension word is required
-wire is_dext = (inst_ad[`IDX] | inst_ad[`SYMB] | inst_ad[`ABS]);
-
-// For the Symbolic addressing mode, add -2 to the extension word in order
-// to make up for the PC address
-wire [15:0] ext_incr = ((i_state==I_EXT1) & inst_as[`SYMB]) |
- ((i_state==I_EXT2) & inst_ad[`SYMB]) |
- ((i_state==I_EXT1) & ~inst_as[`SYMB] &
- ~(i_state_nxt==I_EXT2) & inst_ad[`SYMB]) ? 16'hfffe : 16'h0000;
-
-wire [15:0] ext_nxt = ir + ext_incr;
-
-// Store source extension word
-reg [15:0] inst_sext;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_sext <= 16'h0000;
- else if (decode & is_const) inst_sext <= sconst_nxt;
- else if (decode & inst_type_nxt[`INST_JMP]) inst_sext <= {{5{ir[9]}},ir[9:0],1'b0};
- else if ((i_state==I_EXT1) & is_sext) inst_sext <= ext_nxt;
-
-// Source extension word is ready
-wire inst_sext_rdy = (i_state==I_EXT1) & is_sext;
-
-
-// Store destination extension word
-reg [15:0] inst_dext;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_dext <= 16'h0000;
- else if ((i_state==I_EXT1) & ~is_sext) inst_dext <= ext_nxt;
- else if (i_state==I_EXT2) inst_dext <= ext_nxt;
-
-// Destination extension word is ready
-wire inst_dext_rdy = (((i_state==I_EXT1) & ~is_sext) | (i_state==I_EXT2));
-
-
-//=============================================================================
-// 6) DECODE INSTRUCTION
-//=============================================================================
-
-//
-// 6.1) OPCODE: INSTRUCTION TYPE
-//----------------------------------------
-// Instructions type is encoded in a one hot fashion as following:
-//
-// 3'b001: Single-operand arithmetic
-// 3'b010: Conditional jump
-// 3'b100: Two-operand arithmetic
-
-reg [2:0] inst_type;
-assign inst_type_nxt = {(ir[15:14]!=2'b00),
- (ir[15:13]==3'b001),
- (ir[15:13]==3'b000)} & {3{~irq_detect}};
-
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_type <= 3'b000;
- else if (decode) inst_type <= inst_type_nxt;
-
-//
-// 6.2) OPCODE: SINGLE-OPERAND ARITHMETIC
-//----------------------------------------
-// Instructions are encoded in a one hot fashion as following:
-//
-// 8'b00000001: RRC
-// 8'b00000010: SWPB
-// 8'b00000100: RRA
-// 8'b00001000: SXT
-// 8'b00010000: PUSH
-// 8'b00100000: CALL
-// 8'b01000000: RETI
-// 8'b10000000: IRQ
-
-reg [7:0] inst_so;
-wire [7:0] inst_so_nxt = irq_detect ? 8'h80 : (one_hot8(ir[9:7]) & {8{inst_type_nxt[`INST_SO]}});
-
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_so <= 8'h00;
- else if (decode) inst_so <= inst_so_nxt;
-
-//
-// 6.3) OPCODE: CONDITIONAL JUMP
-//--------------------------------
-// Instructions are encoded in a one hot fashion as following:
-//
-// 8'b00000001: JNE/JNZ
-// 8'b00000010: JEQ/JZ
-// 8'b00000100: JNC/JLO
-// 8'b00001000: JC/JHS
-// 8'b00010000: JN
-// 8'b00100000: JGE
-// 8'b01000000: JL
-// 8'b10000000: JMP
-
-reg [2:0] inst_jmp_bin;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_jmp_bin <= 3'h0;
- else if (decode) inst_jmp_bin <= ir[12:10];
-
-wire [7:0] inst_jmp = one_hot8(inst_jmp_bin) & {8{inst_type[`INST_JMP]}};
-
-
-//
-// 6.4) OPCODE: TWO-OPERAND ARITHMETIC
-//-------------------------------------
-// Instructions are encoded in a one hot fashion as following:
-//
-// 12'b000000000001: MOV
-// 12'b000000000010: ADD
-// 12'b000000000100: ADDC
-// 12'b000000001000: SUBC
-// 12'b000000010000: SUB
-// 12'b000000100000: CMP
-// 12'b000001000000: DADD
-// 12'b000010000000: BIT
-// 12'b000100000000: BIC
-// 12'b001000000000: BIS
-// 12'b010000000000: XOR
-// 12'b100000000000: AND
-
-wire [15:0] inst_to_1hot = one_hot16(ir[15:12]) & {16{inst_type_nxt[`INST_TO]}};
-wire [11:0] inst_to_nxt = inst_to_1hot[15:4];
-
-reg inst_mov;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_mov <= 1'b0;
- else if (decode) inst_mov <= inst_to_nxt[`MOV];
-
-
-//
-// 6.5) SOURCE AND DESTINATION REGISTERS
-//---------------------------------------
-
-// Destination register
-reg [3:0] inst_dest_bin;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_dest_bin <= 4'h0;
- else if (decode) inst_dest_bin <= ir[3:0];
-
-wire [15:0] inst_dest = dbg_halt_st ? one_hot16(dbg_reg_sel) :
- inst_type[`INST_JMP] ? 16'h0001 :
- inst_so[`IRQ] |
- inst_so[`PUSH] |
- inst_so[`CALL] ? 16'h0002 :
- one_hot16(inst_dest_bin);
-
-
-// Source register
-reg [3:0] inst_src_bin;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_src_bin <= 4'h0;
- else if (decode) inst_src_bin <= ir[11:8];
-
-wire [15:0] inst_src = inst_type[`INST_TO] ? one_hot16(inst_src_bin) :
- inst_so[`RETI] ? 16'h0002 :
- inst_so[`IRQ] ? 16'h0001 :
- inst_type[`INST_SO] ? one_hot16(inst_dest_bin) : 16'h0000;
-
-
-//
-// 6.6) SOURCE ADDRESSING MODES
-//--------------------------------
-// Source addressing modes are encoded in a one hot fashion as following:
-//
-// 13'b0000000000001: Register direct.
-// 13'b0000000000010: Register indexed.
-// 13'b0000000000100: Register indirect.
-// 13'b0000000001000: Register indirect autoincrement.
-// 13'b0000000010000: Symbolic (operand is in memory at address PC+x).
-// 13'b0000000100000: Immediate (operand is next word in the instruction stream).
-// 13'b0000001000000: Absolute (operand is in memory at address x).
-// 13'b0000010000000: Constant 4.
-// 13'b0000100000000: Constant 8.
-// 13'b0001000000000: Constant 0.
-// 13'b0010000000000: Constant 1.
-// 13'b0100000000000: Constant 2.
-// 13'b1000000000000: Constant -1.
-
-reg [12:0] inst_as_nxt;
-
-wire [3:0] src_reg = inst_type_nxt[`INST_SO] ? ir[3:0] : ir[11:8];
-
-always @(src_reg or ir or inst_type_nxt)
- begin
- if (inst_type_nxt[`INST_JMP])
- inst_as_nxt = 13'b0000000000001;
- else if (src_reg==4'h3) // Addressing mode using R3
- case (ir[5:4])
- 2'b11 : inst_as_nxt = 13'b1000000000000;
- 2'b10 : inst_as_nxt = 13'b0100000000000;
- 2'b01 : inst_as_nxt = 13'b0010000000000;
- default: inst_as_nxt = 13'b0001000000000;
- endcase
- else if (src_reg==4'h2) // Addressing mode using R2
- case (ir[5:4])
- 2'b11 : inst_as_nxt = 13'b0000100000000;
- 2'b10 : inst_as_nxt = 13'b0000010000000;
- 2'b01 : inst_as_nxt = 13'b0000001000000;
- default: inst_as_nxt = 13'b0000000000001;
- endcase
- else if (src_reg==4'h0) // Addressing mode using R0
- case (ir[5:4])
- 2'b11 : inst_as_nxt = 13'b0000000100000;
- 2'b10 : inst_as_nxt = 13'b0000000000100;
- 2'b01 : inst_as_nxt = 13'b0000000010000;
- default: inst_as_nxt = 13'b0000000000001;
- endcase
- else // General Addressing mode
- case (ir[5:4])
- 2'b11 : inst_as_nxt = 13'b0000000001000;
- 2'b10 : inst_as_nxt = 13'b0000000000100;
- 2'b01 : inst_as_nxt = 13'b0000000000010;
- default: inst_as_nxt = 13'b0000000000001;
- endcase
- end
-assign is_const = |inst_as_nxt[12:7];
-
-reg [7:0] inst_as;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_as <= 8'h00;
- else if (decode) inst_as <= {is_const, inst_as_nxt[6:0]};
-
-
-// 13'b0000010000000: Constant 4.
-// 13'b0000100000000: Constant 8.
-// 13'b0001000000000: Constant 0.
-// 13'b0010000000000: Constant 1.
-// 13'b0100000000000: Constant 2.
-// 13'b1000000000000: Constant -1.
-always @(inst_as_nxt)
- begin
- if (inst_as_nxt[7]) sconst_nxt = 16'h0004;
- else if (inst_as_nxt[8]) sconst_nxt = 16'h0008;
- else if (inst_as_nxt[9]) sconst_nxt = 16'h0000;
- else if (inst_as_nxt[10]) sconst_nxt = 16'h0001;
- else if (inst_as_nxt[11]) sconst_nxt = 16'h0002;
- else if (inst_as_nxt[12]) sconst_nxt = 16'hffff;
- else sconst_nxt = 16'h0000;
- end
-
-
-//
-// 6.7) DESTINATION ADDRESSING MODES
-//-----------------------------------
-// Destination addressing modes are encoded in a one hot fashion as following:
-//
-// 8'b00000001: Register direct.
-// 8'b00000010: Register indexed.
-// 8'b00010000: Symbolic (operand is in memory at address PC+x).
-// 8'b01000000: Absolute (operand is in memory at address x).
-
-reg [7:0] inst_ad_nxt;
-
-wire [3:0] dest_reg = ir[3:0];
-
-always @(dest_reg or ir or inst_type_nxt)
- begin
- if (~inst_type_nxt[`INST_TO])
- inst_ad_nxt = 8'b00000000;
- else if (dest_reg==4'h2) // Addressing mode using R2
- case (ir[7])
- 1'b1 : inst_ad_nxt = 8'b01000000;
- default: inst_ad_nxt = 8'b00000001;
- endcase
- else if (dest_reg==4'h0) // Addressing mode using R0
- case (ir[7])
- 1'b1 : inst_ad_nxt = 8'b00010000;
- default: inst_ad_nxt = 8'b00000001;
- endcase
- else // General Addressing mode
- case (ir[7])
- 1'b1 : inst_ad_nxt = 8'b00000010;
- default: inst_ad_nxt = 8'b00000001;
- endcase
- end
-
-reg [7:0] inst_ad;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_ad <= 8'h00;
- else if (decode) inst_ad <= inst_ad_nxt;
-
-
-//
-// 6.8) REMAINING INSTRUCTION DECODING
-//-------------------------------------
-
-// Operation size
-reg inst_bw;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_bw <= 1'b0;
- else if (decode) inst_bw <= ir[6] & ~inst_type_nxt[`INST_JMP] & ~irq_detect & ~cpu_halt_cmd;
-
-// Extended instruction size
-assign inst_sz_nxt = {1'b0, (inst_as_nxt[`IDX] | inst_as_nxt[`SYMB] | inst_as_nxt[`ABS] | inst_as_nxt[`IMM])} +
- {1'b0, ((inst_ad_nxt[`IDX] | inst_ad_nxt[`SYMB] | inst_ad_nxt[`ABS]) & ~inst_type_nxt[`INST_SO])};
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_sz <= 2'b00;
- else if (decode) inst_sz <= inst_sz_nxt;
-
-
-//=============================================================================
-// 7) EXECUTION-UNIT STATE MACHINE
-//=============================================================================
-
-// State machine registers
-reg [3:0] e_state;
-
-
-// State machine control signals
-//--------------------------------
-
-wire src_acalc_pre = inst_as_nxt[`IDX] | inst_as_nxt[`SYMB] | inst_as_nxt[`ABS];
-wire src_rd_pre = inst_as_nxt[`INDIR] | inst_as_nxt[`INDIR_I] | inst_as_nxt[`IMM] | inst_so_nxt[`RETI];
-wire dst_acalc_pre = inst_ad_nxt[`IDX] | inst_ad_nxt[`SYMB] | inst_ad_nxt[`ABS];
-wire dst_acalc = inst_ad[`IDX] | inst_ad[`SYMB] | inst_ad[`ABS];
-wire dst_rd_pre = inst_ad_nxt[`IDX] | inst_so_nxt[`PUSH] | inst_so_nxt[`CALL] | inst_so_nxt[`RETI];
-wire dst_rd = inst_ad[`IDX] | inst_so[`PUSH] | inst_so[`CALL] | inst_so[`RETI];
-
-wire inst_branch = (inst_ad_nxt[`DIR] & (ir[3:0]==4'h0)) | inst_type_nxt[`INST_JMP] | inst_so_nxt[`RETI];
-
-reg exec_jmp;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) exec_jmp <= 1'b0;
- else if (inst_branch & decode) exec_jmp <= 1'b1;
- else if (e_state==E_JUMP) exec_jmp <= 1'b0;
-
-reg exec_dst_wr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) exec_dst_wr <= 1'b0;
- else if (e_state==E_DST_RD) exec_dst_wr <= 1'b1;
- else if (e_state==E_DST_WR) exec_dst_wr <= 1'b0;
-
-reg exec_src_wr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) exec_src_wr <= 1'b0;
- else if (inst_type[`INST_SO] & (e_state==E_SRC_RD)) exec_src_wr <= 1'b1;
- else if ((e_state==E_SRC_WR) || (e_state==E_DST_WR)) exec_src_wr <= 1'b0;
-
-reg exec_dext_rdy;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) exec_dext_rdy <= 1'b0;
- else if (e_state==E_DST_RD) exec_dext_rdy <= 1'b0;
- else if (inst_dext_rdy) exec_dext_rdy <= 1'b1;
-
-// Execution first state
-wire [3:0] e_first_state = ~dbg_halt_st & inst_so_nxt[`IRQ] ? E_IRQ_0 :
- cpu_halt_cmd | (i_state==I_IDLE) ? E_IDLE :
- cpuoff ? E_IDLE :
- src_acalc_pre ? E_SRC_AD :
- src_rd_pre ? E_SRC_RD :
- dst_acalc_pre ? E_DST_AD :
- dst_rd_pre ? E_DST_RD : E_EXEC;
-
-
-// State machine
-//--------------------------------
-
-// States Transitions
-always @(e_state or dst_acalc or dst_rd or inst_sext_rdy or
- inst_dext_rdy or exec_dext_rdy or exec_jmp or exec_dst_wr or
- e_first_state or exec_src_wr)
- case(e_state)
- E_IDLE : e_state_nxt = e_first_state;
- E_IRQ_0 : e_state_nxt = E_IRQ_1;
- E_IRQ_1 : e_state_nxt = E_IRQ_2;
- E_IRQ_2 : e_state_nxt = E_IRQ_3;
- E_IRQ_3 : e_state_nxt = E_IRQ_4;
- E_IRQ_4 : e_state_nxt = E_EXEC;
-
- E_SRC_AD : e_state_nxt = inst_sext_rdy ? E_SRC_RD : E_SRC_AD;
-
- E_SRC_RD : e_state_nxt = dst_acalc ? E_DST_AD :
- dst_rd ? E_DST_RD : E_EXEC;
-
- E_DST_AD : e_state_nxt = (inst_dext_rdy |
- exec_dext_rdy) ? E_DST_RD : E_DST_AD;
-
- E_DST_RD : e_state_nxt = E_EXEC;
-
- E_EXEC : e_state_nxt = exec_dst_wr ? E_DST_WR :
- exec_jmp ? E_JUMP :
- exec_src_wr ? E_SRC_WR : e_first_state;
-
- E_JUMP : e_state_nxt = e_first_state;
- E_DST_WR : e_state_nxt = exec_jmp ? E_JUMP : e_first_state;
- E_SRC_WR : e_state_nxt = e_first_state;
- default : e_state_nxt = E_IRQ_0;
- endcase
-
-// State machine
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) e_state <= E_IRQ_1;
- else e_state <= e_state_nxt;
-
-
-// Frontend State machine control signals
-//----------------------------------------
-
-wire exec_done = exec_jmp ? (e_state==E_JUMP) :
- exec_dst_wr ? (e_state==E_DST_WR) :
- exec_src_wr ? (e_state==E_SRC_WR) : (e_state==E_EXEC);
-
-
-//=============================================================================
-// 8) EXECUTION-UNIT STATE CONTROL
-//=============================================================================
-
-//
-// 8.1) ALU CONTROL SIGNALS
-//-------------------------------------
-//
-// 12'b000000000001: Enable ALU source inverter
-// 12'b000000000010: Enable Incrementer
-// 12'b000000000100: Enable Incrementer on carry bit
-// 12'b000000001000: Select Adder
-// 12'b000000010000: Select AND
-// 12'b000000100000: Select OR
-// 12'b000001000000: Select XOR
-// 12'b000010000000: Select DADD
-// 12'b000100000000: Update N, Z & C (C=~Z)
-// 12'b001000000000: Update all status bits
-// 12'b010000000000: Update status bit for XOR instruction
-// 12'b100000000000: Don't write to destination
-
-reg [11:0] inst_alu;
-
-wire alu_src_inv = inst_to_nxt[`SUB] | inst_to_nxt[`SUBC] |
- inst_to_nxt[`CMP] | inst_to_nxt[`BIC] ;
-
-wire alu_inc = inst_to_nxt[`SUB] | inst_to_nxt[`CMP];
-
-wire alu_inc_c = inst_to_nxt[`ADDC] | inst_to_nxt[`DADD] |
- inst_to_nxt[`SUBC];
-
-wire alu_add = inst_to_nxt[`ADD] | inst_to_nxt[`ADDC] |
- inst_to_nxt[`SUB] | inst_to_nxt[`SUBC] |
- inst_to_nxt[`CMP] | inst_type_nxt[`INST_JMP] |
- inst_so_nxt[`RETI];
-
-
-wire alu_and = inst_to_nxt[`AND] | inst_to_nxt[`BIC] |
- inst_to_nxt[`BIT];
-
-wire alu_or = inst_to_nxt[`BIS];
-
-wire alu_xor = inst_to_nxt[`XOR];
-
-wire alu_dadd = inst_to_nxt[`DADD];
-
-wire alu_stat_7 = inst_to_nxt[`BIT] | inst_to_nxt[`AND] |
- inst_so_nxt[`SXT];
-
-wire alu_stat_f = inst_to_nxt[`ADD] | inst_to_nxt[`ADDC] |
- inst_to_nxt[`SUB] | inst_to_nxt[`SUBC] |
- inst_to_nxt[`CMP] | inst_to_nxt[`DADD] |
- inst_to_nxt[`BIT] | inst_to_nxt[`XOR] |
- inst_to_nxt[`AND] |
- inst_so_nxt[`RRC] | inst_so_nxt[`RRA] |
- inst_so_nxt[`SXT];
-
-wire alu_shift = inst_so_nxt[`RRC] | inst_so_nxt[`RRA];
-
-wire exec_no_wr = inst_to_nxt[`CMP] | inst_to_nxt[`BIT];
-
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) inst_alu <= 12'h000;
- else if (decode) inst_alu <= {exec_no_wr,
- alu_shift,
- alu_stat_f,
- alu_stat_7,
- alu_dadd,
- alu_xor,
- alu_or,
- alu_and,
- alu_add,
- alu_inc_c,
- alu_inc,
- alu_src_inv};
-
-
-endmodule // omsp_frontend
-
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_frontend.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_alu.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_alu.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_alu.v (nonexistent)
@@ -1,253 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_alu.v
-//
-// *Module Description:
-// openMSP430 ALU
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_defines.v"
-`endif
-
-module omsp_alu (
-
-// OUTPUTs
- alu_out, // ALU output value
- alu_out_add, // ALU adder output value
- alu_stat, // ALU Status {V,N,Z,C}
- alu_stat_wr, // ALU Status write {V,N,Z,C}
-
-// INPUTs
- dbg_halt_st, // Halt/Run status from CPU
- exec_cycle, // Instruction execution cycle
- inst_alu, // ALU control signals
- inst_bw, // Decoded Inst: byte width
- inst_jmp, // Decoded Inst: Conditional jump
- inst_so, // Single-operand arithmetic
- op_dst, // Destination operand
- op_src, // Source operand
- status // R2 Status {V,N,Z,C}
-);
-
-// OUTPUTs
-//=========
-output [15:0] alu_out; // ALU output value
-output [15:0] alu_out_add; // ALU adder output value
-output [3:0] alu_stat; // ALU Status {V,N,Z,C}
-output [3:0] alu_stat_wr; // ALU Status write {V,N,Z,C}
-
-// INPUTs
-//=========
-input dbg_halt_st; // Halt/Run status from CPU
-input exec_cycle; // Instruction execution cycle
-input [11:0] inst_alu; // ALU control signals
-input inst_bw; // Decoded Inst: byte width
-input [7:0] inst_jmp; // Decoded Inst: Conditional jump
-input [7:0] inst_so; // Single-operand arithmetic
-input [15:0] op_dst; // Destination operand
-input [15:0] op_src; // Source operand
-input [3:0] status; // R2 Status {V,N,Z,C}
-
-
-//=============================================================================
-// 1) FUNCTIONS
-//=============================================================================
-
-function [4:0] bcd_add;
-
- input [3:0] X;
- input [3:0] Y;
- input C;
-
- reg [4:0] Z;
- begin
- Z = {1'b0,X}+{1'b0,Y}+{4'b0,C};
- if (Z<5'd10) bcd_add = Z;
- else bcd_add = Z+5'd6;
- end
-
-endfunction
-
-
-//=============================================================================
-// 2) INSTRUCTION FETCH/DECODE CONTROL STATE MACHINE
-//=============================================================================
-// SINGLE-OPERAND ARITHMETIC:
-//-----------------------------------------------------------------------------
-// Mnemonic S-Reg, Operation Status bits
-// D-Reg, V N Z C
-//
-// RRC dst C->MSB->...LSB->C * * * *
-// RRA dst MSB->MSB->...LSB->C 0 * * *
-// SWPB dst Swap bytes - - - -
-// SXT dst Bit7->Bit8...Bit15 0 * * *
-// PUSH src SP-2->SP, src->@SP - - - -
-// CALL dst SP-2->SP, PC+2->@SP, dst->PC - - - -
-// RETI TOS->SR, SP+2->SP, TOS->PC, SP+2->SP * * * *
-//
-//-----------------------------------------------------------------------------
-// TWO-OPERAND ARITHMETIC:
-//-----------------------------------------------------------------------------
-// Mnemonic S-Reg, Operation Status bits
-// D-Reg, V N Z C
-//
-// MOV src,dst src -> dst - - - -
-// ADD src,dst src + dst -> dst * * * *
-// ADDC src,dst src + dst + C -> dst * * * *
-// SUB src,dst dst + ~src + 1 -> dst * * * *
-// SUBC src,dst dst + ~src + C -> dst * * * *
-// CMP src,dst dst + ~src + 1 * * * *
-// DADD src,dst src + dst + C -> dst (decimaly) * * * *
-// BIT src,dst src & dst 0 * * *
-// BIC src,dst ~src & dst -> dst - - - -
-// BIS src,dst src | dst -> dst - - - -
-// XOR src,dst src ^ dst -> dst * * * *
-// AND src,dst src & dst -> dst 0 * * *
-//
-//-----------------------------------------------------------------------------
-// * the status bit is affected
-// - the status bit is not affected
-// 0 the status bit is cleared
-// 1 the status bit is set
-//-----------------------------------------------------------------------------
-
-// Invert source for substract and compare instructions.
-wire op_src_inv_cmd = exec_cycle & (inst_alu[`ALU_SRC_INV]);
-wire [15:0] op_src_inv = {16{op_src_inv_cmd}} ^ op_src;
-
-
-// Mask the bit 8 for the Byte instructions for correct flags generation
-wire op_bit8_msk = ~exec_cycle | ~inst_bw;
-wire [16:0] op_src_in = {1'b0, {op_src_inv[15:8] & {8{op_bit8_msk}}}, op_src_inv[7:0]};
-wire [16:0] op_dst_in = {1'b0, {op_dst[15:8] & {8{op_bit8_msk}}}, op_dst[7:0]};
-
-// Clear the source operand (= jump offset) for conditional jumps
-wire jmp_not_taken = (inst_jmp[`JL] & ~(status[3]^status[2])) |
- (inst_jmp[`JGE] & (status[3]^status[2])) |
- (inst_jmp[`JN] & ~status[2]) |
- (inst_jmp[`JC] & ~status[0]) |
- (inst_jmp[`JNC] & status[0]) |
- (inst_jmp[`JEQ] & ~status[1]) |
- (inst_jmp[`JNE] & status[1]);
-wire [16:0] op_src_in_jmp = op_src_in & {17{~jmp_not_taken}};
-
-// Adder / AND / OR / XOR
-wire [16:0] alu_add = op_src_in_jmp + op_dst_in;
-wire [16:0] alu_and = op_src_in & op_dst_in;
-wire [16:0] alu_or = op_src_in | op_dst_in;
-wire [16:0] alu_xor = op_src_in ^ op_dst_in;
-
-
-// Incrementer
-wire alu_inc = exec_cycle & ((inst_alu[`ALU_INC_C] & status[0]) |
- inst_alu[`ALU_INC]);
-wire [16:0] alu_add_inc = alu_add + {16'h0000, alu_inc};
-
-
-
-// Decimal adder (DADD)
-wire [4:0] alu_dadd0 = bcd_add(op_src_in[3:0], op_dst_in[3:0], status[0]);
-wire [4:0] alu_dadd1 = bcd_add(op_src_in[7:4], op_dst_in[7:4], alu_dadd0[4]);
-wire [4:0] alu_dadd2 = bcd_add(op_src_in[11:8], op_dst_in[11:8], alu_dadd1[4]);
-wire [4:0] alu_dadd3 = bcd_add(op_src_in[15:12], op_dst_in[15:12],alu_dadd2[4]);
-wire [16:0] alu_dadd = {alu_dadd3, alu_dadd2[3:0], alu_dadd1[3:0], alu_dadd0[3:0]};
-
-
-// Shifter for rotate instructions (RRC & RRA)
-wire alu_shift_msb = inst_so[`RRC] ? status[0] :
- inst_bw ? op_src[7] : op_src[15];
-wire alu_shift_7 = inst_bw ? alu_shift_msb : op_src[8];
-wire [16:0] alu_shift = {1'b0, alu_shift_msb, op_src[15:9], alu_shift_7, op_src[7:1]};
-
-
-// Swap bytes / Extend Sign
-wire [16:0] alu_swpb = {1'b0, op_src[7:0],op_src[15:8]};
-wire [16:0] alu_sxt = {1'b0, {8{op_src[7]}},op_src[7:0]};
-
-
-// Combine short paths toghether to simplify final ALU mux
-wire alu_short_thro = ~(inst_alu[`ALU_AND] |
- inst_alu[`ALU_OR] |
- inst_alu[`ALU_XOR] |
- inst_alu[`ALU_SHIFT] |
- inst_so[`SWPB] |
- inst_so[`SXT]);
-
-wire [16:0] alu_short = ({17{inst_alu[`ALU_AND]}} & alu_and) |
- ({17{inst_alu[`ALU_OR]}} & alu_or) |
- ({17{inst_alu[`ALU_XOR]}} & alu_xor) |
- ({17{inst_alu[`ALU_SHIFT]}} & alu_shift) |
- ({17{inst_so[`SWPB]}} & alu_swpb) |
- ({17{inst_so[`SXT]}} & alu_sxt) |
- ({17{alu_short_thro}} & op_src_in);
-
-
-// ALU output mux
-wire [16:0] alu_out_nxt = (inst_so[`IRQ] | dbg_halt_st |
- inst_alu[`ALU_ADD]) ? alu_add_inc :
- inst_alu[`ALU_DADD] ? alu_dadd : alu_short;
-
-assign alu_out = alu_out_nxt[15:0];
-assign alu_out_add = alu_add[15:0];
-
-
-//-----------------------------------------------------------------------------
-// STATUS FLAG GENERATION
-//-----------------------------------------------------------------------------
-
-wire V_xor = inst_bw ? (op_src_in[7] & op_dst_in[7]) :
- (op_src_in[15] & op_dst_in[15]);
-
-wire V = inst_bw ? ((~op_src_in[7] & ~op_dst_in[7] & alu_out[7]) |
- ( op_src_in[7] & op_dst_in[7] & ~alu_out[7])) :
- ((~op_src_in[15] & ~op_dst_in[15] & alu_out[15]) |
- ( op_src_in[15] & op_dst_in[15] & ~alu_out[15]));
-
-wire N = inst_bw ? alu_out[7] : alu_out[15];
-wire Z = inst_bw ? (alu_out[7:0]==0) : (alu_out==0);
-wire C = inst_bw ? alu_out[8] : alu_out_nxt[16];
-
-assign alu_stat = inst_alu[`ALU_SHIFT] ? {1'b0, N,Z,op_src_in[0]} :
- inst_alu[`ALU_STAT_7] ? {1'b0, N,Z,~Z} :
- inst_alu[`ALU_XOR] ? {V_xor,N,Z,~Z} : {V,N,Z,C};
-
-assign alu_stat_wr = (inst_alu[`ALU_STAT_F] & exec_cycle) ? 4'b1111 : 4'b0000;
-
-
-endmodule // omsp_alu
-
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_alu.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_register_file.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_register_file.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_register_file.v (nonexistent)
@@ -1,350 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_register_file.v
-//
-// *Module Description:
-// openMSP430 Register files
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_defines.v"
-`endif
-
-module omsp_register_file (
-
-// OUTPUTs
- cpuoff, // Turns off the CPU
- gie, // General interrupt enable
- oscoff, // Turns off LFXT1 clock input
- pc_sw, // Program counter software value
- pc_sw_wr, // Program counter software write
- reg_dest, // Selected register destination content
- reg_src, // Selected register source content
- scg1, // System clock generator 1. Turns off the SMCLK
- status, // R2 Status {V,N,Z,C}
-
-// INPUTs
- alu_stat, // ALU Status {V,N,Z,C}
- alu_stat_wr, // ALU Status write {V,N,Z,C}
- inst_bw, // Decoded Inst: byte width
- inst_dest, // Register destination selection
- inst_src, // Register source selection
- mclk, // Main system clock
- pc, // Program counter
- puc_rst, // Main system reset
- reg_dest_val, // Selected register destination value
- reg_dest_wr, // Write selected register destination
- reg_pc_call, // Trigger PC update for a CALL instruction
- reg_sp_val, // Stack Pointer next value
- reg_sp_wr, // Stack Pointer write
- reg_sr_wr, // Status register update for RETI instruction
- reg_sr_clr, // Status register clear for interrupts
- reg_incr // Increment source register
-);
-
-// OUTPUTs
-//=========
-output cpuoff; // Turns off the CPU
-output gie; // General interrupt enable
-output oscoff; // Turns off LFXT1 clock input
-output [15:0] pc_sw; // Program counter software value
-output pc_sw_wr; // Program counter software write
-output [15:0] reg_dest; // Selected register destination content
-output [15:0] reg_src; // Selected register source content
-output scg1; // System clock generator 1. Turns off the SMCLK
-output [3:0] status; // R2 Status {V,N,Z,C}
-
-// INPUTs
-//=========
-input [3:0] alu_stat; // ALU Status {V,N,Z,C}
-input [3:0] alu_stat_wr; // ALU Status write {V,N,Z,C}
-input inst_bw; // Decoded Inst: byte width
-input [15:0] inst_dest; // Register destination selection
-input [15:0] inst_src; // Register source selection
-input mclk; // Main system clock
-input [15:0] pc; // Program counter
-input puc_rst; // Main system reset
-input [15:0] reg_dest_val; // Selected register destination value
-input reg_dest_wr; // Write selected register destination
-input reg_pc_call; // Trigger PC update for a CALL instruction
-input [15:0] reg_sp_val; // Stack Pointer next value
-input reg_sp_wr; // Stack Pointer write
-input reg_sr_wr; // Status register update for RETI instruction
-input reg_sr_clr; // Status register clear for interrupts
-input reg_incr; // Increment source register
-
-
-//=============================================================================
-// 1) AUTOINCREMENT UNIT
-//=============================================================================
-
-wire [15:0] incr_op = inst_bw ? 16'h0001 : 16'h0002;
-wire [15:0] reg_incr_val = reg_src+incr_op;
-
-wire [15:0] reg_dest_val_in = inst_bw ? {8'h00,reg_dest_val[7:0]} : reg_dest_val;
-
-
-//=============================================================================
-// 2) SPECIAL REGISTERS (R1/R2/R3)
-//=============================================================================
-
-// Source input selection mask (for interrupt support)
-//-----------------------------------------------------
-
-wire [15:0] inst_src_in = reg_sr_clr ? 16'h0004 : inst_src;
-
-
-// R0: Program counter
-//---------------------
-
-wire [15:0] r0 = pc;
-
-wire [15:0] pc_sw = reg_dest_val_in;
-wire pc_sw_wr = (inst_dest[0] & reg_dest_wr) | reg_pc_call;
-
-
-// R1: Stack pointer
-//-------------------
-reg [15:0] r1;
-wire r1_wr = inst_dest[1] & reg_dest_wr;
-wire r1_inc = inst_src_in[1] & reg_incr;
-
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r1 <= 16'h0000;
- else if (r1_wr) r1 <= reg_dest_val_in & 16'hfffe;
- else if (reg_sp_wr) r1 <= reg_sp_val & 16'hfffe;
- else if (r1_inc) r1 <= reg_incr_val & 16'hfffe;
-
-
-// R2: Status register
-//---------------------
-reg [15:0] r2;
-wire r2_wr = (inst_dest[2] & reg_dest_wr) | reg_sr_wr;
-
-wire r2_c = alu_stat_wr[0] ? alu_stat[0] :
- r2_wr ? reg_dest_val_in[0] : r2[0]; // C
-
-wire r2_z = alu_stat_wr[1] ? alu_stat[1] :
- r2_wr ? reg_dest_val_in[1] : r2[1]; // Z
-
-wire r2_n = alu_stat_wr[2] ? alu_stat[2] :
- r2_wr ? reg_dest_val_in[2] : r2[2]; // N
-
-wire [7:3] r2_nxt = r2_wr ? reg_dest_val_in[7:3] : r2[7:3];
-
-wire r2_v = alu_stat_wr[3] ? alu_stat[3] :
- r2_wr ? reg_dest_val_in[8] : r2[8]; // V
-
-
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r2 <= 16'h0000;
- else if (reg_sr_clr) r2 <= 16'h0000;
- else r2 <= {7'h00, r2_v, r2_nxt, r2_n, r2_z, r2_c};
-
-assign status = {r2[8], r2[2:0]};
-assign gie = r2[3];
-assign cpuoff = r2[4] | (r2_nxt[4] & r2_wr);
-assign oscoff = r2[5];
-assign scg1 = r2[7];
-
-
-// R3: Constant generator
-//------------------------
-reg [15:0] r3;
-wire r3_wr = inst_dest[3] & reg_dest_wr;
-wire r3_inc = inst_src_in[3] & reg_incr;
-
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r3 <= 16'h0000;
- else if (r3_wr) r3 <= reg_dest_val_in;
- else if (r3_inc) r3 <= reg_incr_val;
-
-
-//=============================================================================
-// 4) GENERAL PURPOSE REGISTERS (R4...R15)
-//=============================================================================
-
-// R4
-reg [15:0] r4;
-wire r4_wr = inst_dest[4] & reg_dest_wr;
-wire r4_inc = inst_src_in[4] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r4 <= 16'h0000;
- else if (r4_wr) r4 <= reg_dest_val_in;
- else if (r4_inc) r4 <= reg_incr_val;
-
-// R5
-reg [15:0] r5;
-wire r5_wr = inst_dest[5] & reg_dest_wr;
-wire r5_inc = inst_src_in[5] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r5 <= 16'h0000;
- else if (r5_wr) r5 <= reg_dest_val_in;
- else if (r5_inc) r5 <= reg_incr_val;
-
-// R6
-reg [15:0] r6;
-wire r6_wr = inst_dest[6] & reg_dest_wr;
-wire r6_inc = inst_src_in[6] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r6 <= 16'h0000;
- else if (r6_wr) r6 <= reg_dest_val_in;
- else if (r6_inc) r6 <= reg_incr_val;
-
-// R7
-reg [15:0] r7;
-wire r7_wr = inst_dest[7] & reg_dest_wr;
-wire r7_inc = inst_src_in[7] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r7 <= 16'h0000;
- else if (r7_wr) r7 <= reg_dest_val_in;
- else if (r7_inc) r7 <= reg_incr_val;
-
-// R8
-reg [15:0] r8;
-wire r8_wr = inst_dest[8] & reg_dest_wr;
-wire r8_inc = inst_src_in[8] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r8 <= 16'h0000;
- else if (r8_wr) r8 <= reg_dest_val_in;
- else if (r8_inc) r8 <= reg_incr_val;
-
-// R9
-reg [15:0] r9;
-wire r9_wr = inst_dest[9] & reg_dest_wr;
-wire r9_inc = inst_src_in[9] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r9 <= 16'h0000;
- else if (r9_wr) r9 <= reg_dest_val_in;
- else if (r9_inc) r9 <= reg_incr_val;
-
-// R10
-reg [15:0] r10;
-wire r10_wr = inst_dest[10] & reg_dest_wr;
-wire r10_inc = inst_src_in[10] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r10 <= 16'h0000;
- else if (r10_wr) r10 <= reg_dest_val_in;
- else if (r10_inc) r10 <= reg_incr_val;
-
-// R11
-reg [15:0] r11;
-wire r11_wr = inst_dest[11] & reg_dest_wr;
-wire r11_inc = inst_src_in[11] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r11 <= 16'h0000;
- else if (r11_wr) r11 <= reg_dest_val_in;
- else if (r11_inc) r11 <= reg_incr_val;
-
-// R12
-reg [15:0] r12;
-wire r12_wr = inst_dest[12] & reg_dest_wr;
-wire r12_inc = inst_src_in[12] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r12 <= 16'h0000;
- else if (r12_wr) r12 <= reg_dest_val_in;
- else if (r12_inc) r12 <= reg_incr_val;
-
-// R13
-reg [15:0] r13;
-wire r13_wr = inst_dest[13] & reg_dest_wr;
-wire r13_inc = inst_src_in[13] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r13 <= 16'h0000;
- else if (r13_wr) r13 <= reg_dest_val_in;
- else if (r13_inc) r13 <= reg_incr_val;
-
-// R14
-reg [15:0] r14;
-wire r14_wr = inst_dest[14] & reg_dest_wr;
-wire r14_inc = inst_src_in[14] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r14 <= 16'h0000;
- else if (r14_wr) r14 <= reg_dest_val_in;
- else if (r14_inc) r14 <= reg_incr_val;
-
-// R15
-reg [15:0] r15;
-wire r15_wr = inst_dest[15] & reg_dest_wr;
-wire r15_inc = inst_src_in[15] & reg_incr;
-always @(posedge mclk or posedge puc_rst)
- if (puc_rst) r15 <= 16'h0000;
- else if (r15_wr) r15 <= reg_dest_val_in;
- else if (r15_inc) r15 <= reg_incr_val;
-
-
-//=============================================================================
-// 5) READ MUX
-//=============================================================================
-
-assign reg_src = (r0 & {16{inst_src_in[0]}}) |
- (r1 & {16{inst_src_in[1]}}) |
- (r2 & {16{inst_src_in[2]}}) |
- (r3 & {16{inst_src_in[3]}}) |
- (r4 & {16{inst_src_in[4]}}) |
- (r5 & {16{inst_src_in[5]}}) |
- (r6 & {16{inst_src_in[6]}}) |
- (r7 & {16{inst_src_in[7]}}) |
- (r8 & {16{inst_src_in[8]}}) |
- (r9 & {16{inst_src_in[9]}}) |
- (r10 & {16{inst_src_in[10]}}) |
- (r11 & {16{inst_src_in[11]}}) |
- (r12 & {16{inst_src_in[12]}}) |
- (r13 & {16{inst_src_in[13]}}) |
- (r14 & {16{inst_src_in[14]}}) |
- (r15 & {16{inst_src_in[15]}});
-
-assign reg_dest = (r0 & {16{inst_dest[0]}}) |
- (r1 & {16{inst_dest[1]}}) |
- (r2 & {16{inst_dest[2]}}) |
- (r3 & {16{inst_dest[3]}}) |
- (r4 & {16{inst_dest[4]}}) |
- (r5 & {16{inst_dest[5]}}) |
- (r6 & {16{inst_dest[6]}}) |
- (r7 & {16{inst_dest[7]}}) |
- (r8 & {16{inst_dest[8]}}) |
- (r9 & {16{inst_dest[9]}}) |
- (r10 & {16{inst_dest[10]}}) |
- (r11 & {16{inst_dest[11]}}) |
- (r12 & {16{inst_dest[12]}}) |
- (r13 & {16{inst_dest[13]}}) |
- (r14 & {16{inst_dest[14]}}) |
- (r15 & {16{inst_dest[15]}});
-
-
-endmodule // omsp_register_file
-
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/periph/template_periph_8b.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/periph/omsp_gpio.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/periph/omsp_gpio.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/periph/omsp_gpio.v (nonexistent)
@@ -1,809 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_gpio.v
-//
-// *Module Description:
-// Digital I/O interface
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-
-module omsp_gpio (
-
-// OUTPUTs
- irq_port1, // Port 1 interrupt
- irq_port2, // Port 2 interrupt
- p1_dout, // Port 1 data output
- p1_dout_en, // Port 1 data output enable
- p1_sel, // Port 1 function select
- p2_dout, // Port 2 data output
- p2_dout_en, // Port 2 data output enable
- p2_sel, // Port 2 function select
- p3_dout, // Port 3 data output
- p3_dout_en, // Port 3 data output enable
- p3_sel, // Port 3 function select
- p4_dout, // Port 4 data output
- p4_dout_en, // Port 4 data output enable
- p4_sel, // Port 4 function select
- p5_dout, // Port 5 data output
- p5_dout_en, // Port 5 data output enable
- p5_sel, // Port 5 function select
- p6_dout, // Port 6 data output
- p6_dout_en, // Port 6 data output enable
- p6_sel, // Port 6 function select
- per_dout, // Peripheral data output
-
-// INPUTs
- mclk, // Main system clock
- p1_din, // Port 1 data input
- p2_din, // Port 2 data input
- p3_din, // Port 3 data input
- p4_din, // Port 4 data input
- p5_din, // Port 5 data input
- p6_din, // Port 6 data input
- per_addr, // Peripheral address
- per_din, // Peripheral data input
- per_en, // Peripheral enable (high active)
- per_we, // Peripheral write enable (high active)
- puc_rst // Main system reset
-);
-
-// PARAMETERs
-//============
-parameter P1_EN = 1'b1; // Enable Port 1
-parameter P2_EN = 1'b1; // Enable Port 2
-parameter P3_EN = 1'b0; // Enable Port 3
-parameter P4_EN = 1'b0; // Enable Port 4
-parameter P5_EN = 1'b0; // Enable Port 5
-parameter P6_EN = 1'b0; // Enable Port 6
-
-
-// OUTPUTs
-//=========
-output irq_port1; // Port 1 interrupt
-output irq_port2; // Port 2 interrupt
-output [7:0] p1_dout; // Port 1 data output
-output [7:0] p1_dout_en; // Port 1 data output enable
-output [7:0] p1_sel; // Port 1 function select
-output [7:0] p2_dout; // Port 2 data output
-output [7:0] p2_dout_en; // Port 2 data output enable
-output [7:0] p2_sel; // Port 2 function select
-output [7:0] p3_dout; // Port 3 data output
-output [7:0] p3_dout_en; // Port 3 data output enable
-output [7:0] p3_sel; // Port 3 function select
-output [7:0] p4_dout; // Port 4 data output
-output [7:0] p4_dout_en; // Port 4 data output enable
-output [7:0] p4_sel; // Port 4 function select
-output [7:0] p5_dout; // Port 5 data output
-output [7:0] p5_dout_en; // Port 5 data output enable
-output [7:0] p5_sel; // Port 5 function select
-output [7:0] p6_dout; // Port 6 data output
-output [7:0] p6_dout_en; // Port 6 data output enable
-output [7:0] p6_sel; // Port 6 function select
-output [15:0] per_dout; // Peripheral data output
-
-// INPUTs
-//=========
-input mclk; // Main system clock
-input [7:0] p1_din; // Port 1 data input
-input [7:0] p2_din; // Port 2 data input
-input [7:0] p3_din; // Port 3 data input
-input [7:0] p4_din; // Port 4 data input
-input [7:0] p5_din; // Port 5 data input
-input [7:0] p6_din; // Port 6 data input
-input [13:0] per_addr; // Peripheral address
-input [15:0] per_din; // Peripheral data input
-input per_en; // Peripheral enable (high active)
-input [1:0] per_we; // Peripheral write enable (high active)
-input puc_rst; // Main system reset
-
-
-//=============================================================================
-// 1) PARAMETER DECLARATION
-//=============================================================================
-
-// Masks
-parameter P1_EN_MSK = {8{P1_EN[0]}};
-parameter P2_EN_MSK = {8{P2_EN[0]}};
-parameter P3_EN_MSK = {8{P3_EN[0]}};
-parameter P4_EN_MSK = {8{P4_EN[0]}};
-parameter P5_EN_MSK = {8{P5_EN[0]}};
-parameter P6_EN_MSK = {8{P6_EN[0]}};
-
-// Register base address (must be aligned to decoder bit width)
-parameter [14:0] BASE_ADDR = 15'h0000;
-
-// Decoder bit width (defines how many bits are considered for address decoding)
-parameter DEC_WD = 6;
-
-// Register addresses offset
-parameter [DEC_WD-1:0] P1IN = 'h20, // Port 1
- P1OUT = 'h21,
- P1DIR = 'h22,
- P1IFG = 'h23,
- P1IES = 'h24,
- P1IE = 'h25,
- P1SEL = 'h26,
- P2IN = 'h28, // Port 2
- P2OUT = 'h29,
- P2DIR = 'h2A,
- P2IFG = 'h2B,
- P2IES = 'h2C,
- P2IE = 'h2D,
- P2SEL = 'h2E,
- P3IN = 'h18, // Port 3
- P3OUT = 'h19,
- P3DIR = 'h1A,
- P3SEL = 'h1B,
- P4IN = 'h1C, // Port 4
- P4OUT = 'h1D,
- P4DIR = 'h1E,
- P4SEL = 'h1F,
- P5IN = 'h30, // Port 5
- P5OUT = 'h31,
- P5DIR = 'h32,
- P5SEL = 'h33,
- P6IN = 'h34, // Port 6
- P6OUT = 'h35,
- P6DIR = 'h36,
- P6SEL = 'h37;
-
-// Register one-hot decoder utilities
-parameter DEC_SZ = 2**DEC_WD;
-parameter [DEC_SZ-1:0] BASE_REG = {{DEC_SZ-1{1'b0}}, 1'b1};
-
-// Register one-hot decoder
-parameter [DEC_SZ-1:0] P1IN_D = (BASE_REG << P1IN), // Port 1
- P1OUT_D = (BASE_REG << P1OUT),
- P1DIR_D = (BASE_REG << P1DIR),
- P1IFG_D = (BASE_REG << P1IFG),
- P1IES_D = (BASE_REG << P1IES),
- P1IE_D = (BASE_REG << P1IE),
- P1SEL_D = (BASE_REG << P1SEL),
- P2IN_D = (BASE_REG << P2IN), // Port 2
- P2OUT_D = (BASE_REG << P2OUT),
- P2DIR_D = (BASE_REG << P2DIR),
- P2IFG_D = (BASE_REG << P2IFG),
- P2IES_D = (BASE_REG << P2IES),
- P2IE_D = (BASE_REG << P2IE),
- P2SEL_D = (BASE_REG << P2SEL),
- P3IN_D = (BASE_REG << P3IN), // Port 3
- P3OUT_D = (BASE_REG << P3OUT),
- P3DIR_D = (BASE_REG << P3DIR),
- P3SEL_D = (BASE_REG << P3SEL),
- P4IN_D = (BASE_REG << P4IN), // Port 4
- P4OUT_D = (BASE_REG << P4OUT),
- P4DIR_D = (BASE_REG << P4DIR),
- P4SEL_D = (BASE_REG << P4SEL),
- P5IN_D = (BASE_REG << P5IN), // Port 5
- P5OUT_D = (BASE_REG << P5OUT),
- P5DIR_D = (BASE_REG << P5DIR),
- P5SEL_D = (BASE_REG << P5SEL),
- P6IN_D = (BASE_REG << P6IN), // Port 6
- P6OUT_D = (BASE_REG << P6OUT),
- P6DIR_D = (BASE_REG << P6DIR),
- P6SEL_D = (BASE_REG << P6SEL);
-
-
-//============================================================================
-// 2) REGISTER DECODER
-//============================================================================
-
-// Local register selection
-wire reg_sel = per_en & (per_addr[13:DEC_WD-1]==BASE_ADDR[14:DEC_WD]);
-
-// Register local address
-wire [DEC_WD-1:0] reg_addr = {1'b0, per_addr[DEC_WD-2:0]};
-
-// Register address decode
-wire [DEC_SZ-1:0] reg_dec = (P1IN_D & {DEC_SZ{(reg_addr==(P1IN >>1)) & P1_EN[0]}}) |
- (P1OUT_D & {DEC_SZ{(reg_addr==(P1OUT >>1)) & P1_EN[0]}}) |
- (P1DIR_D & {DEC_SZ{(reg_addr==(P1DIR >>1)) & P1_EN[0]}}) |
- (P1IFG_D & {DEC_SZ{(reg_addr==(P1IFG >>1)) & P1_EN[0]}}) |
- (P1IES_D & {DEC_SZ{(reg_addr==(P1IES >>1)) & P1_EN[0]}}) |
- (P1IE_D & {DEC_SZ{(reg_addr==(P1IE >>1)) & P1_EN[0]}}) |
- (P1SEL_D & {DEC_SZ{(reg_addr==(P1SEL >>1)) & P1_EN[0]}}) |
- (P2IN_D & {DEC_SZ{(reg_addr==(P2IN >>1)) & P2_EN[0]}}) |
- (P2OUT_D & {DEC_SZ{(reg_addr==(P2OUT >>1)) & P2_EN[0]}}) |
- (P2DIR_D & {DEC_SZ{(reg_addr==(P2DIR >>1)) & P2_EN[0]}}) |
- (P2IFG_D & {DEC_SZ{(reg_addr==(P2IFG >>1)) & P2_EN[0]}}) |
- (P2IES_D & {DEC_SZ{(reg_addr==(P2IES >>1)) & P2_EN[0]}}) |
- (P2IE_D & {DEC_SZ{(reg_addr==(P2IE >>1)) & P2_EN[0]}}) |
- (P2SEL_D & {DEC_SZ{(reg_addr==(P2SEL >>1)) & P2_EN[0]}}) |
- (P3IN_D & {DEC_SZ{(reg_addr==(P3IN >>1)) & P3_EN[0]}}) |
- (P3OUT_D & {DEC_SZ{(reg_addr==(P3OUT >>1)) & P3_EN[0]}}) |
- (P3DIR_D & {DEC_SZ{(reg_addr==(P3DIR >>1)) & P3_EN[0]}}) |
- (P3SEL_D & {DEC_SZ{(reg_addr==(P3SEL >>1)) & P3_EN[0]}}) |
- (P4IN_D & {DEC_SZ{(reg_addr==(P4IN >>1)) & P4_EN[0]}}) |
- (P4OUT_D & {DEC_SZ{(reg_addr==(P4OUT >>1)) & P4_EN[0]}}) |
- (P4DIR_D & {DEC_SZ{(reg_addr==(P4DIR >>1)) & P4_EN[0]}}) |
- (P4SEL_D & {DEC_SZ{(reg_addr==(P4SEL >>1)) & P4_EN[0]}}) |
- (P5IN_D & {DEC_SZ{(reg_addr==(P5IN >>1)) & P5_EN[0]}}) |
- (P5OUT_D & {DEC_SZ{(reg_addr==(P5OUT >>1)) & P5_EN[0]}}) |
- (P5DIR_D & {DEC_SZ{(reg_addr==(P5DIR >>1)) & P5_EN[0]}}) |
- (P5SEL_D & {DEC_SZ{(reg_addr==(P5SEL >>1)) & P5_EN[0]}}) |
- (P6IN_D & {DEC_SZ{(reg_addr==(P6IN >>1)) & P6_EN[0]}}) |
- (P6OUT_D & {DEC_SZ{(reg_addr==(P6OUT >>1)) & P6_EN[0]}}) |
- (P6DIR_D & {DEC_SZ{(reg_addr==(P6DIR >>1)) & P6_EN[0]}}) |
- (P6SEL_D & {DEC_SZ{(reg_addr==(P6SEL >>1)) & P6_EN[0]}});
-
-// Read/Write probes
-wire reg_lo_write = per_we[0] & reg_sel;
-wire reg_hi_write = per_we[1] & reg_sel;
-wire reg_read = ~|per_we & reg_sel;
-
-// Read/Write vectors
-wire [DEC_SZ-1:0] reg_hi_wr = reg_dec & {DEC_SZ{reg_hi_write}};
-wire [DEC_SZ-1:0] reg_lo_wr = reg_dec & {DEC_SZ{reg_lo_write}};
-wire [DEC_SZ-1:0] reg_rd = reg_dec & {DEC_SZ{reg_read}};
-
-//============================================================================
-// 3) REGISTERS
-//============================================================================
-
-// P1IN Register
-//---------------
-wire [7:0] p1in;
-
-omsp_sync_cell sync_cell_p1in_0 (.data_out(p1in[0]), .clk(mclk), .data_in(p1_din[0] & P1_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p1in_1 (.data_out(p1in[1]), .clk(mclk), .data_in(p1_din[1] & P1_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p1in_2 (.data_out(p1in[2]), .clk(mclk), .data_in(p1_din[2] & P1_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p1in_3 (.data_out(p1in[3]), .clk(mclk), .data_in(p1_din[3] & P1_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p1in_4 (.data_out(p1in[4]), .clk(mclk), .data_in(p1_din[4] & P1_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p1in_5 (.data_out(p1in[5]), .clk(mclk), .data_in(p1_din[5] & P1_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p1in_6 (.data_out(p1in[6]), .clk(mclk), .data_in(p1_din[6] & P1_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p1in_7 (.data_out(p1in[7]), .clk(mclk), .data_in(p1_din[7] & P1_EN[0]), .rst(puc_rst));
-
-
-// P1OUT Register
-//----------------
-reg [7:0] p1out;
-
-wire p1out_wr = P1OUT[0] ? reg_hi_wr[P1OUT] : reg_lo_wr[P1OUT];
-wire [7:0] p1out_nxt = P1OUT[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p1out <= 8'h00;
- else if (p1out_wr) p1out <= p1out_nxt & P1_EN_MSK;
-
-assign p1_dout = p1out;
-
-
-// P1DIR Register
-//----------------
-reg [7:0] p1dir;
-
-wire p1dir_wr = P1DIR[0] ? reg_hi_wr[P1DIR] : reg_lo_wr[P1DIR];
-wire [7:0] p1dir_nxt = P1DIR[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p1dir <= 8'h00;
- else if (p1dir_wr) p1dir <= p1dir_nxt & P1_EN_MSK;
-
-assign p1_dout_en = p1dir;
-
-
-// P1IFG Register
-//----------------
-reg [7:0] p1ifg;
-
-wire p1ifg_wr = P1IFG[0] ? reg_hi_wr[P1IFG] : reg_lo_wr[P1IFG];
-wire [7:0] p1ifg_nxt = P1IFG[0] ? per_din[15:8] : per_din[7:0];
-wire [7:0] p1ifg_set;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p1ifg <= 8'h00;
- else if (p1ifg_wr) p1ifg <= (p1ifg_nxt | p1ifg_set) & P1_EN_MSK;
- else p1ifg <= (p1ifg | p1ifg_set) & P1_EN_MSK;
-
-// P1IES Register
-//----------------
-reg [7:0] p1ies;
-
-wire p1ies_wr = P1IES[0] ? reg_hi_wr[P1IES] : reg_lo_wr[P1IES];
-wire [7:0] p1ies_nxt = P1IES[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p1ies <= 8'h00;
- else if (p1ies_wr) p1ies <= p1ies_nxt & P1_EN_MSK;
-
-
-// P1IE Register
-//----------------
-reg [7:0] p1ie;
-
-wire p1ie_wr = P1IE[0] ? reg_hi_wr[P1IE] : reg_lo_wr[P1IE];
-wire [7:0] p1ie_nxt = P1IE[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p1ie <= 8'h00;
- else if (p1ie_wr) p1ie <= p1ie_nxt & P1_EN_MSK;
-
-
-// P1SEL Register
-//----------------
-reg [7:0] p1sel;
-
-wire p1sel_wr = P1SEL[0] ? reg_hi_wr[P1SEL] : reg_lo_wr[P1SEL];
-wire [7:0] p1sel_nxt = P1SEL[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p1sel <= 8'h00;
- else if (p1sel_wr) p1sel <= p1sel_nxt & P1_EN_MSK;
-
-assign p1_sel = p1sel;
-
-
-// P2IN Register
-//---------------
-wire [7:0] p2in;
-
-omsp_sync_cell sync_cell_p2in_0 (.data_out(p2in[0]), .clk(mclk), .data_in(p2_din[0] & P2_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p2in_1 (.data_out(p2in[1]), .clk(mclk), .data_in(p2_din[1] & P2_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p2in_2 (.data_out(p2in[2]), .clk(mclk), .data_in(p2_din[2] & P2_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p2in_3 (.data_out(p2in[3]), .clk(mclk), .data_in(p2_din[3] & P2_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p2in_4 (.data_out(p2in[4]), .clk(mclk), .data_in(p2_din[4] & P2_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p2in_5 (.data_out(p2in[5]), .clk(mclk), .data_in(p2_din[5] & P2_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p2in_6 (.data_out(p2in[6]), .clk(mclk), .data_in(p2_din[6] & P2_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p2in_7 (.data_out(p2in[7]), .clk(mclk), .data_in(p2_din[7] & P2_EN[0]), .rst(puc_rst));
-
-
-// P2OUT Register
-//----------------
-reg [7:0] p2out;
-
-wire p2out_wr = P2OUT[0] ? reg_hi_wr[P2OUT] : reg_lo_wr[P2OUT];
-wire [7:0] p2out_nxt = P2OUT[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p2out <= 8'h00;
- else if (p2out_wr) p2out <= p2out_nxt & P2_EN_MSK;
-
-assign p2_dout = p2out;
-
-
-// P2DIR Register
-//----------------
-reg [7:0] p2dir;
-
-wire p2dir_wr = P2DIR[0] ? reg_hi_wr[P2DIR] : reg_lo_wr[P2DIR];
-wire [7:0] p2dir_nxt = P2DIR[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p2dir <= 8'h00;
- else if (p2dir_wr) p2dir <= p2dir_nxt & P2_EN_MSK;
-
-assign p2_dout_en = p2dir;
-
-
-// P2IFG Register
-//----------------
-reg [7:0] p2ifg;
-
-wire p2ifg_wr = P2IFG[0] ? reg_hi_wr[P2IFG] : reg_lo_wr[P2IFG];
-wire [7:0] p2ifg_nxt = P2IFG[0] ? per_din[15:8] : per_din[7:0];
-wire [7:0] p2ifg_set;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p2ifg <= 8'h00;
- else if (p2ifg_wr) p2ifg <= (p2ifg_nxt | p2ifg_set) & P2_EN_MSK;
- else p2ifg <= (p2ifg | p2ifg_set) & P2_EN_MSK;
-
-
-// P2IES Register
-//----------------
-reg [7:0] p2ies;
-
-wire p2ies_wr = P2IES[0] ? reg_hi_wr[P2IES] : reg_lo_wr[P2IES];
-wire [7:0] p2ies_nxt = P2IES[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p2ies <= 8'h00;
- else if (p2ies_wr) p2ies <= p2ies_nxt & P2_EN_MSK;
-
-
-// P2IE Register
-//----------------
-reg [7:0] p2ie;
-
-wire p2ie_wr = P2IE[0] ? reg_hi_wr[P2IE] : reg_lo_wr[P2IE];
-wire [7:0] p2ie_nxt = P2IE[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p2ie <= 8'h00;
- else if (p2ie_wr) p2ie <= p2ie_nxt & P2_EN_MSK;
-
-
-// P2SEL Register
-//----------------
-reg [7:0] p2sel;
-
-wire p2sel_wr = P2SEL[0] ? reg_hi_wr[P2SEL] : reg_lo_wr[P2SEL];
-wire [7:0] p2sel_nxt = P2SEL[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p2sel <= 8'h00;
- else if (p2sel_wr) p2sel <= p2sel_nxt & P2_EN_MSK;
-
-assign p2_sel = p2sel;
-
-
-// P3IN Register
-//---------------
-wire [7:0] p3in;
-
-omsp_sync_cell sync_cell_p3in_0 (.data_out(p3in[0]), .clk(mclk), .data_in(p3_din[0] & P3_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p3in_1 (.data_out(p3in[1]), .clk(mclk), .data_in(p3_din[1] & P3_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p3in_2 (.data_out(p3in[2]), .clk(mclk), .data_in(p3_din[2] & P3_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p3in_3 (.data_out(p3in[3]), .clk(mclk), .data_in(p3_din[3] & P3_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p3in_4 (.data_out(p3in[4]), .clk(mclk), .data_in(p3_din[4] & P3_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p3in_5 (.data_out(p3in[5]), .clk(mclk), .data_in(p3_din[5] & P3_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p3in_6 (.data_out(p3in[6]), .clk(mclk), .data_in(p3_din[6] & P3_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p3in_7 (.data_out(p3in[7]), .clk(mclk), .data_in(p3_din[7] & P3_EN[0]), .rst(puc_rst));
-
-
-// P3OUT Register
-//----------------
-reg [7:0] p3out;
-
-wire p3out_wr = P3OUT[0] ? reg_hi_wr[P3OUT] : reg_lo_wr[P3OUT];
-wire [7:0] p3out_nxt = P3OUT[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p3out <= 8'h00;
- else if (p3out_wr) p3out <= p3out_nxt & P3_EN_MSK;
-
-assign p3_dout = p3out;
-
-
-// P3DIR Register
-//----------------
-reg [7:0] p3dir;
-
-wire p3dir_wr = P3DIR[0] ? reg_hi_wr[P3DIR] : reg_lo_wr[P3DIR];
-wire [7:0] p3dir_nxt = P3DIR[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p3dir <= 8'h00;
- else if (p3dir_wr) p3dir <= p3dir_nxt & P3_EN_MSK;
-
-assign p3_dout_en = p3dir;
-
-
-// P3SEL Register
-//----------------
-reg [7:0] p3sel;
-
-wire p3sel_wr = P3SEL[0] ? reg_hi_wr[P3SEL] : reg_lo_wr[P3SEL];
-wire [7:0] p3sel_nxt = P3SEL[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p3sel <= 8'h00;
- else if (p3sel_wr) p3sel <= p3sel_nxt & P3_EN_MSK;
-
-assign p3_sel = p3sel;
-
-
-// P4IN Register
-//---------------
-wire [7:0] p4in;
-
-omsp_sync_cell sync_cell_p4in_0 (.data_out(p4in[0]), .clk(mclk), .data_in(p4_din[0] & P4_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p4in_1 (.data_out(p4in[1]), .clk(mclk), .data_in(p4_din[1] & P4_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p4in_2 (.data_out(p4in[2]), .clk(mclk), .data_in(p4_din[2] & P4_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p4in_3 (.data_out(p4in[3]), .clk(mclk), .data_in(p4_din[3] & P4_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p4in_4 (.data_out(p4in[4]), .clk(mclk), .data_in(p4_din[4] & P4_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p4in_5 (.data_out(p4in[5]), .clk(mclk), .data_in(p4_din[5] & P4_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p4in_6 (.data_out(p4in[6]), .clk(mclk), .data_in(p4_din[6] & P4_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p4in_7 (.data_out(p4in[7]), .clk(mclk), .data_in(p4_din[7] & P4_EN[0]), .rst(puc_rst));
-
-
-// P4OUT Register
-//----------------
-reg [7:0] p4out;
-
-wire p4out_wr = P4OUT[0] ? reg_hi_wr[P4OUT] : reg_lo_wr[P4OUT];
-wire [7:0] p4out_nxt = P4OUT[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p4out <= 8'h00;
- else if (p4out_wr) p4out <= p4out_nxt & P4_EN_MSK;
-
-assign p4_dout = p4out;
-
-
-// P4DIR Register
-//----------------
-reg [7:0] p4dir;
-
-wire p4dir_wr = P4DIR[0] ? reg_hi_wr[P4DIR] : reg_lo_wr[P4DIR];
-wire [7:0] p4dir_nxt = P4DIR[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p4dir <= 8'h00;
- else if (p4dir_wr) p4dir <= p4dir_nxt & P4_EN_MSK;
-
-assign p4_dout_en = p4dir;
-
-
-// P4SEL Register
-//----------------
-reg [7:0] p4sel;
-
-wire p4sel_wr = P4SEL[0] ? reg_hi_wr[P4SEL] : reg_lo_wr[P4SEL];
-wire [7:0] p4sel_nxt = P4SEL[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p4sel <= 8'h00;
- else if (p4sel_wr) p4sel <= p4sel_nxt & P4_EN_MSK;
-
-assign p4_sel = p4sel;
-
-
-// P5IN Register
-//---------------
-wire [7:0] p5in;
-
-omsp_sync_cell sync_cell_p5in_0 (.data_out(p5in[0]), .clk(mclk), .data_in(p5_din[0] & P5_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p5in_1 (.data_out(p5in[1]), .clk(mclk), .data_in(p5_din[1] & P5_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p5in_2 (.data_out(p5in[2]), .clk(mclk), .data_in(p5_din[2] & P5_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p5in_3 (.data_out(p5in[3]), .clk(mclk), .data_in(p5_din[3] & P5_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p5in_4 (.data_out(p5in[4]), .clk(mclk), .data_in(p5_din[4] & P5_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p5in_5 (.data_out(p5in[5]), .clk(mclk), .data_in(p5_din[5] & P5_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p5in_6 (.data_out(p5in[6]), .clk(mclk), .data_in(p5_din[6] & P5_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p5in_7 (.data_out(p5in[7]), .clk(mclk), .data_in(p5_din[7] & P5_EN[0]), .rst(puc_rst));
-
-
-// P5OUT Register
-//----------------
-reg [7:0] p5out;
-
-wire p5out_wr = P5OUT[0] ? reg_hi_wr[P5OUT] : reg_lo_wr[P5OUT];
-wire [7:0] p5out_nxt = P5OUT[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p5out <= 8'h00;
- else if (p5out_wr) p5out <= p5out_nxt & P5_EN_MSK;
-
-assign p5_dout = p5out;
-
-
-// P5DIR Register
-//----------------
-reg [7:0] p5dir;
-
-wire p5dir_wr = P5DIR[0] ? reg_hi_wr[P5DIR] : reg_lo_wr[P5DIR];
-wire [7:0] p5dir_nxt = P5DIR[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p5dir <= 8'h00;
- else if (p5dir_wr) p5dir <= p5dir_nxt & P5_EN_MSK;
-
-assign p5_dout_en = p5dir;
-
-
-// P5SEL Register
-//----------------
-reg [7:0] p5sel;
-
-wire p5sel_wr = P5SEL[0] ? reg_hi_wr[P5SEL] : reg_lo_wr[P5SEL];
-wire [7:0] p5sel_nxt = P5SEL[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p5sel <= 8'h00;
- else if (p5sel_wr) p5sel <= p5sel_nxt & P5_EN_MSK;
-
-assign p5_sel = p5sel;
-
-
-// P6IN Register
-//---------------
-wire [7:0] p6in;
-
-omsp_sync_cell sync_cell_p6in_0 (.data_out(p6in[0]), .clk(mclk), .data_in(p6_din[0] & P6_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p6in_1 (.data_out(p6in[1]), .clk(mclk), .data_in(p6_din[1] & P6_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p6in_2 (.data_out(p6in[2]), .clk(mclk), .data_in(p6_din[2] & P6_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p6in_3 (.data_out(p6in[3]), .clk(mclk), .data_in(p6_din[3] & P6_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p6in_4 (.data_out(p6in[4]), .clk(mclk), .data_in(p6_din[4] & P6_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p6in_5 (.data_out(p6in[5]), .clk(mclk), .data_in(p6_din[5] & P6_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p6in_6 (.data_out(p6in[6]), .clk(mclk), .data_in(p6_din[6] & P6_EN[0]), .rst(puc_rst));
-omsp_sync_cell sync_cell_p6in_7 (.data_out(p6in[7]), .clk(mclk), .data_in(p6_din[7] & P6_EN[0]), .rst(puc_rst));
-
-
-// P6OUT Register
-//----------------
-reg [7:0] p6out;
-
-wire p6out_wr = P6OUT[0] ? reg_hi_wr[P6OUT] : reg_lo_wr[P6OUT];
-wire [7:0] p6out_nxt = P6OUT[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p6out <= 8'h00;
- else if (p6out_wr) p6out <= p6out_nxt & P6_EN_MSK;
-
-assign p6_dout = p6out;
-
-
-// P6DIR Register
-//----------------
-reg [7:0] p6dir;
-
-wire p6dir_wr = P6DIR[0] ? reg_hi_wr[P6DIR] : reg_lo_wr[P6DIR];
-wire [7:0] p6dir_nxt = P6DIR[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p6dir <= 8'h00;
- else if (p6dir_wr) p6dir <= p6dir_nxt & P6_EN_MSK;
-
-assign p6_dout_en = p6dir;
-
-
-// P6SEL Register
-//----------------
-reg [7:0] p6sel;
-
-wire p6sel_wr = P6SEL[0] ? reg_hi_wr[P6SEL] : reg_lo_wr[P6SEL];
-wire [7:0] p6sel_nxt = P6SEL[0] ? per_din[15:8] : per_din[7:0];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p6sel <= 8'h00;
- else if (p6sel_wr) p6sel <= p6sel_nxt & P6_EN_MSK;
-
-assign p6_sel = p6sel;
-
-
-
-//============================================================================
-// 4) INTERRUPT GENERATION
-//============================================================================
-
-// Port 1 interrupt
-//------------------
-
-// Delay input
-reg [7:0] p1in_dly;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p1in_dly <= 8'h00;
- else p1in_dly <= p1in & P1_EN_MSK;
-
-// Edge detection
-wire [7:0] p1in_re = p1in & ~p1in_dly;
-wire [7:0] p1in_fe = ~p1in & p1in_dly;
-
-// Set interrupt flag
-assign p1ifg_set = {p1ies[7] ? p1in_fe[7] : p1in_re[7],
- p1ies[6] ? p1in_fe[6] : p1in_re[6],
- p1ies[5] ? p1in_fe[5] : p1in_re[5],
- p1ies[4] ? p1in_fe[4] : p1in_re[4],
- p1ies[3] ? p1in_fe[3] : p1in_re[3],
- p1ies[2] ? p1in_fe[2] : p1in_re[2],
- p1ies[1] ? p1in_fe[1] : p1in_re[1],
- p1ies[0] ? p1in_fe[0] : p1in_re[0]} & P1_EN_MSK;
-
-// Generate CPU interrupt
-assign irq_port1 = |(p1ie & p1ifg) & P1_EN[0];
-
-
-// Port 1 interrupt
-//------------------
-
-// Delay input
-reg [7:0] p2in_dly;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) p2in_dly <= 8'h00;
- else p2in_dly <= p2in & P2_EN_MSK;
-
-// Edge detection
-wire [7:0] p2in_re = p2in & ~p2in_dly;
-wire [7:0] p2in_fe = ~p2in & p2in_dly;
-
-// Set interrupt flag
-assign p2ifg_set = {p2ies[7] ? p2in_fe[7] : p2in_re[7],
- p2ies[6] ? p2in_fe[6] : p2in_re[6],
- p2ies[5] ? p2in_fe[5] : p2in_re[5],
- p2ies[4] ? p2in_fe[4] : p2in_re[4],
- p2ies[3] ? p2in_fe[3] : p2in_re[3],
- p2ies[2] ? p2in_fe[2] : p2in_re[2],
- p2ies[1] ? p2in_fe[1] : p2in_re[1],
- p2ies[0] ? p2in_fe[0] : p2in_re[0]} & P2_EN_MSK;
-
-// Generate CPU interrupt
-assign irq_port2 = |(p2ie & p2ifg) & P2_EN[0];
-
-
-//============================================================================
-// 5) DATA OUTPUT GENERATION
-//============================================================================
-
-// Data output mux
-wire [15:0] p1in_rd = {8'h00, (p1in & {8{reg_rd[P1IN]}})} << (8 & {4{P1IN[0]}});
-wire [15:0] p1out_rd = {8'h00, (p1out & {8{reg_rd[P1OUT]}})} << (8 & {4{P1OUT[0]}});
-wire [15:0] p1dir_rd = {8'h00, (p1dir & {8{reg_rd[P1DIR]}})} << (8 & {4{P1DIR[0]}});
-wire [15:0] p1ifg_rd = {8'h00, (p1ifg & {8{reg_rd[P1IFG]}})} << (8 & {4{P1IFG[0]}});
-wire [15:0] p1ies_rd = {8'h00, (p1ies & {8{reg_rd[P1IES]}})} << (8 & {4{P1IES[0]}});
-wire [15:0] p1ie_rd = {8'h00, (p1ie & {8{reg_rd[P1IE]}})} << (8 & {4{P1IE[0]}});
-wire [15:0] p1sel_rd = {8'h00, (p1sel & {8{reg_rd[P1SEL]}})} << (8 & {4{P1SEL[0]}});
-wire [15:0] p2in_rd = {8'h00, (p2in & {8{reg_rd[P2IN]}})} << (8 & {4{P2IN[0]}});
-wire [15:0] p2out_rd = {8'h00, (p2out & {8{reg_rd[P2OUT]}})} << (8 & {4{P2OUT[0]}});
-wire [15:0] p2dir_rd = {8'h00, (p2dir & {8{reg_rd[P2DIR]}})} << (8 & {4{P2DIR[0]}});
-wire [15:0] p2ifg_rd = {8'h00, (p2ifg & {8{reg_rd[P2IFG]}})} << (8 & {4{P2IFG[0]}});
-wire [15:0] p2ies_rd = {8'h00, (p2ies & {8{reg_rd[P2IES]}})} << (8 & {4{P2IES[0]}});
-wire [15:0] p2ie_rd = {8'h00, (p2ie & {8{reg_rd[P2IE]}})} << (8 & {4{P2IE[0]}});
-wire [15:0] p2sel_rd = {8'h00, (p2sel & {8{reg_rd[P2SEL]}})} << (8 & {4{P2SEL[0]}});
-wire [15:0] p3in_rd = {8'h00, (p3in & {8{reg_rd[P3IN]}})} << (8 & {4{P3IN[0]}});
-wire [15:0] p3out_rd = {8'h00, (p3out & {8{reg_rd[P3OUT]}})} << (8 & {4{P3OUT[0]}});
-wire [15:0] p3dir_rd = {8'h00, (p3dir & {8{reg_rd[P3DIR]}})} << (8 & {4{P3DIR[0]}});
-wire [15:0] p3sel_rd = {8'h00, (p3sel & {8{reg_rd[P3SEL]}})} << (8 & {4{P3SEL[0]}});
-wire [15:0] p4in_rd = {8'h00, (p4in & {8{reg_rd[P4IN]}})} << (8 & {4{P4IN[0]}});
-wire [15:0] p4out_rd = {8'h00, (p4out & {8{reg_rd[P4OUT]}})} << (8 & {4{P4OUT[0]}});
-wire [15:0] p4dir_rd = {8'h00, (p4dir & {8{reg_rd[P4DIR]}})} << (8 & {4{P4DIR[0]}});
-wire [15:0] p4sel_rd = {8'h00, (p4sel & {8{reg_rd[P4SEL]}})} << (8 & {4{P4SEL[0]}});
-wire [15:0] p5in_rd = {8'h00, (p5in & {8{reg_rd[P5IN]}})} << (8 & {4{P5IN[0]}});
-wire [15:0] p5out_rd = {8'h00, (p5out & {8{reg_rd[P5OUT]}})} << (8 & {4{P5OUT[0]}});
-wire [15:0] p5dir_rd = {8'h00, (p5dir & {8{reg_rd[P5DIR]}})} << (8 & {4{P5DIR[0]}});
-wire [15:0] p5sel_rd = {8'h00, (p5sel & {8{reg_rd[P5SEL]}})} << (8 & {4{P5SEL[0]}});
-wire [15:0] p6in_rd = {8'h00, (p6in & {8{reg_rd[P6IN]}})} << (8 & {4{P6IN[0]}});
-wire [15:0] p6out_rd = {8'h00, (p6out & {8{reg_rd[P6OUT]}})} << (8 & {4{P6OUT[0]}});
-wire [15:0] p6dir_rd = {8'h00, (p6dir & {8{reg_rd[P6DIR]}})} << (8 & {4{P6DIR[0]}});
-wire [15:0] p6sel_rd = {8'h00, (p6sel & {8{reg_rd[P6SEL]}})} << (8 & {4{P6SEL[0]}});
-
-wire [15:0] per_dout = p1in_rd |
- p1out_rd |
- p1dir_rd |
- p1ifg_rd |
- p1ies_rd |
- p1ie_rd |
- p1sel_rd |
- p2in_rd |
- p2out_rd |
- p2dir_rd |
- p2ifg_rd |
- p2ies_rd |
- p2ie_rd |
- p2sel_rd |
- p3in_rd |
- p3out_rd |
- p3dir_rd |
- p3sel_rd |
- p4in_rd |
- p4out_rd |
- p4dir_rd |
- p4sel_rd |
- p5in_rd |
- p5out_rd |
- p5dir_rd |
- p5sel_rd |
- p6in_rd |
- p6out_rd |
- p6dir_rd |
- p6sel_rd;
-
-endmodule // omsp_gpio
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/periph/omsp_timerA_defines.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/periph/omsp_timerA.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/periph/omsp_timerA.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/periph/omsp_timerA.v (nonexistent)
@@ -1,754 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_timerA.v
-//
-// *Module Description:
-// Timer A top-level
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_TA_NO_INCLUDE
-`else
-`include "omsp_timerA_defines.v"
-`endif
-
-module omsp_timerA (
-
-// OUTPUTs
- irq_ta0, // Timer A interrupt: TACCR0
- irq_ta1, // Timer A interrupt: TAIV, TACCR1, TACCR2
- per_dout, // Peripheral data output
- ta_out0, // Timer A output 0
- ta_out0_en, // Timer A output 0 enable
- ta_out1, // Timer A output 1
- ta_out1_en, // Timer A output 1 enable
- ta_out2, // Timer A output 2
- ta_out2_en, // Timer A output 2 enable
-
-// INPUTs
- aclk_en, // ACLK enable (from CPU)
- dbg_freeze, // Freeze Timer A counter
- inclk, // INCLK external timer clock (SLOW)
- irq_ta0_acc, // Interrupt request TACCR0 accepted
- mclk, // Main system clock
- per_addr, // Peripheral address
- per_din, // Peripheral data input
- per_en, // Peripheral enable (high active)
- per_we, // Peripheral write enable (high active)
- puc_rst, // Main system reset
- smclk_en, // SMCLK enable (from CPU)
- ta_cci0a, // Timer A capture 0 input A
- ta_cci0b, // Timer A capture 0 input B
- ta_cci1a, // Timer A capture 1 input A
- ta_cci1b, // Timer A capture 1 input B
- ta_cci2a, // Timer A capture 2 input A
- ta_cci2b, // Timer A capture 2 input B
- taclk // TACLK external timer clock (SLOW)
-);
-
-// OUTPUTs
-//=========
-output irq_ta0; // Timer A interrupt: TACCR0
-output irq_ta1; // Timer A interrupt: TAIV, TACCR1, TACCR2
-output [15:0] per_dout; // Peripheral data output
-output ta_out0; // Timer A output 0
-output ta_out0_en; // Timer A output 0 enable
-output ta_out1; // Timer A output 1
-output ta_out1_en; // Timer A output 1 enable
-output ta_out2; // Timer A output 2
-output ta_out2_en; // Timer A output 2 enable
-
-// INPUTs
-//=========
-input aclk_en; // ACLK enable (from CPU)
-input dbg_freeze; // Freeze Timer A counter
-input inclk; // INCLK external timer clock (SLOW)
-input irq_ta0_acc; // Interrupt request TACCR0 accepted
-input mclk; // Main system clock
-input [13:0] per_addr; // Peripheral address
-input [15:0] per_din; // Peripheral data input
-input per_en; // Peripheral enable (high active)
-input [1:0] per_we; // Peripheral write enable (high active)
-input puc_rst; // Main system reset
-input smclk_en; // SMCLK enable (from CPU)
-input ta_cci0a; // Timer A capture 0 input A
-input ta_cci0b; // Timer A capture 0 input B
-input ta_cci1a; // Timer A capture 1 input A
-input ta_cci1b; // Timer A capture 1 input B
-input ta_cci2a; // Timer A capture 2 input A
-input ta_cci2b; // Timer A capture 2 input B
-input taclk; // TACLK external timer clock (SLOW)
-
-
-//=============================================================================
-// 1) PARAMETER DECLARATION
-//=============================================================================
-
-// Register base address (must be aligned to decoder bit width)
-parameter [14:0] BASE_ADDR = 15'h0100;
-
-// Decoder bit width (defines how many bits are considered for address decoding)
-parameter DEC_WD = 7;
-
-// Register addresses offset
-parameter [DEC_WD-1:0] TACTL = 'h60,
- TAR = 'h70,
- TACCTL0 = 'h62,
- TACCR0 = 'h72,
- TACCTL1 = 'h64,
- TACCR1 = 'h74,
- TACCTL2 = 'h66,
- TACCR2 = 'h76,
- TAIV = 'h2E;
-
-// Register one-hot decoder utilities
-parameter DEC_SZ = 2**DEC_WD;
-parameter [DEC_SZ-1:0] BASE_REG = {{DEC_SZ-1{1'b0}}, 1'b1};
-
-// Register one-hot decoder
-parameter [DEC_SZ-1:0] TACTL_D = (BASE_REG << TACTL),
- TAR_D = (BASE_REG << TAR),
- TACCTL0_D = (BASE_REG << TACCTL0),
- TACCR0_D = (BASE_REG << TACCR0),
- TACCTL1_D = (BASE_REG << TACCTL1),
- TACCR1_D = (BASE_REG << TACCR1),
- TACCTL2_D = (BASE_REG << TACCTL2),
- TACCR2_D = (BASE_REG << TACCR2),
- TAIV_D = (BASE_REG << TAIV);
-
-
-//============================================================================
-// 2) REGISTER DECODER
-//============================================================================
-
-// Local register selection
-wire reg_sel = per_en & (per_addr[13:DEC_WD-1]==BASE_ADDR[14:DEC_WD]);
-
-// Register local address
-wire [DEC_WD-1:0] reg_addr = {per_addr[DEC_WD-2:0], 1'b0};
-
-// Register address decode
-wire [DEC_SZ-1:0] reg_dec = (TACTL_D & {DEC_SZ{(reg_addr == TACTL )}}) |
- (TAR_D & {DEC_SZ{(reg_addr == TAR )}}) |
- (TACCTL0_D & {DEC_SZ{(reg_addr == TACCTL0 )}}) |
- (TACCR0_D & {DEC_SZ{(reg_addr == TACCR0 )}}) |
- (TACCTL1_D & {DEC_SZ{(reg_addr == TACCTL1 )}}) |
- (TACCR1_D & {DEC_SZ{(reg_addr == TACCR1 )}}) |
- (TACCTL2_D & {DEC_SZ{(reg_addr == TACCTL2 )}}) |
- (TACCR2_D & {DEC_SZ{(reg_addr == TACCR2 )}}) |
- (TAIV_D & {DEC_SZ{(reg_addr == TAIV )}});
-
-// Read/Write probes
-wire reg_write = |per_we & reg_sel;
-wire reg_read = ~|per_we & reg_sel;
-
-// Read/Write vectors
-wire [DEC_SZ-1:0] reg_wr = reg_dec & {512{reg_write}};
-wire [DEC_SZ-1:0] reg_rd = reg_dec & {512{reg_read}};
-
-
-//============================================================================
-// 3) REGISTERS
-//============================================================================
-
-// TACTL Register
-//-----------------
-reg [9:0] tactl;
-
-wire tactl_wr = reg_wr[TACTL];
-wire taclr = tactl_wr & per_din[`TACLR];
-wire taifg_set;
-wire taifg_clr;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) tactl <= 10'h000;
- else if (tactl_wr) tactl <= ((per_din[9:0] & 10'h3f3) | {9'h000, taifg_set}) & {9'h1ff, ~taifg_clr};
- else tactl <= (tactl | {9'h000, taifg_set}) & {9'h1ff, ~taifg_clr};
-
-
-// TAR Register
-//-----------------
-reg [15:0] tar;
-
-wire tar_wr = reg_wr[TAR];
-
-wire tar_clk;
-wire tar_clr;
-wire tar_inc;
-wire tar_dec;
-wire [15:0] tar_add = tar_inc ? 16'h0001 :
- tar_dec ? 16'hffff : 16'h0000;
-wire [15:0] tar_nxt = tar_clr ? 16'h0000 : (tar+tar_add);
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) tar <= 16'h0000;
- else if (tar_wr) tar <= per_din;
- else if (taclr) tar <= 16'h0000;
- else if (tar_clk & ~dbg_freeze) tar <= tar_nxt;
-
-
-// TACCTL0 Register
-//------------------
-reg [15:0] tacctl0;
-
-wire tacctl0_wr = reg_wr[TACCTL0];
-wire ccifg0_set;
-wire cov0_set;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) tacctl0 <= 16'h0000;
- else if (tacctl0_wr) tacctl0 <= ((per_din & 16'hf9f7) | {14'h0000, cov0_set, ccifg0_set}) & {15'h7fff, ~irq_ta0_acc};
- else tacctl0 <= (tacctl0 | {14'h0000, cov0_set, ccifg0_set}) & {15'h7fff, ~irq_ta0_acc};
-
-wire cci0;
-reg scci0;
-wire [15:0] tacctl0_full = tacctl0 | {5'h00, scci0, 6'h00, cci0, 3'h0};
-
-
-// TACCR0 Register
-//------------------
-reg [15:0] taccr0;
-
-wire taccr0_wr = reg_wr[TACCR0];
-wire cci0_cap;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) taccr0 <= 16'h0000;
- else if (taccr0_wr) taccr0 <= per_din;
- else if (cci0_cap) taccr0 <= tar;
-
-
-// TACCTL1 Register
-//------------------
-reg [15:0] tacctl1;
-
-wire tacctl1_wr = reg_wr[TACCTL1];
-wire ccifg1_set;
-wire ccifg1_clr;
-wire cov1_set;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) tacctl1 <= 16'h0000;
- else if (tacctl1_wr) tacctl1 <= ((per_din & 16'hf9f7) | {14'h0000, cov1_set, ccifg1_set}) & {15'h7fff, ~ccifg1_clr};
- else tacctl1 <= (tacctl1 | {14'h0000, cov1_set, ccifg1_set}) & {15'h7fff, ~ccifg1_clr};
-
-wire cci1;
-reg scci1;
-wire [15:0] tacctl1_full = tacctl1 | {5'h00, scci1, 6'h00, cci1, 3'h0};
-
-
-// TACCR1 Register
-//------------------
-reg [15:0] taccr1;
-
-wire taccr1_wr = reg_wr[TACCR1];
-wire cci1_cap;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) taccr1 <= 16'h0000;
- else if (taccr1_wr) taccr1 <= per_din;
- else if (cci1_cap) taccr1 <= tar;
-
-
-// TACCTL2 Register
-//------------------
-reg [15:0] tacctl2;
-
-wire tacctl2_wr = reg_wr[TACCTL2];
-wire ccifg2_set;
-wire ccifg2_clr;
-wire cov2_set;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) tacctl2 <= 16'h0000;
- else if (tacctl2_wr) tacctl2 <= ((per_din & 16'hf9f7) | {14'h0000, cov2_set, ccifg2_set}) & {15'h7fff, ~ccifg2_clr};
- else tacctl2 <= (tacctl2 | {14'h0000, cov2_set, ccifg2_set}) & {15'h7fff, ~ccifg2_clr};
-
-wire cci2;
-reg scci2;
-wire [15:0] tacctl2_full = tacctl2 | {5'h00, scci2, 6'h00, cci2, 3'h0};
-
-
-// TACCR2 Register
-//------------------
-reg [15:0] taccr2;
-
-wire taccr2_wr = reg_wr[TACCR2];
-wire cci2_cap;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) taccr2 <= 16'h0000;
- else if (taccr2_wr) taccr2 <= per_din;
- else if (cci2_cap) taccr2 <= tar;
-
-
-// TAIV Register
-//------------------
-
-wire [3:0] taiv = (tacctl1[`TACCIFG] & tacctl1[`TACCIE]) ? 4'h2 :
- (tacctl2[`TACCIFG] & tacctl2[`TACCIE]) ? 4'h4 :
- (tactl[`TAIFG] & tactl[`TAIE]) ? 4'hA :
- 4'h0;
-
-assign ccifg1_clr = (reg_rd[TAIV] | reg_wr[TAIV]) & (taiv==4'h2);
-assign ccifg2_clr = (reg_rd[TAIV] | reg_wr[TAIV]) & (taiv==4'h4);
-assign taifg_clr = (reg_rd[TAIV] | reg_wr[TAIV]) & (taiv==4'hA);
-
-
-//============================================================================
-// 4) DATA OUTPUT GENERATION
-//============================================================================
-
-// Data output mux
-wire [15:0] tactl_rd = {6'h00, tactl} & {16{reg_rd[TACTL]}};
-wire [15:0] tar_rd = tar & {16{reg_rd[TAR]}};
-wire [15:0] tacctl0_rd = tacctl0_full & {16{reg_rd[TACCTL0]}};
-wire [15:0] taccr0_rd = taccr0 & {16{reg_rd[TACCR0]}};
-wire [15:0] tacctl1_rd = tacctl1_full & {16{reg_rd[TACCTL1]}};
-wire [15:0] taccr1_rd = taccr1 & {16{reg_rd[TACCR1]}};
-wire [15:0] tacctl2_rd = tacctl2_full & {16{reg_rd[TACCTL2]}};
-wire [15:0] taccr2_rd = taccr2 & {16{reg_rd[TACCR2]}};
-wire [15:0] taiv_rd = {12'h000, taiv} & {16{reg_rd[TAIV]}};
-
-wire [15:0] per_dout = tactl_rd |
- tar_rd |
- tacctl0_rd |
- taccr0_rd |
- tacctl1_rd |
- taccr1_rd |
- tacctl2_rd |
- taccr2_rd |
- taiv_rd;
-
-
-//============================================================================
-// 5) Timer A counter control
-//============================================================================
-
-// Clock input synchronization (TACLK & INCLK)
-//-----------------------------------------------------------
-wire taclk_s;
-wire inclk_s;
-
-omsp_sync_cell sync_cell_taclk (
- .data_out (taclk_s),
- .clk (mclk),
- .data_in (taclk),
- .rst (puc_rst)
-);
-
-omsp_sync_cell sync_cell_inclk (
- .data_out (inclk_s),
- .clk (mclk),
- .data_in (inclk),
- .rst (puc_rst)
-);
-
-
-// Clock edge detection (TACLK & INCLK)
-//-----------------------------------------------------------
-
-reg taclk_dly;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) taclk_dly <= 1'b0;
- else taclk_dly <= taclk_s;
-
-wire taclk_en = taclk_s & ~taclk_dly;
-
-
-reg inclk_dly;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) inclk_dly <= 1'b0;
- else inclk_dly <= inclk_s;
-
-wire inclk_en = inclk_s & ~inclk_dly;
-
-
-// Timer clock input mux
-//-----------------------------------------------------------
-
-wire sel_clk = (tactl[`TASSELx]==2'b00) ? taclk_en :
- (tactl[`TASSELx]==2'b01) ? aclk_en :
- (tactl[`TASSELx]==2'b10) ? smclk_en : inclk_en;
-
-
-// Generate update pluse for the counter (<=> divided clock)
-//-----------------------------------------------------------
-reg [2:0] clk_div;
-
-assign tar_clk = sel_clk & ((tactl[`TAIDx]==2'b00) ? 1'b1 :
- (tactl[`TAIDx]==2'b01) ? clk_div[0] :
- (tactl[`TAIDx]==2'b10) ? &clk_div[1:0] :
- &clk_div[2:0]);
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) clk_div <= 3'h0;
- else if (tar_clk | taclr) clk_div <= 3'h0;
- else if ((tactl[`TAMCx]!=2'b00) & sel_clk) clk_div <= clk_div+3'h1;
-
-
-// Time counter control signals
-//-----------------------------------------------------------
-
-assign tar_clr = ((tactl[`TAMCx]==2'b01) & (tar>=taccr0)) |
- ((tactl[`TAMCx]==2'b11) & (taccr0==16'h0000));
-
-assign tar_inc = (tactl[`TAMCx]==2'b01) | (tactl[`TAMCx]==2'b10) |
- ((tactl[`TAMCx]==2'b11) & ~tar_dec);
-
-reg tar_dir;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) tar_dir <= 1'b0;
- else if (taclr) tar_dir <= 1'b0;
- else if (tactl[`TAMCx]==2'b11)
- begin
- if (tar_clk & (tar==16'h0001)) tar_dir <= 1'b0;
- else if (tar>=taccr0) tar_dir <= 1'b1;
- end
- else tar_dir <= 1'b0;
-
-assign tar_dec = tar_dir | ((tactl[`TAMCx]==2'b11) & (tar>=taccr0));
-
-
-//============================================================================
-// 6) Timer A comparator
-//============================================================================
-
-wire equ0 = (tar_nxt==taccr0) & (tar!=taccr0);
-wire equ1 = (tar_nxt==taccr1) & (tar!=taccr1);
-wire equ2 = (tar_nxt==taccr2) & (tar!=taccr2);
-
-
-//============================================================================
-// 7) Timer A capture logic
-//============================================================================
-
-// Input selection
-//------------------
-assign cci0 = (tacctl0[`TACCISx]==2'b00) ? ta_cci0a :
- (tacctl0[`TACCISx]==2'b01) ? ta_cci0b :
- (tacctl0[`TACCISx]==2'b10) ? 1'b0 : 1'b1;
-
-assign cci1 = (tacctl1[`TACCISx]==2'b00) ? ta_cci1a :
- (tacctl1[`TACCISx]==2'b01) ? ta_cci1b :
- (tacctl1[`TACCISx]==2'b10) ? 1'b0 : 1'b1;
-
-assign cci2 = (tacctl2[`TACCISx]==2'b00) ? ta_cci2a :
- (tacctl2[`TACCISx]==2'b01) ? ta_cci2b :
- (tacctl2[`TACCISx]==2'b10) ? 1'b0 : 1'b1;
-
-// CCIx synchronization
-wire cci0_s;
-wire cci1_s;
-wire cci2_s;
-
-omsp_sync_cell sync_cell_cci0 (
- .data_out (cci0_s),
- .clk (mclk),
- .data_in (cci0),
- .rst (puc_rst)
-);
-omsp_sync_cell sync_cell_cci1 (
- .data_out (cci1_s),
- .clk (mclk),
- .data_in (cci1),
- .rst (puc_rst)
-);
-omsp_sync_cell sync_cell_cci2 (
- .data_out (cci2_s),
- .clk (mclk),
- .data_in (cci2),
- .rst (puc_rst)
-);
-
-// Register CCIx for edge detection
-reg cci0_dly;
-reg cci1_dly;
-reg cci2_dly;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst)
- begin
- cci0_dly <= 1'b0;
- cci1_dly <= 1'b0;
- cci2_dly <= 1'b0;
- end
- else
- begin
- cci0_dly <= cci0_s;
- cci1_dly <= cci1_s;
- cci2_dly <= cci2_s;
- end
-
-
-// Generate SCCIx
-//------------------
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) scci0 <= 1'b0;
- else if (tar_clk & equ0) scci0 <= cci0_s;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) scci1 <= 1'b0;
- else if (tar_clk & equ1) scci1 <= cci1_s;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) scci2 <= 1'b0;
- else if (tar_clk & equ2) scci2 <= cci2_s;
-
-
-// Capture mode
-//------------------
-wire cci0_evt = (tacctl0[`TACMx]==2'b00) ? 1'b0 :
- (tacctl0[`TACMx]==2'b01) ? ( cci0_s & ~cci0_dly) : // Rising edge
- (tacctl0[`TACMx]==2'b10) ? (~cci0_s & cci0_dly) : // Falling edge
- ( cci0_s ^ cci0_dly); // Both edges
-
-wire cci1_evt = (tacctl1[`TACMx]==2'b00) ? 1'b0 :
- (tacctl1[`TACMx]==2'b01) ? ( cci1_s & ~cci1_dly) : // Rising edge
- (tacctl1[`TACMx]==2'b10) ? (~cci1_s & cci1_dly) : // Falling edge
- ( cci1_s ^ cci1_dly); // Both edges
-
-wire cci2_evt = (tacctl2[`TACMx]==2'b00) ? 1'b0 :
- (tacctl2[`TACMx]==2'b01) ? ( cci2_s & ~cci2_dly) : // Rising edge
- (tacctl2[`TACMx]==2'b10) ? (~cci2_s & cci2_dly) : // Falling edge
- ( cci2_s ^ cci2_dly); // Both edges
-
-// Event Synchronization
-//-----------------------
-
-reg cci0_evt_s;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cci0_evt_s <= 1'b0;
- else if (tar_clk) cci0_evt_s <= 1'b0;
- else if (cci0_evt) cci0_evt_s <= 1'b1;
-
-reg cci1_evt_s;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cci1_evt_s <= 1'b0;
- else if (tar_clk) cci1_evt_s <= 1'b0;
- else if (cci1_evt) cci1_evt_s <= 1'b1;
-
-reg cci2_evt_s;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cci2_evt_s <= 1'b0;
- else if (tar_clk) cci2_evt_s <= 1'b0;
- else if (cci2_evt) cci2_evt_s <= 1'b1;
-
-reg cci0_sync;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cci0_sync <= 1'b0;
- else cci0_sync <= (tar_clk & cci0_evt_s) | (tar_clk & cci0_evt & ~cci0_evt_s);
-
-reg cci1_sync;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cci1_sync <= 1'b0;
- else cci1_sync <= (tar_clk & cci1_evt_s) | (tar_clk & cci1_evt & ~cci1_evt_s);
-
-reg cci2_sync;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cci2_sync <= 1'b0;
- else cci2_sync <= (tar_clk & cci2_evt_s) | (tar_clk & cci2_evt & ~cci2_evt_s);
-
-
-// Generate final capture command
-//-----------------------------------
-
-assign cci0_cap = tacctl0[`TASCS] ? cci0_sync : cci0_evt;
-assign cci1_cap = tacctl1[`TASCS] ? cci1_sync : cci1_evt;
-assign cci2_cap = tacctl2[`TASCS] ? cci2_sync : cci2_evt;
-
-
-// Generate capture overflow flag
-//-----------------------------------
-
-reg cap0_taken;
-wire cap0_taken_clr = reg_rd[TACCR0] | (tacctl0_wr & tacctl0[`TACOV] & ~per_din[`TACOV]);
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cap0_taken <= 1'b0;
- else if (cci0_cap) cap0_taken <= 1'b1;
- else if (cap0_taken_clr) cap0_taken <= 1'b0;
-
-reg cap1_taken;
-wire cap1_taken_clr = reg_rd[TACCR1] | (tacctl1_wr & tacctl1[`TACOV] & ~per_din[`TACOV]);
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cap1_taken <= 1'b0;
- else if (cci1_cap) cap1_taken <= 1'b1;
- else if (cap1_taken_clr) cap1_taken <= 1'b0;
-
-reg cap2_taken;
-wire cap2_taken_clr = reg_rd[TACCR2] | (tacctl2_wr & tacctl2[`TACOV] & ~per_din[`TACOV]);
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cap2_taken <= 1'b0;
- else if (cci2_cap) cap2_taken <= 1'b1;
- else if (cap2_taken_clr) cap2_taken <= 1'b0;
-
-
-assign cov0_set = cap0_taken & cci0_cap & ~reg_rd[TACCR0];
-assign cov1_set = cap1_taken & cci1_cap & ~reg_rd[TACCR1];
-assign cov2_set = cap2_taken & cci2_cap & ~reg_rd[TACCR2];
-
-
-//============================================================================
-// 8) Timer A output unit
-//============================================================================
-
-// Output unit 0
-//-------------------
-reg ta_out0;
-
-wire ta_out0_mode0 = tacctl0[`TAOUT]; // Output
-wire ta_out0_mode1 = equ0 ? 1'b1 : ta_out0; // Set
-wire ta_out0_mode2 = equ0 ? ~ta_out0 : // Toggle/Reset
- equ0 ? 1'b0 : ta_out0;
-wire ta_out0_mode3 = equ0 ? 1'b1 : // Set/Reset
- equ0 ? 1'b0 : ta_out0;
-wire ta_out0_mode4 = equ0 ? ~ta_out0 : ta_out0; // Toggle
-wire ta_out0_mode5 = equ0 ? 1'b0 : ta_out0; // Reset
-wire ta_out0_mode6 = equ0 ? ~ta_out0 : // Toggle/Set
- equ0 ? 1'b1 : ta_out0;
-wire ta_out0_mode7 = equ0 ? 1'b0 : // Reset/Set
- equ0 ? 1'b1 : ta_out0;
-
-wire ta_out0_nxt = (tacctl0[`TAOUTMODx]==3'b000) ? ta_out0_mode0 :
- (tacctl0[`TAOUTMODx]==3'b001) ? ta_out0_mode1 :
- (tacctl0[`TAOUTMODx]==3'b010) ? ta_out0_mode2 :
- (tacctl0[`TAOUTMODx]==3'b011) ? ta_out0_mode3 :
- (tacctl0[`TAOUTMODx]==3'b100) ? ta_out0_mode4 :
- (tacctl0[`TAOUTMODx]==3'b101) ? ta_out0_mode5 :
- (tacctl0[`TAOUTMODx]==3'b110) ? ta_out0_mode6 :
- ta_out0_mode7;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) ta_out0 <= 1'b0;
- else if ((tacctl0[`TAOUTMODx]==3'b001) & taclr) ta_out0 <= 1'b0;
- else if (tar_clk) ta_out0 <= ta_out0_nxt;
-
-assign ta_out0_en = ~tacctl0[`TACAP];
-
-
-// Output unit 1
-//-------------------
-reg ta_out1;
-
-wire ta_out1_mode0 = tacctl1[`TAOUT]; // Output
-wire ta_out1_mode1 = equ1 ? 1'b1 : ta_out1; // Set
-wire ta_out1_mode2 = equ1 ? ~ta_out1 : // Toggle/Reset
- equ0 ? 1'b0 : ta_out1;
-wire ta_out1_mode3 = equ1 ? 1'b1 : // Set/Reset
- equ0 ? 1'b0 : ta_out1;
-wire ta_out1_mode4 = equ1 ? ~ta_out1 : ta_out1; // Toggle
-wire ta_out1_mode5 = equ1 ? 1'b0 : ta_out1; // Reset
-wire ta_out1_mode6 = equ1 ? ~ta_out1 : // Toggle/Set
- equ0 ? 1'b1 : ta_out1;
-wire ta_out1_mode7 = equ1 ? 1'b0 : // Reset/Set
- equ0 ? 1'b1 : ta_out1;
-
-wire ta_out1_nxt = (tacctl1[`TAOUTMODx]==3'b000) ? ta_out1_mode0 :
- (tacctl1[`TAOUTMODx]==3'b001) ? ta_out1_mode1 :
- (tacctl1[`TAOUTMODx]==3'b010) ? ta_out1_mode2 :
- (tacctl1[`TAOUTMODx]==3'b011) ? ta_out1_mode3 :
- (tacctl1[`TAOUTMODx]==3'b100) ? ta_out1_mode4 :
- (tacctl1[`TAOUTMODx]==3'b101) ? ta_out1_mode5 :
- (tacctl1[`TAOUTMODx]==3'b110) ? ta_out1_mode6 :
- ta_out1_mode7;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) ta_out1 <= 1'b0;
- else if ((tacctl1[`TAOUTMODx]==3'b001) & taclr) ta_out1 <= 1'b0;
- else if (tar_clk) ta_out1 <= ta_out1_nxt;
-
-assign ta_out1_en = ~tacctl1[`TACAP];
-
-
-// Output unit 2
-//-------------------
-reg ta_out2;
-
-wire ta_out2_mode0 = tacctl2[`TAOUT]; // Output
-wire ta_out2_mode1 = equ2 ? 1'b1 : ta_out2; // Set
-wire ta_out2_mode2 = equ2 ? ~ta_out2 : // Toggle/Reset
- equ0 ? 1'b0 : ta_out2;
-wire ta_out2_mode3 = equ2 ? 1'b1 : // Set/Reset
- equ0 ? 1'b0 : ta_out2;
-wire ta_out2_mode4 = equ2 ? ~ta_out2 : ta_out2; // Toggle
-wire ta_out2_mode5 = equ2 ? 1'b0 : ta_out2; // Reset
-wire ta_out2_mode6 = equ2 ? ~ta_out2 : // Toggle/Set
- equ0 ? 1'b1 : ta_out2;
-wire ta_out2_mode7 = equ2 ? 1'b0 : // Reset/Set
- equ0 ? 1'b1 : ta_out2;
-
-wire ta_out2_nxt = (tacctl2[`TAOUTMODx]==3'b000) ? ta_out2_mode0 :
- (tacctl2[`TAOUTMODx]==3'b001) ? ta_out2_mode1 :
- (tacctl2[`TAOUTMODx]==3'b010) ? ta_out2_mode2 :
- (tacctl2[`TAOUTMODx]==3'b011) ? ta_out2_mode3 :
- (tacctl2[`TAOUTMODx]==3'b100) ? ta_out2_mode4 :
- (tacctl2[`TAOUTMODx]==3'b101) ? ta_out2_mode5 :
- (tacctl2[`TAOUTMODx]==3'b110) ? ta_out2_mode6 :
- ta_out2_mode7;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) ta_out2 <= 1'b0;
- else if ((tacctl2[`TAOUTMODx]==3'b001) & taclr) ta_out2 <= 1'b0;
- else if (tar_clk) ta_out2 <= ta_out2_nxt;
-
-assign ta_out2_en = ~tacctl2[`TACAP];
-
-
-//============================================================================
-// 9) Timer A interrupt generation
-//============================================================================
-
-
-assign taifg_set = tar_clk & (((tactl[`TAMCx]==2'b01) & (tar==taccr0)) |
- ((tactl[`TAMCx]==2'b10) & (tar==16'hffff)) |
- ((tactl[`TAMCx]==2'b11) & (tar_nxt==16'h0000) & tar_dec));
-
-assign ccifg0_set = tacctl0[`TACAP] ? cci0_cap : (tar_clk & ((tactl[`TAMCx]!=2'b00) & equ0));
-assign ccifg1_set = tacctl1[`TACAP] ? cci1_cap : (tar_clk & ((tactl[`TAMCx]!=2'b00) & equ1));
-assign ccifg2_set = tacctl2[`TACAP] ? cci2_cap : (tar_clk & ((tactl[`TAMCx]!=2'b00) & equ2));
-
-
-wire irq_ta0 = (tacctl0[`TACCIFG] & tacctl0[`TACCIE]);
-
-wire irq_ta1 = (tactl[`TAIFG] & tactl[`TAIE]) |
- (tacctl1[`TACCIFG] & tacctl1[`TACCIE]) |
- (tacctl2[`TACCIFG] & tacctl2[`TACCIE]);
-
-
-endmodule // omsp_timerA
-
-`ifdef OMSP_TA_NO_INCLUDE
-`else
-`include "omsp_timerA_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/periph/omsp_timerA_undefines.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_multiplier.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_multiplier.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_multiplier.v (nonexistent)
@@ -1,356 +0,0 @@
-
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_multiplier.v
-//
-// *Module Description:
-// 16x16 Hardware multiplier.
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 23 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2009-08-30 18:39:26 +0200 (Sun, 30 Aug 2009) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_defines.v"
-`endif
-
-module omsp_multiplier (
-
-// OUTPUTs
- per_dout, // Peripheral data output
-
-// INPUTs
- mclk, // Main system clock
- per_addr, // Peripheral address
- per_din, // Peripheral data input
- per_en, // Peripheral enable (high active)
- per_we, // Peripheral write enable (high active)
- puc_rst // Main system reset
-);
-
-// OUTPUTs
-//=========
-output [15:0] per_dout; // Peripheral data output
-
-// INPUTs
-//=========
-input mclk; // Main system clock
-input [13:0] per_addr; // Peripheral address
-input [15:0] per_din; // Peripheral data input
-input per_en; // Peripheral enable (high active)
-input [1:0] per_we; // Peripheral write enable (high active)
-input puc_rst; // Main system reset
-
-
-//=============================================================================
-// 1) PARAMETER/REGISTERS & WIRE DECLARATION
-//=============================================================================
-
-// Register base address (must be aligned to decoder bit width)
-parameter [14:0] BASE_ADDR = 15'h0130;
-
-// Decoder bit width (defines how many bits are considered for address decoding)
-parameter DEC_WD = 4;
-
-// Register addresses offset
-parameter [DEC_WD-1:0] OP1_MPY = 'h0,
- OP1_MPYS = 'h2,
- OP1_MAC = 'h4,
- OP1_MACS = 'h6,
- OP2 = 'h8,
- RESLO = 'hA,
- RESHI = 'hC,
- SUMEXT = 'hE;
-
-// Register one-hot decoder utilities
-parameter DEC_SZ = 2**DEC_WD;
-parameter [DEC_SZ-1:0] BASE_REG = {{DEC_SZ-1{1'b0}}, 1'b1};
-
-// Register one-hot decoder
-parameter [DEC_SZ-1:0] OP1_MPY_D = (BASE_REG << OP1_MPY),
- OP1_MPYS_D = (BASE_REG << OP1_MPYS),
- OP1_MAC_D = (BASE_REG << OP1_MAC),
- OP1_MACS_D = (BASE_REG << OP1_MACS),
- OP2_D = (BASE_REG << OP2),
- RESLO_D = (BASE_REG << RESLO),
- RESHI_D = (BASE_REG << RESHI),
- SUMEXT_D = (BASE_REG << SUMEXT);
-
-
-// Wire pre-declarations
-wire result_wr;
-wire result_clr;
-wire early_read;
-
-
-//============================================================================
-// 2) REGISTER DECODER
-//============================================================================
-
-// Local register selection
-wire reg_sel = per_en & (per_addr[13:DEC_WD-1]==BASE_ADDR[14:DEC_WD]);
-
-// Register local address
-wire [DEC_WD-1:0] reg_addr = {per_addr[DEC_WD-2:0], 1'b0};
-
-// Register address decode
-wire [DEC_SZ-1:0] reg_dec = (OP1_MPY_D & {DEC_SZ{(reg_addr == OP1_MPY )}}) |
- (OP1_MPYS_D & {DEC_SZ{(reg_addr == OP1_MPYS )}}) |
- (OP1_MAC_D & {DEC_SZ{(reg_addr == OP1_MAC )}}) |
- (OP1_MACS_D & {DEC_SZ{(reg_addr == OP1_MACS )}}) |
- (OP2_D & {DEC_SZ{(reg_addr == OP2 )}}) |
- (RESLO_D & {DEC_SZ{(reg_addr == RESLO )}}) |
- (RESHI_D & {DEC_SZ{(reg_addr == RESHI )}}) |
- (SUMEXT_D & {DEC_SZ{(reg_addr == SUMEXT )}});
-
-// Read/Write probes
-wire reg_write = |per_we & reg_sel;
-wire reg_read = ~|per_we & reg_sel;
-
-// Read/Write vectors
-wire [DEC_SZ-1:0] reg_wr = reg_dec & {DEC_SZ{reg_write}};
-wire [DEC_SZ-1:0] reg_rd = reg_dec & {DEC_SZ{reg_read}};
-
-
-//============================================================================
-// 3) REGISTERS
-//============================================================================
-
-// OP1 Register
-//-----------------
-reg [15:0] op1;
-
-wire op1_wr = reg_wr[OP1_MPY] |
- reg_wr[OP1_MPYS] |
- reg_wr[OP1_MAC] |
- reg_wr[OP1_MACS];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) op1 <= 16'h0000;
- else if (op1_wr) op1 <= per_din;
-
-wire [15:0] op1_rd = op1;
-
-
-// OP2 Register
-//-----------------
-reg [15:0] op2;
-
-wire op2_wr = reg_wr[OP2];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) op2 <= 16'h0000;
- else if (op2_wr) op2 <= per_din;
-
-wire [15:0] op2_rd = op2;
-
-
-// RESLO Register
-//-----------------
-reg [15:0] reslo;
-
-wire [15:0] reslo_nxt;
-wire reslo_wr = reg_wr[RESLO];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) reslo <= 16'h0000;
- else if (reslo_wr) reslo <= per_din;
- else if (result_clr) reslo <= 16'h0000;
- else if (result_wr) reslo <= reslo_nxt;
-
-wire [15:0] reslo_rd = early_read ? reslo_nxt : reslo;
-
-
-// RESHI Register
-//-----------------
-reg [15:0] reshi;
-
-wire [15:0] reshi_nxt;
-wire reshi_wr = reg_wr[RESHI];
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) reshi <= 16'h0000;
- else if (reshi_wr) reshi <= per_din;
- else if (result_clr) reshi <= 16'h0000;
- else if (result_wr) reshi <= reshi_nxt;
-
-wire [15:0] reshi_rd = early_read ? reshi_nxt : reshi;
-
-
-// SUMEXT Register
-//-----------------
-reg [1:0] sumext_s;
-
-wire [1:0] sumext_s_nxt;
-
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) sumext_s <= 2'b00;
- else if (op2_wr) sumext_s <= 2'b00;
- else if (result_wr) sumext_s <= sumext_s_nxt;
-
-wire [15:0] sumext_nxt = {{14{sumext_s_nxt[1]}}, sumext_s_nxt};
-wire [15:0] sumext = {{14{sumext_s[1]}}, sumext_s};
-wire [15:0] sumext_rd = early_read ? sumext_nxt : sumext;
-
-
-//============================================================================
-// 4) DATA OUTPUT GENERATION
-//============================================================================
-
-// Data output mux
-wire [15:0] op1_mux = op1_rd & {16{reg_rd[OP1_MPY] |
- reg_rd[OP1_MPYS] |
- reg_rd[OP1_MAC] |
- reg_rd[OP1_MACS]}};
-wire [15:0] op2_mux = op2_rd & {16{reg_rd[OP2]}};
-wire [15:0] reslo_mux = reslo_rd & {16{reg_rd[RESLO]}};
-wire [15:0] reshi_mux = reshi_rd & {16{reg_rd[RESHI]}};
-wire [15:0] sumext_mux = sumext_rd & {16{reg_rd[SUMEXT]}};
-
-wire [15:0] per_dout = op1_mux |
- op2_mux |
- reslo_mux |
- reshi_mux |
- sumext_mux;
-
-
-//============================================================================
-// 5) HARDWARE MULTIPLIER FUNCTIONAL LOGIC
-//============================================================================
-
-// Multiplier configuration
-//--------------------------
-
-// Detect signed mode
-reg sign_sel;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) sign_sel <= 1'b0;
- else if (op1_wr) sign_sel <= reg_wr[OP1_MPYS] | reg_wr[OP1_MACS];
-
-
-// Detect accumulate mode
-reg acc_sel;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) acc_sel <= 1'b0;
- else if (op1_wr) acc_sel <= reg_wr[OP1_MAC] | reg_wr[OP1_MACS];
-
-
-// Detect whenever the RESHI and RESLO registers should be cleared
-assign result_clr = op2_wr & ~acc_sel;
-
-// Combine RESHI & RESLO
-wire [31:0] result = {reshi, reslo};
-
-
-// 16x16 Multiplier (result computed in 1 clock cycle)
-//-----------------------------------------------------
-`ifdef MPY_16x16
-
-// Detect start of a multiplication
-reg cycle;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cycle <= 1'b0;
- else cycle <= op2_wr;
-
-assign result_wr = cycle;
-
-// Expand the operands to support signed & unsigned operations
-wire signed [16:0] op1_xp = {sign_sel & op1[15], op1};
-wire signed [16:0] op2_xp = {sign_sel & op2[15], op2};
-
-
-// 17x17 signed multiplication
-wire signed [33:0] product = op1_xp * op2_xp;
-
-// Accumulate
-wire [32:0] result_nxt = {1'b0, result} + {1'b0, product[31:0]};
-
-
-// Next register values
-assign reslo_nxt = result_nxt[15:0];
-assign reshi_nxt = result_nxt[31:16];
-assign sumext_s_nxt = sign_sel ? {2{result_nxt[31]}} :
- {1'b0, result_nxt[32]};
-
-
-// Since the MAC is completed within 1 clock cycle,
-// an early read can't happen.
-assign early_read = 1'b0;
-
-
-// 16x8 Multiplier (result computed in 2 clock cycles)
-//-----------------------------------------------------
-`else
-
-// Detect start of a multiplication
-reg [1:0] cycle;
-always @ (posedge mclk or posedge puc_rst)
- if (puc_rst) cycle <= 2'b00;
- else cycle <= {cycle[0], op2_wr};
-
-assign result_wr = |cycle;
-
-
-// Expand the operands to support signed & unsigned operations
-wire signed [16:0] op1_xp = {sign_sel & op1[15], op1};
-wire signed [8:0] op2_hi_xp = {sign_sel & op2[15], op2[15:8]};
-wire signed [8:0] op2_lo_xp = { 1'b0, op2[7:0]};
-wire signed [8:0] op2_xp = cycle[0] ? op2_hi_xp : op2_lo_xp;
-
-
-// 17x9 signed multiplication
-wire signed [25:0] product = op1_xp * op2_xp;
-
-wire [31:0] product_xp = cycle[0] ? {product[23:0], 8'h00} :
- {{8{sign_sel & product[23]}}, product[23:0]};
-
-// Accumulate
-wire [32:0] result_nxt = {1'b0, result} + {1'b0, product_xp[31:0]};
-
-
-// Next register values
-assign reslo_nxt = result_nxt[15:0];
-assign reshi_nxt = result_nxt[31:16];
-assign sumext_s_nxt = sign_sel ? {2{result_nxt[31]}} :
- {1'b0, result_nxt[32] | sumext_s[0]};
-
-// Since the MAC is completed within 2 clock cycle,
-// an early read can happen during the second cycle.
-assign early_read = cycle[1];
-
-`endif
-
-
-endmodule // omsp_multiplier
-
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_sfr.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_dbg.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_dbg.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_dbg.v (nonexistent)
@@ -1,841 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2001 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: omsp_dbg.v
-//
-// *Module Description:
-// Debug interface
-//
-// *Author(s):
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-// $Rev: 111 $
-// $LastChangedBy: olivier.girard $
-// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
-//----------------------------------------------------------------------------
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_defines.v"
-`endif
-
-module omsp_dbg (
-
-// OUTPUTs
- dbg_freeze, // Freeze peripherals
- dbg_halt_cmd, // Halt CPU command
- dbg_mem_addr, // Debug address for rd/wr access
- dbg_mem_dout, // Debug unit data output
- dbg_mem_en, // Debug unit memory enable
- dbg_mem_wr, // Debug unit memory write
- dbg_reg_wr, // Debug unit CPU register write
- dbg_cpu_reset, // Reset CPU from debug interface
- dbg_uart_txd, // Debug interface: UART TXD
-
-// INPUTs
- cpu_en_s, // Enable CPU code execution (synchronous)
- dbg_clk, // Debug unit clock
- dbg_en_s, // Debug interface enable (synchronous)
- dbg_halt_st, // Halt/Run status from CPU
- dbg_mem_din, // Debug unit Memory data input
- dbg_reg_din, // Debug unit CPU register data input
- dbg_rst, // Debug unit reset
- dbg_uart_rxd, // Debug interface: UART RXD (asynchronous)
- decode_noirq, // Frontend decode instruction
- eu_mab, // Execution-Unit Memory address bus
- eu_mb_en, // Execution-Unit Memory bus enable
- eu_mb_wr, // Execution-Unit Memory bus write transfer
- eu_mdb_in, // Memory data bus input
- eu_mdb_out, // Memory data bus output
- exec_done, // Execution completed
- fe_mb_en, // Frontend Memory bus enable
- fe_mdb_in, // Frontend Memory data bus input
- pc, // Program counter
- puc_rst // Main system reset
-);
-
-// OUTPUTs
-//=========
-output dbg_freeze; // Freeze peripherals
-output dbg_halt_cmd; // Halt CPU command
-output [15:0] dbg_mem_addr; // Debug address for rd/wr access
-output [15:0] dbg_mem_dout; // Debug unit data output
-output dbg_mem_en; // Debug unit memory enable
-output [1:0] dbg_mem_wr; // Debug unit memory write
-output dbg_reg_wr; // Debug unit CPU register write
-output dbg_cpu_reset; // Reset CPU from debug interface
-output dbg_uart_txd; // Debug interface: UART TXD
-
-// INPUTs
-//=========
-input cpu_en_s; // Enable CPU code execution (synchronous)
-input dbg_clk; // Debug unit clock
-input dbg_en_s; // Debug interface enable (synchronous)
-input dbg_halt_st; // Halt/Run status from CPU
-input [15:0] dbg_mem_din; // Debug unit Memory data input
-input [15:0] dbg_reg_din; // Debug unit CPU register data input
-input dbg_rst; // Debug unit reset
-input dbg_uart_rxd; // Debug interface: UART RXD (asynchronous)
-input decode_noirq; // Frontend decode instruction
-input [15:0] eu_mab; // Execution-Unit Memory address bus
-input eu_mb_en; // Execution-Unit Memory bus enable
-input [1:0] eu_mb_wr; // Execution-Unit Memory bus write transfer
-input [15:0] eu_mdb_in; // Memory data bus input
-input [15:0] eu_mdb_out; // Memory data bus output
-input exec_done; // Execution completed
-input fe_mb_en; // Frontend Memory bus enable
-input [15:0] fe_mdb_in; // Frontend Memory data bus input
-input [15:0] pc; // Program counter
-input puc_rst; // Main system reset
-
-
-//=============================================================================
-// 1) WIRE & PARAMETER DECLARATION
-//=============================================================================
-
-// Diverse wires and registers
-wire [5:0] dbg_addr;
-wire [15:0] dbg_din;
-wire dbg_wr;
-reg mem_burst;
-wire dbg_reg_rd;
-wire dbg_mem_rd;
-reg dbg_mem_rd_dly;
-wire dbg_swbrk;
-wire dbg_rd;
-reg dbg_rd_rdy;
-wire mem_burst_rd;
-wire mem_burst_wr;
-wire brk0_halt;
-wire brk0_pnd;
-wire [15:0] brk0_dout;
-wire brk1_halt;
-wire brk1_pnd;
-wire [15:0] brk1_dout;
-wire brk2_halt;
-wire brk2_pnd;
-wire [15:0] brk2_dout;
-wire brk3_halt;
-wire brk3_pnd;
-wire [15:0] brk3_dout;
-
-// Register addresses
-parameter CPU_ID_LO = 6'h00;
-parameter CPU_ID_HI = 6'h01;
-parameter CPU_CTL = 6'h02;
-parameter CPU_STAT = 6'h03;
-parameter MEM_CTL = 6'h04;
-parameter MEM_ADDR = 6'h05;
-parameter MEM_DATA = 6'h06;
-parameter MEM_CNT = 6'h07;
-`ifdef DBG_HWBRK_0
-parameter BRK0_CTL = 6'h08;
-parameter BRK0_STAT = 6'h09;
-parameter BRK0_ADDR0 = 6'h0A;
-parameter BRK0_ADDR1 = 6'h0B;
-`endif
-`ifdef DBG_HWBRK_1
-parameter BRK1_CTL = 6'h0C;
-parameter BRK1_STAT = 6'h0D;
-parameter BRK1_ADDR0 = 6'h0E;
-parameter BRK1_ADDR1 = 6'h0F;
-`endif
-`ifdef DBG_HWBRK_2
-parameter BRK2_CTL = 6'h10;
-parameter BRK2_STAT = 6'h11;
-parameter BRK2_ADDR0 = 6'h12;
-parameter BRK2_ADDR1 = 6'h13;
-`endif
-`ifdef DBG_HWBRK_3
-parameter BRK3_CTL = 6'h14;
-parameter BRK3_STAT = 6'h15;
-parameter BRK3_ADDR0 = 6'h16;
-parameter BRK3_ADDR1 = 6'h17;
-`endif
-
-// Register one-hot decoder
-parameter CPU_ID_LO_D = (64'h1 << CPU_ID_LO);
-parameter CPU_ID_HI_D = (64'h1 << CPU_ID_HI);
-parameter CPU_CTL_D = (64'h1 << CPU_CTL);
-parameter CPU_STAT_D = (64'h1 << CPU_STAT);
-parameter MEM_CTL_D = (64'h1 << MEM_CTL);
-parameter MEM_ADDR_D = (64'h1 << MEM_ADDR);
-parameter MEM_DATA_D = (64'h1 << MEM_DATA);
-parameter MEM_CNT_D = (64'h1 << MEM_CNT);
-`ifdef DBG_HWBRK_0
-parameter BRK0_CTL_D = (64'h1 << BRK0_CTL);
-parameter BRK0_STAT_D = (64'h1 << BRK0_STAT);
-parameter BRK0_ADDR0_D = (64'h1 << BRK0_ADDR0);
-parameter BRK0_ADDR1_D = (64'h1 << BRK0_ADDR1);
-`endif
-`ifdef DBG_HWBRK_1
-parameter BRK1_CTL_D = (64'h1 << BRK1_CTL);
-parameter BRK1_STAT_D = (64'h1 << BRK1_STAT);
-parameter BRK1_ADDR0_D = (64'h1 << BRK1_ADDR0);
-parameter BRK1_ADDR1_D = (64'h1 << BRK1_ADDR1);
-`endif
-`ifdef DBG_HWBRK_2
-parameter BRK2_CTL_D = (64'h1 << BRK2_CTL);
-parameter BRK2_STAT_D = (64'h1 << BRK2_STAT);
-parameter BRK2_ADDR0_D = (64'h1 << BRK2_ADDR0);
-parameter BRK2_ADDR1_D = (64'h1 << BRK2_ADDR1);
-`endif
-`ifdef DBG_HWBRK_3
-parameter BRK3_CTL_D = (64'h1 << BRK3_CTL);
-parameter BRK3_STAT_D = (64'h1 << BRK3_STAT);
-parameter BRK3_ADDR0_D = (64'h1 << BRK3_ADDR0);
-parameter BRK3_ADDR1_D = (64'h1 << BRK3_ADDR1);
-`endif
-
-// PUC is localy used as a data.
-reg [1:0] puc_sync;
-always @ (posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) puc_sync <= 2'b11;
- else puc_sync <= {puc_sync[0] , puc_rst};
-wire puc_s = puc_sync[1];
-
-
-//============================================================================
-// 2) REGISTER DECODER
-//============================================================================
-
-// Select Data register during a burst
-wire [5:0] dbg_addr_in = mem_burst ? MEM_DATA : dbg_addr;
-
-// Register address decode
-reg [63:0] reg_dec;
-always @(dbg_addr_in)
- case (dbg_addr_in)
- CPU_ID_LO : reg_dec = CPU_ID_LO_D;
- CPU_ID_HI : reg_dec = CPU_ID_HI_D;
- CPU_CTL : reg_dec = CPU_CTL_D;
- CPU_STAT : reg_dec = CPU_STAT_D;
- MEM_CTL : reg_dec = MEM_CTL_D;
- MEM_ADDR : reg_dec = MEM_ADDR_D;
- MEM_DATA : reg_dec = MEM_DATA_D;
- MEM_CNT : reg_dec = MEM_CNT_D;
-`ifdef DBG_HWBRK_0
- BRK0_CTL : reg_dec = BRK0_CTL_D;
- BRK0_STAT : reg_dec = BRK0_STAT_D;
- BRK0_ADDR0: reg_dec = BRK0_ADDR0_D;
- BRK0_ADDR1: reg_dec = BRK0_ADDR1_D;
-`endif
-`ifdef DBG_HWBRK_1
- BRK1_CTL : reg_dec = BRK1_CTL_D;
- BRK1_STAT : reg_dec = BRK1_STAT_D;
- BRK1_ADDR0: reg_dec = BRK1_ADDR0_D;
- BRK1_ADDR1: reg_dec = BRK1_ADDR1_D;
-`endif
-`ifdef DBG_HWBRK_2
- BRK2_CTL : reg_dec = BRK2_CTL_D;
- BRK2_STAT : reg_dec = BRK2_STAT_D;
- BRK2_ADDR0: reg_dec = BRK2_ADDR0_D;
- BRK2_ADDR1: reg_dec = BRK2_ADDR1_D;
-`endif
-`ifdef DBG_HWBRK_3
- BRK3_CTL : reg_dec = BRK3_CTL_D;
- BRK3_STAT : reg_dec = BRK3_STAT_D;
- BRK3_ADDR0: reg_dec = BRK3_ADDR0_D;
- BRK3_ADDR1: reg_dec = BRK3_ADDR1_D;
-`endif
- default: reg_dec = {64{1'b0}};
- endcase
-
-// Read/Write probes
-wire reg_write = dbg_wr;
-wire reg_read = 1'b1;
-
-// Read/Write vectors
-wire [63:0] reg_wr = reg_dec & {64{reg_write}};
-wire [63:0] reg_rd = reg_dec & {64{reg_read}};
-
-
-//=============================================================================
-// 3) REGISTER: CORE INTERFACE
-//=============================================================================
-
-// CPU_ID Register
-//-----------------
-// -------------------------------------------------------------------
-// CPU_ID_LO: | 15 14 13 12 11 10 9 | 8 7 6 5 4 | 3 | 2 1 0 |
-// |----------------------------+-----------------+------+-------------|
-// | PER_SPACE | USER_VERSION | ASIC | CPU_VERSION |
-// --------------------------------------------------------------------
-// CPU_ID_HI: | 15 14 13 12 11 10 | 9 8 7 6 5 4 3 2 1 | 0 |
-// |----------------------------+-------------------------------+------|
-// | PMEM_SIZE | DMEM_SIZE | MPY |
-// -------------------------------------------------------------------
-
-wire [2:0] cpu_version = `CPU_VERSION;
-`ifdef ASIC
-wire cpu_asic = 1'b1;
-`else
-wire cpu_asic = 1'b0;
-`endif
-wire [4:0] user_version = `USER_VERSION;
-wire [6:0] per_space = (`PER_SIZE >> 9); // cpu_id_per * 512 = peripheral space size
-`ifdef MULTIPLIER
-wire mpy_info = 1'b1;
-`else
-wire mpy_info = 1'b0;
-`endif
-wire [8:0] dmem_size = (`DMEM_SIZE >> 7); // cpu_id_dmem * 128 = data memory size
-wire [5:0] pmem_size = (`PMEM_SIZE >> 10); // cpu_id_pmem * 1024 = program memory size
-
-wire [31:0] cpu_id = {pmem_size,
- dmem_size,
- mpy_info,
- per_space,
- user_version,
- cpu_asic,
- cpu_version};
-
-
-// CPU_CTL Register
-//-----------------------------------------------------------------------------
-// 7 6 5 4 3 2 1 0
-// Reserved CPU_RST RST_BRK_EN FRZ_BRK_EN SW_BRK_EN ISTEP RUN HALT
-//-----------------------------------------------------------------------------
-reg [6:3] cpu_ctl;
-
-wire cpu_ctl_wr = reg_wr[CPU_CTL];
-
-always @ (posedge dbg_clk or posedge dbg_rst)
-`ifdef DBG_RST_BRK_EN
- if (dbg_rst) cpu_ctl <= 4'h4;
-`else
- if (dbg_rst) cpu_ctl <= 4'h0;
-`endif
- else if (cpu_ctl_wr) cpu_ctl <= dbg_din[6:3];
-
-wire [7:0] cpu_ctl_full = {1'b0, cpu_ctl, 3'b000};
-
-wire halt_cpu = cpu_ctl_wr & dbg_din[`HALT] & ~dbg_halt_st;
-wire run_cpu = cpu_ctl_wr & dbg_din[`RUN] & dbg_halt_st;
-wire istep = cpu_ctl_wr & dbg_din[`ISTEP] & dbg_halt_st;
-
-
-// CPU_STAT Register
-//------------------------------------------------------------------------------------
-// 7 6 5 4 3 2 1 0
-// HWBRK3_PND HWBRK2_PND HWBRK1_PND HWBRK0_PND SWBRK_PND PUC_PND Res. HALT_RUN
-//------------------------------------------------------------------------------------
-reg [3:2] cpu_stat;
-
-wire cpu_stat_wr = reg_wr[CPU_STAT];
-wire [3:2] cpu_stat_set = {dbg_swbrk, puc_s};
-wire [3:2] cpu_stat_clr = ~dbg_din[3:2];
-
-always @ (posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) cpu_stat <= 2'b00;
- else if (cpu_stat_wr) cpu_stat <= ((cpu_stat & cpu_stat_clr) | cpu_stat_set);
- else cpu_stat <= (cpu_stat | cpu_stat_set);
-
-wire [7:0] cpu_stat_full = {brk3_pnd, brk2_pnd, brk1_pnd, brk0_pnd,
- cpu_stat, 1'b0, dbg_halt_st};
-
-
-//=============================================================================
-// 4) REGISTER: MEMORY INTERFACE
-//=============================================================================
-
-// MEM_CTL Register
-//-----------------------------------------------------------------------------
-// 7 6 5 4 3 2 1 0
-// Reserved B/W MEM/REG RD/WR START
-//
-// START : - 0 : Do nothing.
-// - 1 : Initiate memory transfer.
-//
-// RD/WR : - 0 : Read access.
-// - 1 : Write access.
-//
-// MEM/REG: - 0 : Memory access.
-// - 1 : CPU Register access.
-//
-// B/W : - 0 : 16 bit access.
-// - 1 : 8 bit access (not valid for CPU Registers).
-//
-//-----------------------------------------------------------------------------
-reg [3:1] mem_ctl;
-
-wire mem_ctl_wr = reg_wr[MEM_CTL];
-
-always @ (posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) mem_ctl <= 3'h0;
- else if (mem_ctl_wr) mem_ctl <= dbg_din[3:1];
-
-wire [7:0] mem_ctl_full = {4'b0000, mem_ctl, 1'b0};
-
-reg mem_start;
-always @ (posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) mem_start <= 1'b0;
- else mem_start <= mem_ctl_wr & dbg_din[0];
-
-wire mem_bw = mem_ctl[3];
-
-// MEM_DATA Register
-//------------------
-reg [15:0] mem_data;
-reg [15:0] mem_addr;
-wire mem_access;
-
-wire mem_data_wr = reg_wr[MEM_DATA];
-
-wire [15:0] dbg_mem_din_bw = ~mem_bw ? dbg_mem_din :
- mem_addr[0] ? {8'h00, dbg_mem_din[15:8]} :
- {8'h00, dbg_mem_din[7:0]};
-
-always @ (posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) mem_data <= 16'h0000;
- else if (mem_data_wr) mem_data <= dbg_din;
- else if (dbg_reg_rd) mem_data <= dbg_reg_din;
- else if (dbg_mem_rd_dly) mem_data <= dbg_mem_din_bw;
-
-
-// MEM_ADDR Register
-//------------------
-reg [15:0] mem_cnt;
-
-wire mem_addr_wr = reg_wr[MEM_ADDR];
-wire dbg_mem_acc = (|dbg_mem_wr | (dbg_rd_rdy & ~mem_ctl[2]));
-wire dbg_reg_acc = ( dbg_reg_wr | (dbg_rd_rdy & mem_ctl[2]));
-
-wire [15:0] mem_addr_inc = (mem_cnt==16'h0000) ? 16'h0000 :
- (dbg_mem_acc & ~mem_bw) ? 16'h0002 :
- (dbg_mem_acc | dbg_reg_acc) ? 16'h0001 : 16'h0000;
-
-always @ (posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) mem_addr <= 16'h0000;
- else if (mem_addr_wr) mem_addr <= dbg_din;
- else mem_addr <= mem_addr + mem_addr_inc;
-
-// MEM_CNT Register
-//------------------
-
-wire mem_cnt_wr = reg_wr[MEM_CNT];
-
-wire [15:0] mem_cnt_dec = (mem_cnt==16'h0000) ? 16'h0000 :
- (dbg_mem_acc | dbg_reg_acc) ? 16'hffff : 16'h0000;
-
-always @ (posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) mem_cnt <= 16'h0000;
- else if (mem_cnt_wr) mem_cnt <= dbg_din;
- else mem_cnt <= mem_cnt + mem_cnt_dec;
-
-
-//=============================================================================
-// 5) BREAKPOINTS / WATCHPOINTS
-//=============================================================================
-
-`ifdef DBG_HWBRK_0
-// Hardware Breakpoint/Watchpoint Register read select
-wire [3:0] brk0_reg_rd = {reg_rd[BRK0_ADDR1],
- reg_rd[BRK0_ADDR0],
- reg_rd[BRK0_STAT],
- reg_rd[BRK0_CTL]};
-
-// Hardware Breakpoint/Watchpoint Register write select
-wire [3:0] brk0_reg_wr = {reg_wr[BRK0_ADDR1],
- reg_wr[BRK0_ADDR0],
- reg_wr[BRK0_STAT],
- reg_wr[BRK0_CTL]};
-
-omsp_dbg_hwbrk dbg_hwbr_0 (
-
-// OUTPUTs
- .brk_halt (brk0_halt), // Hardware breakpoint command
- .brk_pnd (brk0_pnd), // Hardware break/watch-point pending
- .brk_dout (brk0_dout), // Hardware break/watch-point register data input
-
-// INPUTs
- .brk_reg_rd (brk0_reg_rd), // Hardware break/watch-point register read select
- .brk_reg_wr (brk0_reg_wr), // Hardware break/watch-point register write select
- .dbg_clk (dbg_clk), // Debug unit clock
- .dbg_din (dbg_din), // Debug register data input
- .dbg_rst (dbg_rst), // Debug unit reset
- .eu_mab (eu_mab), // Execution-Unit Memory address bus
- .eu_mb_en (eu_mb_en), // Execution-Unit Memory bus enable
- .eu_mb_wr (eu_mb_wr), // Execution-Unit Memory bus write transfer
- .eu_mdb_in (eu_mdb_in), // Memory data bus input
- .eu_mdb_out (eu_mdb_out), // Memory data bus output
- .exec_done (exec_done), // Execution completed
- .fe_mb_en (fe_mb_en), // Frontend Memory bus enable
- .pc (pc) // Program counter
-);
-
-`else
-assign brk0_halt = 1'b0;
-assign brk0_pnd = 1'b0;
-assign brk0_dout = 16'h0000;
-`endif
-
-`ifdef DBG_HWBRK_1
-// Hardware Breakpoint/Watchpoint Register read select
-wire [3:0] brk1_reg_rd = {reg_rd[BRK1_ADDR1],
- reg_rd[BRK1_ADDR0],
- reg_rd[BRK1_STAT],
- reg_rd[BRK1_CTL]};
-
-// Hardware Breakpoint/Watchpoint Register write select
-wire [3:0] brk1_reg_wr = {reg_wr[BRK1_ADDR1],
- reg_wr[BRK1_ADDR0],
- reg_wr[BRK1_STAT],
- reg_wr[BRK1_CTL]};
-
-omsp_dbg_hwbrk dbg_hwbr_1 (
-
-// OUTPUTs
- .brk_halt (brk1_halt), // Hardware breakpoint command
- .brk_pnd (brk1_pnd), // Hardware break/watch-point pending
- .brk_dout (brk1_dout), // Hardware break/watch-point register data input
-
-// INPUTs
- .brk_reg_rd (brk1_reg_rd), // Hardware break/watch-point register read select
- .brk_reg_wr (brk1_reg_wr), // Hardware break/watch-point register write select
- .dbg_clk (dbg_clk), // Debug unit clock
- .dbg_din (dbg_din), // Debug register data input
- .dbg_rst (dbg_rst), // Debug unit reset
- .eu_mab (eu_mab), // Execution-Unit Memory address bus
- .eu_mb_en (eu_mb_en), // Execution-Unit Memory bus enable
- .eu_mb_wr (eu_mb_wr), // Execution-Unit Memory bus write transfer
- .eu_mdb_in (eu_mdb_in), // Memory data bus input
- .eu_mdb_out (eu_mdb_out), // Memory data bus output
- .exec_done (exec_done), // Execution completed
- .fe_mb_en (fe_mb_en), // Frontend Memory bus enable
- .pc (pc) // Program counter
-);
-
-`else
-assign brk1_halt = 1'b0;
-assign brk1_pnd = 1'b0;
-assign brk1_dout = 16'h0000;
-`endif
-
- `ifdef DBG_HWBRK_2
-// Hardware Breakpoint/Watchpoint Register read select
-wire [3:0] brk2_reg_rd = {reg_rd[BRK2_ADDR1],
- reg_rd[BRK2_ADDR0],
- reg_rd[BRK2_STAT],
- reg_rd[BRK2_CTL]};
-
-// Hardware Breakpoint/Watchpoint Register write select
-wire [3:0] brk2_reg_wr = {reg_wr[BRK2_ADDR1],
- reg_wr[BRK2_ADDR0],
- reg_wr[BRK2_STAT],
- reg_wr[BRK2_CTL]};
-
-omsp_dbg_hwbrk dbg_hwbr_2 (
-
-// OUTPUTs
- .brk_halt (brk2_halt), // Hardware breakpoint command
- .brk_pnd (brk2_pnd), // Hardware break/watch-point pending
- .brk_dout (brk2_dout), // Hardware break/watch-point register data input
-
-// INPUTs
- .brk_reg_rd (brk2_reg_rd), // Hardware break/watch-point register read select
- .brk_reg_wr (brk2_reg_wr), // Hardware break/watch-point register write select
- .dbg_clk (dbg_clk), // Debug unit clock
- .dbg_din (dbg_din), // Debug register data input
- .dbg_rst (dbg_rst), // Debug unit reset
- .eu_mab (eu_mab), // Execution-Unit Memory address bus
- .eu_mb_en (eu_mb_en), // Execution-Unit Memory bus enable
- .eu_mb_wr (eu_mb_wr), // Execution-Unit Memory bus write transfer
- .eu_mdb_in (eu_mdb_in), // Memory data bus input
- .eu_mdb_out (eu_mdb_out), // Memory data bus output
- .exec_done (exec_done), // Execution completed
- .fe_mb_en (fe_mb_en), // Frontend Memory bus enable
- .pc (pc) // Program counter
-);
-
-`else
-assign brk2_halt = 1'b0;
-assign brk2_pnd = 1'b0;
-assign brk2_dout = 16'h0000;
-`endif
-
-`ifdef DBG_HWBRK_3
-// Hardware Breakpoint/Watchpoint Register read select
-wire [3:0] brk3_reg_rd = {reg_rd[BRK3_ADDR1],
- reg_rd[BRK3_ADDR0],
- reg_rd[BRK3_STAT],
- reg_rd[BRK3_CTL]};
-
-// Hardware Breakpoint/Watchpoint Register write select
-wire [3:0] brk3_reg_wr = {reg_wr[BRK3_ADDR1],
- reg_wr[BRK3_ADDR0],
- reg_wr[BRK3_STAT],
- reg_wr[BRK3_CTL]};
-
-omsp_dbg_hwbrk dbg_hwbr_3 (
-
-// OUTPUTs
- .brk_halt (brk3_halt), // Hardware breakpoint command
- .brk_pnd (brk3_pnd), // Hardware break/watch-point pending
- .brk_dout (brk3_dout), // Hardware break/watch-point register data input
-
-// INPUTs
- .brk_reg_rd (brk3_reg_rd), // Hardware break/watch-point register read select
- .brk_reg_wr (brk3_reg_wr), // Hardware break/watch-point register write select
- .dbg_clk (dbg_clk), // Debug unit clock
- .dbg_din (dbg_din), // Debug register data input
- .dbg_rst (dbg_rst), // Debug unit reset
- .eu_mab (eu_mab), // Execution-Unit Memory address bus
- .eu_mb_en (eu_mb_en), // Execution-Unit Memory bus enable
- .eu_mb_wr (eu_mb_wr), // Execution-Unit Memory bus write transfer
- .eu_mdb_in (eu_mdb_in), // Memory data bus input
- .eu_mdb_out (eu_mdb_out), // Memory data bus output
- .exec_done (exec_done), // Execution completed
- .fe_mb_en (fe_mb_en), // Frontend Memory bus enable
- .pc (pc) // Program counter
-);
-
-`else
-assign brk3_halt = 1'b0;
-assign brk3_pnd = 1'b0;
-assign brk3_dout = 16'h0000;
-`endif
-
-
-//============================================================================
-// 6) DATA OUTPUT GENERATION
-//============================================================================
-
-wire [15:0] cpu_id_lo_rd = cpu_id[15:0] & {16{reg_rd[CPU_ID_LO]}};
-wire [15:0] cpu_id_hi_rd = cpu_id[31:16] & {16{reg_rd[CPU_ID_HI]}};
-wire [15:0] cpu_ctl_rd = {8'h00, cpu_ctl_full} & {16{reg_rd[CPU_CTL]}};
-wire [15:0] cpu_stat_rd = {8'h00, cpu_stat_full} & {16{reg_rd[CPU_STAT]}};
-wire [15:0] mem_ctl_rd = {8'h00, mem_ctl_full} & {16{reg_rd[MEM_CTL]}};
-wire [15:0] mem_data_rd = mem_data & {16{reg_rd[MEM_DATA]}};
-wire [15:0] mem_addr_rd = mem_addr & {16{reg_rd[MEM_ADDR]}};
-wire [15:0] mem_cnt_rd = mem_cnt & {16{reg_rd[MEM_CNT]}};
-
-wire [15:0] dbg_dout = cpu_id_lo_rd |
- cpu_id_hi_rd |
- cpu_ctl_rd |
- cpu_stat_rd |
- mem_ctl_rd |
- mem_data_rd |
- mem_addr_rd |
- mem_cnt_rd |
- brk0_dout |
- brk1_dout |
- brk2_dout |
- brk3_dout;
-
-// Tell UART/JTAG interface that the data is ready to be read
-always @ (posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) dbg_rd_rdy <= 1'b0;
- else if (mem_burst | mem_burst_rd) dbg_rd_rdy <= (dbg_reg_rd | dbg_mem_rd_dly);
- else dbg_rd_rdy <= dbg_rd;
-
-
-//============================================================================
-// 7) CPU CONTROL
-//============================================================================
-
-// Reset CPU
-//--------------------------
-wire dbg_cpu_reset = cpu_ctl[`CPU_RST];
-
-
-// Break after reset
-//--------------------------
-wire halt_rst = cpu_ctl[`RST_BRK_EN] & dbg_en_s & puc_s;
-
-
-// Freeze peripherals
-//--------------------------
-wire dbg_freeze = dbg_halt_st & (cpu_ctl[`FRZ_BRK_EN] | ~cpu_en_s);
-
-
-// Software break
-//--------------------------
-assign dbg_swbrk = (fe_mdb_in==`DBG_SWBRK_OP) & decode_noirq & cpu_ctl[`SW_BRK_EN];
-
-
-// Single step
-//--------------------------
-reg [1:0] inc_step;
-always @(posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) inc_step <= 2'b00;
- else if (istep) inc_step <= 2'b11;
- else inc_step <= {inc_step[0], 1'b0};
-
-
-// Run / Halt
-//--------------------------
-reg halt_flag;
-
-wire mem_halt_cpu;
-wire mem_run_cpu;
-
-wire halt_flag_clr = run_cpu | mem_run_cpu;
-wire halt_flag_set = halt_cpu | halt_rst | dbg_swbrk | mem_halt_cpu |
- brk0_halt | brk1_halt | brk2_halt | brk3_halt;
-
-always @(posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) halt_flag <= 1'b0;
- else if (halt_flag_clr) halt_flag <= 1'b0;
- else if (halt_flag_set) halt_flag <= 1'b1;
-
-wire dbg_halt_cmd = (halt_flag | halt_flag_set) & ~inc_step[1];
-
-
-//============================================================================
-// 8) MEMORY CONTROL
-//============================================================================
-
-// Control Memory bursts
-//------------------------------
-
-wire mem_burst_start = (mem_start & |mem_cnt);
-wire mem_burst_end = ((dbg_wr | dbg_rd_rdy) & ~|mem_cnt);
-
-// Detect when burst is on going
-always @(posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) mem_burst <= 1'b0;
- else if (mem_burst_start) mem_burst <= 1'b1;
- else if (mem_burst_end) mem_burst <= 1'b0;
-
-// Control signals for UART/JTAG interface
-assign mem_burst_rd = (mem_burst_start & ~mem_ctl[1]);
-assign mem_burst_wr = (mem_burst_start & mem_ctl[1]);
-
-// Trigger CPU Register or memory access during a burst
-reg mem_startb;
-always @(posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) mem_startb <= 1'b0;
- else mem_startb <= (mem_burst & (dbg_wr | dbg_rd)) | mem_burst_rd;
-
-// Combine single and burst memory start of sequence
-wire mem_seq_start = ((mem_start & ~|mem_cnt) | mem_startb);
-
-
-// Memory access state machine
-//------------------------------
-reg [1:0] mem_state;
-reg [1:0] mem_state_nxt;
-
-// State machine definition
-parameter M_IDLE = 2'h0;
-parameter M_SET_BRK = 2'h1;
-parameter M_ACCESS_BRK = 2'h2;
-parameter M_ACCESS = 2'h3;
-
-// State transition
-always @(mem_state or mem_seq_start or dbg_halt_st)
- case (mem_state)
- M_IDLE : mem_state_nxt = ~mem_seq_start ? M_IDLE :
- dbg_halt_st ? M_ACCESS : M_SET_BRK;
- M_SET_BRK : mem_state_nxt = dbg_halt_st ? M_ACCESS_BRK : M_SET_BRK;
- M_ACCESS_BRK : mem_state_nxt = M_IDLE;
- M_ACCESS : mem_state_nxt = M_IDLE;
- default : mem_state_nxt = M_IDLE;
- endcase
-
-// State machine
-always @(posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) mem_state <= M_IDLE;
- else mem_state <= mem_state_nxt;
-
-// Utility signals
-assign mem_halt_cpu = (mem_state==M_IDLE) & (mem_state_nxt==M_SET_BRK);
-assign mem_run_cpu = (mem_state==M_ACCESS_BRK) & (mem_state_nxt==M_IDLE);
-assign mem_access = (mem_state==M_ACCESS) | (mem_state==M_ACCESS_BRK);
-
-
-// Interface to CPU Registers and Memory bacbkone
-//------------------------------------------------
-assign dbg_mem_addr = mem_addr;
-assign dbg_mem_dout = ~mem_bw ? mem_data :
- mem_addr[0] ? {mem_data[7:0], 8'h00} :
- {8'h00, mem_data[7:0]};
-
-assign dbg_reg_wr = mem_access & mem_ctl[1] & mem_ctl[2];
-assign dbg_reg_rd = mem_access & ~mem_ctl[1] & mem_ctl[2];
-
-assign dbg_mem_en = mem_access & ~mem_ctl[2];
-assign dbg_mem_rd = dbg_mem_en & ~mem_ctl[1];
-
-wire [1:0] dbg_mem_wr_msk = ~mem_bw ? 2'b11 :
- mem_addr[0] ? 2'b10 : 2'b01;
-assign dbg_mem_wr = {2{dbg_mem_en & mem_ctl[1]}} & dbg_mem_wr_msk;
-
-
-// It takes one additional cycle to read from Memory as from registers
-always @(posedge dbg_clk or posedge dbg_rst)
- if (dbg_rst) dbg_mem_rd_dly <= 1'b0;
- else dbg_mem_rd_dly <= dbg_mem_rd;
-
-
-//=============================================================================
-// 9) UART COMMUNICATION
-//=============================================================================
-`ifdef DBG_UART
-omsp_dbg_uart dbg_uart_0 (
-
-// OUTPUTs
- .dbg_addr (dbg_addr), // Debug register address
- .dbg_din (dbg_din), // Debug register data input
- .dbg_rd (dbg_rd), // Debug register data read
- .dbg_uart_txd (dbg_uart_txd), // Debug interface: UART TXD
- .dbg_wr (dbg_wr), // Debug register data write
-
-// INPUTs
- .dbg_clk (dbg_clk), // Debug unit clock
- .dbg_dout (dbg_dout), // Debug register data output
- .dbg_rd_rdy (dbg_rd_rdy), // Debug register data is ready for read
- .dbg_rst (dbg_rst), // Debug unit reset
- .dbg_uart_rxd (dbg_uart_rxd), // Debug interface: UART RXD
- .mem_burst (mem_burst), // Burst on going
- .mem_burst_end(mem_burst_end), // End TX/RX burst
- .mem_burst_rd (mem_burst_rd), // Start TX burst
- .mem_burst_wr (mem_burst_wr), // Start RX burst
- .mem_bw (mem_bw) // Burst byte width
-);
-
-`else
-assign dbg_addr = 6'h00;
-assign dbg_din = 16'h0000;
-assign dbg_rd = 1'b0;
-assign dbg_uart_txd = 1'b0;
-assign dbg_wr = 1'b0;
-`endif
-
-
-//=============================================================================
-// 10) JTAG COMMUNICATION
-//=============================================================================
-`ifdef DBG_JTAG
-JTAG INTERFACE IS NOT SUPPORTED YET
-`else
-`endif
-
-endmodule // dbg
-
-`ifdef OMSP_NO_INCLUDE
-`else
-`include "openMSP430_undefines.v"
-`endif
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openmsp430/omsp_dbg.v
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openMSP430_fpga.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openMSP430_fpga.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/openMSP430_fpga.v (nonexistent)
@@ -1,563 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2011 Authors
-//
-// This source file may be used and distributed without restriction provided
-// that this copyright statement is not removed from the file and that any
-// derivative work contains the original copyright notice and the associated
-// disclaimer.
-//
-// This source file 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 source 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 source; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-//----------------------------------------------------------------------------
-//
-// *File Name: openMSP430_fpga.v
-//
-// *Module Description:
-// openMSP430 FPGA Top-level for the Avnet LX9 Microboard
-//
-// *Author(s):
-// - Ricardo Ribalda, ricardo.ribalda@gmail.com
-// - Olivier Girard, olgirard@gmail.com
-//
-//----------------------------------------------------------------------------
-`include "openmsp430/openMSP430_defines.v"
-
-module openMSP430_fpga (
- // Clock Sources
- CLK_66MHz,
- // Clock output
- MCLK,
- //Swich buttons
- SW3,
- SW2,
- SW1,
- SW0,
- // Push Button Switches
- BTN0,
- // J5 PMOD_P4 and ground
- DBG_OFF,
- // LEDs
- LED3,
- LED2,
- LED1,
- LED0,
- // RS-232 Port
- UART_RXD,
- UART_TXD
-);
-
-// Clock Sources
-input CLK_66MHz;
-
-output MCLK;
-
-// Slide Switches
-input SW3;
-input SW2;
-input SW1;
-input SW0;
-
-// Push Button Switches
-input BTN0;
-
-// J5 PMOD_P4 and ground
-input DBG_OFF;
-
-// LEDs
-output LED3;
-output LED2;
-output LED1;
-output LED0;
-
-// RS-232 Port
-input UART_RXD;
-output UART_TXD;
-
-
-//=============================================================================
-// 1) INTERNAL WIRES/REGISTERS/PARAMETERS DECLARATION
-//=============================================================================
-
-// openMSP430 output buses
-wire [13:0] per_addr;
-wire [15:0] per_din;
-wire [1:0] per_we;
-wire [`DMEM_MSB:0] dmem_addr;
-wire [15:0] dmem_din;
-wire [1:0] dmem_wen;
-wire [1:0] dmem_wen_n;
-wire [`PMEM_MSB:0] pmem_addr;
-wire [15:0] pmem_din;
-wire [1:0] pmem_wen;
-wire [1:0] pmem_wen_n;
-wire [13:0] irq_acc;
-
-// openMSP430 input buses
-wire [13:0] irq_bus;
-wire [15:0] per_dout;
-wire [15:0] dmem_dout;
-wire [15:0] pmem_dout;
-
-// GPIO
-wire [7:0] p1_din;
-wire [7:0] p1_dout;
-wire [7:0] p1_dout_en;
-wire [7:0] p1_sel;
-wire [7:0] p2_din;
-wire [7:0] p2_dout;
-wire [7:0] p2_dout_en;
-wire [7:0] p2_sel;
-wire [7:0] p3_dout;
-wire [7:0] p3_dout_en;
-wire [7:0] p4_din;
-wire [15:0] per_dout_dio;
-
-// Timer A
-wire [15:0] per_dout_tA;
-
-// Others
-wire reset_pin;
-
-//=============================================================================
-// 2) CLOCK GENERATION
-//=============================================================================
-
-// Input buffers
-//------------------------
-IBUFG ibuf_clk_main (.O(clk_66M_in), .I(CLK_66MHz));
-
-
-// Digital Clock Manager
-//------------------------
-DCM_SP #(
- .CLKFX_MULTIPLY(3),
- .CLKFX_DIVIDE(10),
- .CLKIN_PERIOD(15.000),
- )dcm_inst(
-// OUTPUTs
- .CLKFX (dcm_clk),
- .CLK0 (CLK0_BUF),
- .LOCKED (dcm_locked),
-// INPUTs
- .CLKFB (CLKFB_IN),
- .CLKIN (clk_66M_in),
- .PSEN (1'b0),
- .RST (reset_pin)
-);
-
-BUFG CLK0_BUFG_INST (
- .I(CLK0_BUF),
- .O(CLKFB_IN)
-);
-
-//synthesis translate_off
-defparam dcm_inst.CLKFX_MULTIPLY = 3;
-defparam dcm_inst.CLKFX_DIVIDE = 10;
-defparam dcm_int.CLKIN_PERIOD = 15.000;
-//synthesis translate_on
-
-// Clock buffers
-//------------------------
-BUFG buf_sys_clock (.O(clk_sys), .I(dcm_clk));
-
-//=============================================================================
-// 3) RESET GENERATION & FPGA STARTUP
-//=============================================================================
-
-// Reset input buffer
-IBUF ibuf_reset_n (.O(reset_pin), .I(BTN0));
-wire reset_pin_n = ~reset_pin;
-
-// Release the reset only, if the DCM is locked
-assign reset_n = reset_pin_n & dcm_locked;
-
-//=============================================================================
-// 4) OPENMSP430
-//=============================================================================
-
-openMSP430 openMSP430_0 (
-
-// OUTPUTs
- .aclk_en (aclk_en), // ACLK enable
- .dbg_freeze (dbg_freeze), // Freeze peripherals
- .dbg_uart_txd (dbg_uart_txd), // Debug interface: UART TXD
- .dmem_addr (dmem_addr), // Data Memory address
- .dmem_cen (dmem_cen), // Data Memory chip enable (low active)
- .dmem_din (dmem_din), // Data Memory data input
- .dmem_wen (dmem_wen), // Data Memory write enable (low active)
- .irq_acc (irq_acc), // Interrupt request accepted (one-hot signal)
- .mclk (mclk), // Main system clock
- .per_addr (per_addr), // Peripheral address
- .per_din (per_din), // Peripheral data input
- .per_we (per_we), // Peripheral write enable (high active)
- .per_en (per_en), // Peripheral enable (high active)
- .pmem_addr (pmem_addr), // Program Memory address
- .pmem_cen (pmem_cen), // Program Memory chip enable (low active)
- .pmem_din (pmem_din), // Program Memory data input (optional)
- .pmem_wen (pmem_wen), // Program Memory write enable (low active) (optional)
- .puc_rst (puc_rst), // Main system reset
- .smclk_en (smclk_en), // SMCLK enable
-
-// INPUTs
- .cpu_en (1'b1), // Enable CPU code execution (asynchronous)
- .dbg_en (1'b1), // Debug interface enable (asynchronous)
- .dbg_uart_rxd (dbg_uart_rxd), // Debug interface: UART RXD
- .dco_clk (clk_sys), // Fast oscillator (fast clock)
- .dmem_dout (dmem_dout), // Data Memory data output
- .irq (irq_bus), // Maskable interrupts
- .lfxt_clk (1'b0), // Low frequency oscillator (typ 32kHz)
- .nmi (nmi), // Non-maskable interrupt (asynchronous)
- .per_dout (per_dout), // Peripheral data output
- .pmem_dout (pmem_dout), // Program Memory data output
- .reset_n (reset_n) // Reset Pin (low active)
-);
-
-
-//=============================================================================
-// 5) OPENMSP430 PERIPHERALS
-//=============================================================================
-
-//
-// Digital I/O
-//-------------------------------
-
-omsp_gpio #(.P1_EN(1),
- .P2_EN(1),
- .P3_EN(1),
- .P4_EN(1),
- .P5_EN(0),
- .P6_EN(0)) gpio_0 (
-
-// OUTPUTs
- .irq_port1 (irq_port1), // Port 1 interrupt
- .irq_port2 (irq_port2), // Port 2 interrupt
- .p1_dout (p1_dout), // Port 1 data output
- .p1_dout_en (p1_dout_en), // Port 1 data output enable
- .p1_sel (p1_sel), // Port 1 function select
- .p2_dout (p2_dout), // Port 2 data output
- .p2_dout_en (p2_dout_en), // Port 2 data output enable
- .p2_sel (p2_sel), // Port 2 function select
- .p3_dout (p3_dout), // Port 3 data output
- .p3_dout_en (p3_dout_en), // Port 3 data output enable
- .p3_sel (), // Port 3 function select
- .p4_dout (), // Port 4 data output
- .p4_dout_en (), // Port 4 data output enable
- .p4_sel (), // Port 4 function select
- .p5_dout (), // Port 5 data output
- .p5_dout_en (), // Port 5 data output enable
- .p5_sel (), // Port 5 function select
- .p6_dout (), // Port 6 data output
- .p6_dout_en (), // Port 6 data output enable
- .p6_sel (), // Port 6 function select
- .per_dout (per_dout_dio), // Peripheral data output
-
-// INPUTs
- .mclk (mclk), // Main system clock
- .p1_din (p1_din), // Port 1 data input
- .p2_din (p2_din), // Port 2 data input
- .p3_din (8'h00), // Port 3 data input
- .p4_din (p4_din), // Port 4 data input
- .p5_din (8'h00), // Port 5 data input
- .p6_din (8'h00), // Port 6 data input
- .per_addr (per_addr), // Peripheral address
- .per_din (per_din), // Peripheral data input
- .per_en (per_en), // Peripheral enable (high active)
- .per_we (per_we), // Peripheral write enable (high active)
- .puc_rst (puc_rst) // Main system reset
-);
-
-//
-// Timer A
-//----------------------------------------------
-
-omsp_timerA timerA_0 (
-
-// OUTPUTs
- .irq_ta0 (irq_ta0), // Timer A interrupt: TACCR0
- .irq_ta1 (irq_ta1), // Timer A interrupt: TAIV, TACCR1, TACCR2
- .per_dout (per_dout_tA), // Peripheral data output
- .ta_out0 (ta_out0), // Timer A output 0
- .ta_out0_en (ta_out0_en), // Timer A output 0 enable
- .ta_out1 (ta_out1), // Timer A output 1
- .ta_out1_en (ta_out1_en), // Timer A output 1 enable
- .ta_out2 (ta_out2), // Timer A output 2
- .ta_out2_en (ta_out2_en), // Timer A output 2 enable
-
-// INPUTs
- .aclk_en (aclk_en), // ACLK enable (from CPU)
- .dbg_freeze (dbg_freeze), // Freeze Timer A counter
- .inclk (inclk), // INCLK external timer clock (SLOW)
- .irq_ta0_acc (irq_acc[9]), // Interrupt request TACCR0 accepted
- .mclk (mclk), // Main system clock
- .per_addr (per_addr), // Peripheral address
- .per_din (per_din), // Peripheral data input
- .per_en (per_en), // Peripheral enable (high active)
- .per_we (per_we), // Peripheral write enable (high active)
- .puc_rst (puc_rst), // Main system reset
- .smclk_en (smclk_en), // SMCLK enable (from CPU)
- .ta_cci0a (ta_cci0a), // Timer A capture 0 input A
- .ta_cci0b (ta_cci0b), // Timer A capture 0 input B
- .ta_cci1a (ta_cci1a), // Timer A capture 1 input A
- .ta_cci1b (1'b0), // Timer A capture 1 input B
- .ta_cci2a (ta_cci2a), // Timer A capture 2 input A
- .ta_cci2b (1'b0), // Timer A capture 2 input B
- .taclk (taclk) // TACLK external timer clock (SLOW)
-);
-
-//
-// Combine peripheral data buses
-//-------------------------------
-
-assign per_dout = per_dout_dio |
- per_dout_tA;
-//
-// Assign interrupts
-//-------------------------------
-
-assign nmi = 1'b0;
-assign irq_bus = {1'b0, // Vector 13 (0xFFFA)
- 1'b0, // Vector 12 (0xFFF8)
- 1'b0, // Vector 11 (0xFFF6)
- 1'b0, // Vector 10 (0xFFF4) - Watchdog -
- irq_ta0, // Vector 9 (0xFFF2)
- irq_ta1, // Vector 8 (0xFFF0)
- 1'b0, // Vector 7 (0xFFEE)
- 1'b0, // Vector 6 (0xFFEC)
- 1'b0, // Vector 5 (0xFFEA)
- 1'b0, // Vector 4 (0xFFE8)
- irq_port2, // Vector 3 (0xFFE6)
- irq_port1, // Vector 2 (0xFFE4)
- 1'b0, // Vector 1 (0xFFE2)
- 1'b0}; // Vector 0 (0xFFE0)
-
-//
-// GPIO Function selection
-//--------------------------
-
-// P1.0/TACLK I/O pin / Timer_A, clock signal TACLK input
-// P1.1/TA0 I/O pin / Timer_A, capture: CCI0A input, compare: Out0 output
-// P1.2/TA1 I/O pin / Timer_A, capture: CCI1A input, compare: Out1 output
-// P1.3/TA2 I/O pin / Timer_A, capture: CCI2A input, compare: Out2 output
-// P1.4/SMCLK I/O pin / SMCLK signal output
-// P1.5/TA0 I/O pin / Timer_A, compare: Out0 output
-// P1.6/TA1 I/O pin / Timer_A, compare: Out1 output
-// P1.7/TA2 I/O pin / Timer_A, compare: Out2 output
-wire [7:0] p1_io_mux_b_unconnected;
-wire [7:0] p1_io_dout;
-wire [7:0] p1_io_dout_en;
-wire [7:0] p1_io_din;
-
-io_mux #8 io_mux_p1 (
- .a_din (p1_din),
- .a_dout (p1_dout),
- .a_dout_en (p1_dout_en),
-
- .b_din ({p1_io_mux_b_unconnected[7],
- p1_io_mux_b_unconnected[6],
- p1_io_mux_b_unconnected[5],
- p1_io_mux_b_unconnected[4],
- ta_cci2a,
- ta_cci1a,
- ta_cci0a,
- taclk
- }),
- .b_dout ({ta_out2,
- ta_out1,
- ta_out0,
- (smclk_en & mclk),
- ta_out2,
- ta_out1,
- ta_out0,
- 1'b0
- }),
- .b_dout_en ({ta_out2_en,
- ta_out1_en,
- ta_out0_en,
- 1'b1,
- ta_out2_en,
- ta_out1_en,
- ta_out0_en,
- 1'b0
- }),
-
- .io_din (p1_io_din),
- .io_dout (p1_io_dout),
- .io_dout_en (p1_io_dout_en),
-
- .sel (p1_sel)
-);
-
-
-
-// P2.0/ACLK I/O pin / ACLK output
-// P2.1/INCLK I/O pin / Timer_A, clock signal at INCLK
-// P2.2/TA0 I/O pin / Timer_A, capture: CCI0B input
-// P2.3/TA1 I/O pin / Timer_A, compare: Out1 output
-// P2.4/TA2 I/O pin / Timer_A, compare: Out2 output
-wire [7:0] p2_io_mux_b_unconnected;
-wire [7:0] p2_io_dout;
-wire [7:0] p2_io_dout_en;
-wire [7:0] p2_io_din;
-
-io_mux #8 io_mux_p2 (
- .a_din (p2_din),
- .a_dout (p2_dout),
- .a_dout_en (p2_dout_en),
-
- .b_din ({p2_io_mux_b_unconnected[7],
- p2_io_mux_b_unconnected[6],
- p2_io_mux_b_unconnected[5],
- p2_io_mux_b_unconnected[4],
- p2_io_mux_b_unconnected[3],
- ta_cci0b,
- inclk,
- p2_io_mux_b_unconnected[0]
- }),
- .b_dout ({1'b0,
- 1'b0,
- 1'b0,
- ta_out2,
- ta_out1,
- 1'b0,
- 1'b0,
- (aclk_en & mclk)
- }),
- .b_dout_en ({1'b0,
- 1'b0,
- 1'b0,
- ta_out2_en,
- ta_out1_en,
- 1'b0,
- 1'b0,
- 1'b1
- }),
-
- .io_din (p2_io_din),
- .io_dout (p2_io_dout),
- .io_dout_en (p2_io_dout_en),
-
- .sel (p2_sel)
-);
-
-
-//=============================================================================
-// 6) PROGRAM AND DATA MEMORIES
-//=============================================================================
-
-assign dmem_cen_n = ~ dmem_cen;
-assign pmem_cen_n = ~ pmem_cen;
-assign dmem_wen_n = ~ dmem_wen;
-assign pmem_wen_n = ~ pmem_wen;
-
-
-// Data Memory
-ram_8x512 ram_8x512_hi (
- .addra (dmem_addr),
- .clka (clk_sys),
- .dina (dmem_din[15:8]),
- .douta (dmem_dout[15:8]),
- .ena (dmem_cen_n),
- .wea (dmem_wen_n[1])
-);
-ram_8x512 ram_8x512_lo (
- .addra (dmem_addr),
- .clka (clk_sys),
- .dina (dmem_din[7:0]),
- .douta (dmem_dout[7:0]),
- .ena (dmem_cen_n),
- .wea (dmem_wen_n[0])
-);
-
-
-// Program Memory
-rom_8x2k rom_8x2k_hi (
- .addra (pmem_addr),
- .clka (clk_sys),
- .dina (pmem_din[15:8]),
- .douta (pmem_dout[15:8]),
- .ena (pmem_cen_n),
- .wea (pmem_wen_n[1])
-);
-
-rom_8x2k rom_8x2k_lo (
- .addra (pmem_addr),
- .clka (clk_sys),
- .dina (pmem_din[7:0]),
- .douta (pmem_dout[7:0]),
- .ena (pmem_cen_n),
- .wea (pmem_wen_n[0])
-);
-
-assign chipscope_debug[15:0] =pmem_din;
-assign chipscope_debug[31:16] =pmem_dout;
-assign chipscope_debug[42:32] =pmem_addr;
-assign chipscope_debug[44:43] =pmem_wen_n;
-assign chipscope_debug[45] =pmem_cen_n;
-assign chipscope_debug[46] =reset_n;
-assign chipscope_debug[47] =reset_pin;
-assign chipscope_debug[48] =dcm_locked;
-assign chipscope_debug[49] =DBG_OFF;
-assign chipscope_debug[63:50] = 15'h000000;
-
-
-//=============================================================================
-// 7) I/O CELLS
-//=============================================================================
-
-
-// Slide Switches (Port 1 inputs)
-//--------------------------------
-IBUF SW3_PIN (.O(p4_din[3]), .I(SW3));
-IBUF SW2_PIN (.O(p4_din[2]), .I(SW2));
-IBUF SW1_PIN (.O(p4_din[1]), .I(SW1));
-IBUF SW0_PIN (.O(p4_din[0]), .I(SW0));
-
-// LEDs (Port 1 outputs)
-//-----------------------
-OBUF LED3_PIN (.I(p3_dout[3] & p3_dout_en[3]), .O(LED3));
-OBUF LED2_PIN (.I(p3_dout[2] & p3_dout_en[2]), .O(LED2));
-OBUF LED1_PIN (.I(p3_dout[1] & p3_dout_en[1]), .O(LED1));
-OBUF LED0_PIN (.I(p3_dout[0] & p3_dout_en[0]), .O(LED0));
-
-// RS-232 Port
-//----------------------
-// P1.1 (TX) and P2.2 (RX)
-assign p1_io_din = 8'h00;
-assign p2_io_din[1:0] = 2'h00;
-assign p2_io_din[7:3] = 5'h00;
-
-wire uart_txd_out = DBG_OFF ? p1_io_dout[1] : dbg_uart_txd;
-wire uart_rxd_in;
-assign p2_io_din[2] = DBG_OFF ? uart_rxd_in :1'b1;
-assign dbg_uart_rxd = DBG_OFF ? 1'b1 :uart_rxd_in ;
-
-
-IBUF UART_RXD_PIN (.O(uart_rxd_in), .I(UART_RXD));
-OBUF UART_TXD_PIN (.I(uart_txd_out), .O(UART_TXD));
-
-//DEBUG
-wire [64:0] chipscope_debug;
-wire [35:0] chipscope_control;
-chipscope_ila chipscope_ila(
- .CONTROL (chipscope_control),
- .CLK (clk_sys),
- .TRIG0 (chipscope_debug));
-
-chipscope_icon chipscope_icon(
- .CONTROL0 (chipscope_control) );
-
-assign MCLK = clk_sys;
-
-endmodule // openMSP430_fpga
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/coregen/chipscope_ila.cdc
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/coregen/ram_8x512.v
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/coregen/ram_8x512.v (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/coregen/ram_8x512.v (nonexistent)
@@ -1,179 +0,0 @@
-/*******************************************************************************
-* This file is owned and controlled by Xilinx and must be used solely *
-* for design, simulation, implementation and creation of design files *
-* limited to Xilinx devices or technologies. Use with non-Xilinx *
-* devices or technologies is expressly prohibited and immediately *
-* terminates your license. *
-* *
-* 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. *
-* *
-* Xilinx products are not intended for use in life support appliances, *
-* devices, or systems. Use in such applications are expressly *
-* prohibited. *
-* *
-* (c) Copyright 1995-2011 Xilinx, Inc. *
-* All rights reserved. *
-*******************************************************************************/
-// You must compile the wrapper file ram_8x512.v when simulating
-// the core, ram_8x512. When compiling the wrapper file, be sure to
-// reference the XilinxCoreLib Verilog simulation library. For detailed
-// instructions, please refer to the "CORE Generator Help".
-
-// The synthesis directives "translate_off/translate_on" specified below are
-// supported by Xilinx, Mentor Graphics and Synplicity synthesis
-// tools. Ensure they are correct for your synthesis tool(s).
-
-`timescale 1ns/1ps
-
-module ram_8x512(
- clka,
- ena,
- wea,
- addra,
- dina,
- douta
-);
-
-input clka;
-input ena;
-input [0 : 0] wea;
-input [8 : 0] addra;
-input [7 : 0] dina;
-output [7 : 0] douta;
-
-// synthesis translate_off
-
- BLK_MEM_GEN_V6_2 #(
- .C_ADDRA_WIDTH(9),
- .C_ADDRB_WIDTH(9),
- .C_ALGORITHM(1),
- .C_AXI_ID_WIDTH(4),
- .C_AXI_SLAVE_TYPE(0),
- .C_AXI_TYPE(1),
- .C_BYTE_SIZE(9),
- .C_COMMON_CLK(0),
- .C_DEFAULT_DATA("0"),
- .C_DISABLE_WARN_BHV_COLL(0),
- .C_DISABLE_WARN_BHV_RANGE(0),
- .C_FAMILY("spartan6"),
- .C_HAS_AXI_ID(0),
- .C_HAS_ENA(1),
- .C_HAS_ENB(0),
- .C_HAS_INJECTERR(0),
- .C_HAS_MEM_OUTPUT_REGS_A(0),
- .C_HAS_MEM_OUTPUT_REGS_B(0),
- .C_HAS_MUX_OUTPUT_REGS_A(0),
- .C_HAS_MUX_OUTPUT_REGS_B(0),
- .C_HAS_REGCEA(0),
- .C_HAS_REGCEB(0),
- .C_HAS_RSTA(0),
- .C_HAS_RSTB(0),
- .C_HAS_SOFTECC_INPUT_REGS_A(0),
- .C_HAS_SOFTECC_OUTPUT_REGS_B(0),
- .C_INIT_FILE_NAME("no_coe_file_loaded"),
- .C_INITA_VAL("0"),
- .C_INITB_VAL("0"),
- .C_INTERFACE_TYPE(0),
- .C_LOAD_INIT_FILE(0),
- .C_MEM_TYPE(0),
- .C_MUX_PIPELINE_STAGES(0),
- .C_PRIM_TYPE(1),
- .C_READ_DEPTH_A(512),
- .C_READ_DEPTH_B(512),
- .C_READ_WIDTH_A(8),
- .C_READ_WIDTH_B(8),
- .C_RST_PRIORITY_A("CE"),
- .C_RST_PRIORITY_B("CE"),
- .C_RST_TYPE("SYNC"),
- .C_RSTRAM_A(0),
- .C_RSTRAM_B(0),
- .C_SIM_COLLISION_CHECK("ALL"),
- .C_USE_BYTE_WEA(0),
- .C_USE_BYTE_WEB(0),
- .C_USE_DEFAULT_DATA(0),
- .C_USE_ECC(0),
- .C_USE_SOFTECC(0),
- .C_WEA_WIDTH(1),
- .C_WEB_WIDTH(1),
- .C_WRITE_DEPTH_A(512),
- .C_WRITE_DEPTH_B(512),
- .C_WRITE_MODE_A("WRITE_FIRST"),
- .C_WRITE_MODE_B("WRITE_FIRST"),
- .C_WRITE_WIDTH_A(8),
- .C_WRITE_WIDTH_B(8),
- .C_XDEVICEFAMILY("spartan6")
- )
- inst (
- .CLKA(clka),
- .ENA(ena),
- .WEA(wea),
- .ADDRA(addra),
- .DINA(dina),
- .DOUTA(douta),
- .RSTA(),
- .REGCEA(),
- .CLKB(),
- .RSTB(),
- .ENB(),
- .REGCEB(),
- .WEB(),
- .ADDRB(),
- .DINB(),
- .DOUTB(),
- .INJECTSBITERR(),
- .INJECTDBITERR(),
- .SBITERR(),
- .DBITERR(),
- .RDADDRECC(),
- .S_ACLK(),
- .S_ARESETN(),
- .S_AXI_AWID(),
- .S_AXI_AWADDR(),
- .S_AXI_AWLEN(),
- .S_AXI_AWSIZE(),
- .S_AXI_AWBURST(),
- .S_AXI_AWVALID(),
- .S_AXI_AWREADY(),
- .S_AXI_WDATA(),
- .S_AXI_WSTRB(),
- .S_AXI_WLAST(),
- .S_AXI_WVALID(),
- .S_AXI_WREADY(),
- .S_AXI_BID(),
- .S_AXI_BRESP(),
- .S_AXI_BVALID(),
- .S_AXI_BREADY(),
- .S_AXI_ARID(),
- .S_AXI_ARADDR(),
- .S_AXI_ARLEN(),
- .S_AXI_ARSIZE(),
- .S_AXI_ARBURST(),
- .S_AXI_ARVALID(),
- .S_AXI_ARREADY(),
- .S_AXI_RID(),
- .S_AXI_RDATA(),
- .S_AXI_RRESP(),
- .S_AXI_RLAST(),
- .S_AXI_RVALID(),
- .S_AXI_RREADY(),
- .S_AXI_INJECTSBITERR(),
- .S_AXI_INJECTDBITERR(),
- .S_AXI_SBITERR(),
- .S_AXI_DBITERR(),
- .S_AXI_RDADDRECC()
- );
-
-// synthesis translate_on
-
-endmodule
trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/coregen/blk_mem_gen_ds512.pdf
Property changes :
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/coregen/blk_mem_gen_v6_2_readme.txt
===================================================================
--- trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/coregen/blk_mem_gen_v6_2_readme.txt (revision 155)
+++ trunk/fpga/xilinx_avnet_lx9microbard/ise/rtl/verilog/coregen/blk_mem_gen_v6_2_readme.txt (nonexistent)
@@ -1,203 +0,0 @@
- Core name: Xilinx LogiCORE Block Memory Generator
- Version: 6.2
- Release Date: June 22, 2011
-
-
-================================================================================
-
-This document contains the following sections:
-
-1. Introduction
-2. New Features
-3. Supported Devices
-4. Resolved Issues
-5. Known Issues
-6. Technical Support
-7. Core Release History
-8. Legal Disclaimer
-
-================================================================================
-
-
-1. INTRODUCTION
-
-For installation instructions for this release, please go to:
-
- http://www.xilinx.com/ipcenter/coregen/ip_update_install_instructions.htm
-
-For system requirements:
-
- http://www.xilinx.com/ipcenter/coregen/ip_update_system_requirements.htm
-
-This file contains release notes for the Xilinx LogiCORE IP Block Memory Generator v6.2
-solution. For the latest core updates, see the product page at:
-
- http://www.xilinx.com/products/ipcenter/Block_Memory_Generator.htm
-
-
-2. NEW FEATURES
-
- - ISE 13.2 software support
- - Virtex-7L, Kintex-7L, Artix-7* and Zynq-7000* device support
-
-3. SUPPORTED DEVICES
-
-The following device families are supported by the core for this release.
-
-Zynq-7000*
-
-Virtex-7
-Virtex-7 XT (7vx485t)
-Virtex-7 -2L
-
-Kintex-7
-Kintex-7 -2L
-
-Artix-7*
-
-Virtex-6 XC CXT/LXT/SXT/HXT
-Virtex-6 XQ LXT/SXT
-Virtex-6 -1L XQ LXT/SXT
-
-Spartan-6 XC LX/LXT
-Spartan-6 XA
-Spartan-6 XQ LX/LXT
-Spartan-6 -1L XQ LX
-
-Virtex-5 XC LX/LXT/SXT/TXT/FXT
-Virtex-5 XQ LX/ LXT/SXT/FXT
-
-Virtex-4 XC LX/SX/FX
-Virtex-4 XQ LX/SX/FX
-Virtex-4 XQR LX/SX/FX
-
-Spartan-3 XC
-Spartan-3 XA
-Spartan-3A XC 3A / 3A DSP / 3AN DSP
-Spartan-3A XA 3A / 3A DSP
-Spartan-3E XC
-Spartan-3E XA
-
-*To access these devices in the ISE Design Suite, contact your Xilinx FAE.
-
-4. RESOLVED ISSUES
-
-The following issues are resolved in Block Memory Generator v6.2:
-
- 1. Core errors in NGDBuild when the depth is too large (especially for Spartan-6 devices)
- Version Fixed: v6.2
- - CR 587481
- - AR 39718
-
-5. KNOWN ISSUES
-
-The following are known issues for v6.2 of this core at time of release:
-
- 1. Virtex-6 and Spartan-6: BRAM Memory collision error, when the user selects TDP (write_mode= Read First)
- Work around: The user must review the possible scenarios that causes the collission and revise
- their design to avoid those situations.
- - CR588505
-
- Note: Refer to UG383, 'Conflict Avoidance' section when using TDP Memory - with
- Write Mode = Read First in conjunction with asynchronous clocking
-
- 2. Power estimation figures in the datasheet are preliminary for Virtex-5 and Spartan-3.
-
- 3. Core does not generate for large memories. Depending on the
- machine the ISE CORE Generator software runs on, the maximum size of the memory that
- can be generated will vary. For example, a Dual Pentium-4 server
- with 2 GB RAM can generate a memory core of size 1.8 MBits or 230 KBytes
- - CR 415768
- - AR 24034
-
-The most recent information, including known issues, workarounds, and resolutions for
-this version is provided in the IP Release Notes User Guide located at
-
- www.xilinx.com/support/documentation/user_guides/xtp025.pdf
-
-6. TECHNICAL SUPPORT
-
-To obtain technical support, create a WebCase at www.xilinx.com/support.
-Questions are routed to a team with expertise using this product.
-
-Xilinx provides technical support for use of this product when used
-according to the guidelines described in the core documentation, and
-cannot guarantee timing, functionality, or support of this product for
-designs that do not follow specified guidelines.
-
-7. CORE RELEASE HISTORY
-
-Date By Version Description
-================================================================================
-06/22/2011 Xilinx, Inc. 6.2 ISE 13.2 support;Virtex-7L,Kintex-7L,Artix7 and Zynq-7000* device support;
-03/01/2011 Xilinx, Inc. 6.1 ISE 13.1 support and Virtex-7 and Kintex-7 device support; AXI4/AXI4-Lite Support
-09/21/2010 Xilinx, Inc. 4.3 ISE 12.3 support
-07/23/2010 Xilinx, Inc. 4.2 ISE 12.2 support
-04/19/2010 Xilinx, Inc. 4.1 ISE 12.1 support
-03/09/2010 Xilinx, Inc. 3.3 rev 2 Fix for V6 Memory collision issue
-12/02/2009 Xilinx, Inc. 3.3 rev 1 ISE 11.4 support; Spartan-6 Low Power
- Device support; Automotive Spartan 3A
- DSP device support
-09/16/2009 Xilinx, Inc. 3.3 Revised to v3.3
-06/24/2009 Xilinx, Inc. 3.2 Revised to v3.2
-04/24/2009 Xilinx, Inc. 3.1 Revised to v3.1
-09/19/2008 Xilinx, Inc. 2.8 Revised to v2.8
-03/24/2008 Xilinx, Inc. 2.7 10.1 support; Revised to v2.7
-10/03/2007 Xilinx, Inc. 2.6 Revised to v2.6
-07/2007 Xilinx, Inc. 2.5 Revised to v2.5
-04/2007 Xilinx, Inc. 2.4 Revised to v2.4 rev 1
-02/2007 Xilinx, Inc. 2.4 Revised to v2.4
-11/2006 Xilinx, Inc. 2.3 Revised to v2.3
-09/2006 Xilinx, Inc. 2.2 Revised to v2.2
-06/2006 Xilinx, Inc. 2.1 Revised to v2.1
-01/2006 Xilinx, Inc. 1.1 Initial release
-================================================================================
-
-8. Legal Disclaimer
-
- (c) Copyright 2006 - 2011 Xilinx, Inc. All rights reserved.
-
- This file contains confidential and proprietary information
- of Xilinx, Inc. and is protected under U.S. and
- international copyright and other intellectual property
- laws.
-
- DISCLAIMER
- This disclaimer is not a license and does not grant any
- rights to the materials distributed herewith. Except as
- otherwise provided in a valid license issued to you by
- Xilinx, and to the maximum extent permitted by applicable
- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
- (2) Xilinx shall not be liable (whether in contract or tort,
- including negligence, or under any other theory of
- liability) for any loss or damage of any kind or nature
- related to, arising under or in connection with these
- materials, including for any direct, or any indirect,
- special, incidental, or consequential loss or damage
- (including loss of data, profits, goodwill, or any type of
- loss or damage suffered as a result of any action brought
- by a third party) even if such damage or loss was
- reasonably foreseeable or Xilinx had been advised of the
- possibility of the same.
-
- CRITICAL APPLICATIONS
- Xilinx products are not designed or intended to be fail-
- safe, or for use in any application requiring fail-safe
- performance, such as life-support or safety devices or
- systems, Class III medical devices, nuclear facilities,
- applications related to the deployment of airbags, or any
- other applications that could lead to death, personal
- injury, or severe property or environmental damage
- (individually and collectively, "Critical
- Applications"). Customer assumes the sole risk and
- liability of any use of Xilinx products in Critical
- Applications, subject only to applicable laws and
- regulations governing limitations on product liability.
-
- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
- PART OF THIS FILE AT ALL TIMES.
-