19888Sandreas@sandberg.pp.se/*****************************************************************************
29888Sandreas@sandberg.pp.se
39888Sandreas@sandberg.pp.se  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
49888Sandreas@sandberg.pp.se  more contributor license agreements.  See the NOTICE file distributed
59888Sandreas@sandberg.pp.se  with this work for additional information regarding copyright ownership.
69888Sandreas@sandberg.pp.se  Accellera licenses this file to you under the Apache License, Version 2.0
79888Sandreas@sandberg.pp.se  (the "License"); you may not use this file except in compliance with the
89888Sandreas@sandberg.pp.se  License.  You may obtain a copy of the License at
99888Sandreas@sandberg.pp.se
109888Sandreas@sandberg.pp.se    http://www.apache.org/licenses/LICENSE-2.0
119888Sandreas@sandberg.pp.se
129888Sandreas@sandberg.pp.se  Unless required by applicable law or agreed to in writing, software
139888Sandreas@sandberg.pp.se  distributed under the License is distributed on an "AS IS" BASIS,
149888Sandreas@sandberg.pp.se  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
159888Sandreas@sandberg.pp.se  implied.  See the License for the specific language governing
169888Sandreas@sandberg.pp.se  permissions and limitations under the License.
179888Sandreas@sandberg.pp.se
189888Sandreas@sandberg.pp.se *****************************************************************************/
199888Sandreas@sandberg.pp.se
209888Sandreas@sandberg.pp.se/*****************************************************************************
219888Sandreas@sandberg.pp.se
229888Sandreas@sandberg.pp.se  datawidth.cpp --
239888Sandreas@sandberg.pp.se
249888Sandreas@sandberg.pp.se  Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
259888Sandreas@sandberg.pp.se
269888Sandreas@sandberg.pp.se *****************************************************************************/
279888Sandreas@sandberg.pp.se
289888Sandreas@sandberg.pp.se/*****************************************************************************
299888Sandreas@sandberg.pp.se
309888Sandreas@sandberg.pp.se  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
319888Sandreas@sandberg.pp.se  changes you are making here.
329888Sandreas@sandberg.pp.se
339888Sandreas@sandberg.pp.se      Name, Affiliation, Date:
349888Sandreas@sandberg.pp.se  Description of Modification:
359888Sandreas@sandberg.pp.se
369888Sandreas@sandberg.pp.se *****************************************************************************/
379888Sandreas@sandberg.pp.se
389888Sandreas@sandberg.pp.se                /*******************************************/
399888Sandreas@sandberg.pp.se                /* Implementation Filename:  datawidth.cc  */
409888Sandreas@sandberg.pp.se                /*******************************************/
419888Sandreas@sandberg.pp.se
429888Sandreas@sandberg.pp.se#include "datawidth.h"
439888Sandreas@sandberg.pp.se
449888Sandreas@sandberg.pp.sevoid
459888Sandreas@sandberg.pp.sedatawidth::entry()
469888Sandreas@sandberg.pp.se{
479888Sandreas@sandberg.pp.se  bool_vector4  tmp_a;
489888Sandreas@sandberg.pp.se  bool_vector6  tmp_b;
499888Sandreas@sandberg.pp.se  bool_vector6  tmp_result;
509888Sandreas@sandberg.pp.se
519888Sandreas@sandberg.pp.se  while (true) {
529888Sandreas@sandberg.pp.se
539888Sandreas@sandberg.pp.se    // HANDSHAKING
549888Sandreas@sandberg.pp.se    do { wait(); } while (ready != 1);
559888Sandreas@sandberg.pp.se
569888Sandreas@sandberg.pp.se    // COMPUTATION
579888Sandreas@sandberg.pp.se    tmp_a = in1.read();
589888Sandreas@sandberg.pp.se    tmp_b = in2.read();
599888Sandreas@sandberg.pp.se    tmp_result = tmp_a.to_int() + tmp_b.to_int();
609888Sandreas@sandberg.pp.se
619888Sandreas@sandberg.pp.se    // WRITE OUTPUT
629888Sandreas@sandberg.pp.se    result.write(tmp_result);		// result = in1 + in2
639888Sandreas@sandberg.pp.se    wait();
649888Sandreas@sandberg.pp.se  }
659888Sandreas@sandberg.pp.se}
669888Sandreas@sandberg.pp.se