a2901_alu_inputs.cpp revision 12855:588919e0e4aa
12086SN/A/*****************************************************************************
22086SN/A
35268Sksewell@umich.edu  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
42086SN/A  more contributor license agreements.  See the NOTICE file distributed
52086SN/A  with this work for additional information regarding copyright ownership.
62086SN/A  Accellera licenses this file to you under the Apache License, Version 2.0
72086SN/A  (the "License"); you may not use this file except in compliance with the
82086SN/A  License.  You may obtain a copy of the License at
92086SN/A
102086SN/A    http://www.apache.org/licenses/LICENSE-2.0
112086SN/A
122086SN/A  Unless required by applicable law or agreed to in writing, software
132086SN/A  distributed under the License is distributed on an "AS IS" BASIS,
142086SN/A  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152086SN/A  implied.  See the License for the specific language governing
162086SN/A  permissions and limitations under the License.
172086SN/A
182086SN/A *****************************************************************************/
192086SN/A
202086SN/A/*****************************************************************************
212086SN/A
222086SN/A  a2901_alu_inputs.cpp --
232086SN/A
242086SN/A  Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
252086SN/A
262086SN/A *****************************************************************************/
272086SN/A
282665Ssaidi@eecs.umich.edu/*****************************************************************************
292665Ssaidi@eecs.umich.edu
302665Ssaidi@eecs.umich.edu  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
312686Sksewell@umich.edu  changes you are making here.
322086SN/A
334202Sbinkertn@umich.edu      Name, Affiliation, Date:
342086SN/A  Description of Modification:
354202Sbinkertn@umich.edu
368775Sgblack@eecs.umich.edu *****************************************************************************/
379022Sgblack@eecs.umich.edu
388758Sgblack@eecs.umich.edu#include "a2901_alu_inputs.h"
394202Sbinkertn@umich.edu
408775Sgblack@eecs.umich.eduvoid
418745Sgblack@eecs.umich.edua2901_alu_inputs::entry()
426313Sgblack@eecs.umich.edu{
438775Sgblack@eecs.umich.edu    int4 Av;
448775Sgblack@eecs.umich.edu    int4 B;
458775Sgblack@eecs.umich.edu
468758Sgblack@eecs.umich.edu    Av = RAM[Aadd.read()];
478775Sgblack@eecs.umich.edu    B  = RAM[Badd.read()];
488758Sgblack@eecs.umich.edu    A.write(Av);
498775Sgblack@eecs.umich.edu
508775Sgblack@eecs.umich.edu    switch((int)(I.read().range(2,0))) {
514997Sgblack@eecs.umich.edu    case 0x0:
524202Sbinkertn@umich.edu    case 0x1:
538758Sgblack@eecs.umich.edu      RE.write(Av);
544997Sgblack@eecs.umich.edu      break;
558745Sgblack@eecs.umich.edu    case 0x2:
569384SAndreas.Sandberg@arm.com    case 0x3:
578775Sgblack@eecs.umich.edu    case 0x4:
584997Sgblack@eecs.umich.edu      RE.write(0x0);
595192Ssaidi@eecs.umich.edu      break;
608775Sgblack@eecs.umich.edu    default:
612086SN/A      RE.write(D.read());
624202Sbinkertn@umich.edu    }
634202Sbinkertn@umich.edu
644202Sbinkertn@umich.edu    switch((int)(I.read().range(2,0))) {
654202Sbinkertn@umich.edu    case 0x4:
664202Sbinkertn@umich.edu    case 0x5:
674202Sbinkertn@umich.edu      S.write(Av);
68      break;
69    case 0x1:
70    case 0x3:
71      S.write(B);
72      break;
73    case 0x7:
74      S.write(0x0);
75      break;
76    default:
77      S.write(Q.read());
78    }
79}
80