Line 1... |
Line 1... |
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
// Copyright (C) 2001 Authors
|
// Copyright (C) 2009 , Olivier Girard
|
//
|
//
|
// This source file may be used and distributed without restriction provided
|
// Redistribution and use in source and binary forms, with or without
|
// that this copyright statement is not removed from the file and that any
|
// modification, are permitted provided that the following conditions
|
// derivative work contains the original copyright notice and the associated
|
// are met:
|
// disclaimer.
|
// * Redistributions of source code must retain the above copyright
|
//
|
// notice, this list of conditions and the following disclaimer.
|
// This source file is free software; you can redistribute it and/or modify
|
// * Redistributions in binary form must reproduce the above copyright
|
// it under the terms of the GNU Lesser General Public License as published
|
// notice, this list of conditions and the following disclaimer in the
|
// by the Free Software Foundation; either version 2.1 of the License, or
|
// documentation and/or other materials provided with the distribution.
|
// (at your option) any later version.
|
// * Neither the name of the authors nor the names of its contributors
|
//
|
// may be used to endorse or promote products derived from this software
|
// This source is distributed in the hope that it will be useful, but WITHOUT
|
// without specific prior written permission.
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
//
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
// License for more details.
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
//
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
// You should have received a copy of the GNU Lesser General Public License
|
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
// along with this source; if not, write to the Free Software Foundation,
|
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
|
// THE POSSIBILITY OF SUCH DAMAGE
|
//
|
//
|
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
//
|
//
|
// *File Name: omsp_register_file.v
|
// *File Name: omsp_register_file.v
|
//
|
//
|
Line 29... |
Line 34... |
//
|
//
|
// *Author(s):
|
// *Author(s):
|
// - Olivier Girard, olgirard@gmail.com
|
// - Olivier Girard, olgirard@gmail.com
|
//
|
//
|
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
// $Rev: 111 $
|
// $Rev: 132 $
|
// $LastChangedBy: olivier.girard $
|
// $LastChangedBy: olivier.girard $
|
// $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $
|
// $LastChangedDate: 2012-03-09 21:47:13 +0100 (Fri, 09 Mar 2012) $
|
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
`ifdef OMSP_NO_INCLUDE
|
`ifdef OMSP_NO_INCLUDE
|
`else
|
`else
|
`include "openMSP430_defines.v"
|
`include "openMSP430_defines.v"
|
`endif
|
`endif
|
Line 106... |
Line 111... |
|
|
//=============================================================================
|
//=============================================================================
|
// 1) AUTOINCREMENT UNIT
|
// 1) AUTOINCREMENT UNIT
|
//=============================================================================
|
//=============================================================================
|
|
|
wire [15:0] incr_op = inst_bw ? 16'h0001 : 16'h0002;
|
wire [15:0] inst_src_in;
|
|
wire [15:0] incr_op = (inst_bw & ~inst_src_in[1]) ? 16'h0001 : 16'h0002;
|
wire [15:0] reg_incr_val = reg_src+incr_op;
|
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;
|
wire [15:0] reg_dest_val_in = inst_bw ? {8'h00,reg_dest_val[7:0]} : reg_dest_val;
|
|
|
|
|
Line 119... |
Line 125... |
//=============================================================================
|
//=============================================================================
|
|
|
// Source input selection mask (for interrupt support)
|
// Source input selection mask (for interrupt support)
|
//-----------------------------------------------------
|
//-----------------------------------------------------
|
|
|
wire [15:0] inst_src_in = reg_sr_clr ? 16'h0004 : inst_src;
|
assign inst_src_in = reg_sr_clr ? 16'h0004 : inst_src;
|
|
|
|
|
// R0: Program counter
|
// R0: Program counter
|
//---------------------
|
//---------------------
|
|
|