main.cpp revision 12855:588919e0e4aa
18544Sguodeyuan@tsinghua.org.cn/*****************************************************************************
211274Sshingarov@labware.com
310595Sgabeblack@google.com  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
48544Sguodeyuan@tsinghua.org.cn  more contributor license agreements.  See the NOTICE file distributed
58544Sguodeyuan@tsinghua.org.cn  with this work for additional information regarding copyright ownership.
68544Sguodeyuan@tsinghua.org.cn  Accellera licenses this file to you under the Apache License, Version 2.0
78544Sguodeyuan@tsinghua.org.cn  (the "License"); you may not use this file except in compliance with the
88544Sguodeyuan@tsinghua.org.cn  License.  You may obtain a copy of the License at
98544Sguodeyuan@tsinghua.org.cn
108544Sguodeyuan@tsinghua.org.cn    http://www.apache.org/licenses/LICENSE-2.0
118544Sguodeyuan@tsinghua.org.cn
128544Sguodeyuan@tsinghua.org.cn  Unless required by applicable law or agreed to in writing, software
138544Sguodeyuan@tsinghua.org.cn  distributed under the License is distributed on an "AS IS" BASIS,
148544Sguodeyuan@tsinghua.org.cn  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
158544Sguodeyuan@tsinghua.org.cn  implied.  See the License for the specific language governing
168544Sguodeyuan@tsinghua.org.cn  permissions and limitations under the License.
178544Sguodeyuan@tsinghua.org.cn
188544Sguodeyuan@tsinghua.org.cn *****************************************************************************/
198544Sguodeyuan@tsinghua.org.cn
208544Sguodeyuan@tsinghua.org.cn/*****************************************************************************
218544Sguodeyuan@tsinghua.org.cn
228544Sguodeyuan@tsinghua.org.cn  main.cpp --
238544Sguodeyuan@tsinghua.org.cn
248544Sguodeyuan@tsinghua.org.cn  Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
258544Sguodeyuan@tsinghua.org.cn
268544Sguodeyuan@tsinghua.org.cn *****************************************************************************/
278544Sguodeyuan@tsinghua.org.cn
288544Sguodeyuan@tsinghua.org.cn/*****************************************************************************
298544Sguodeyuan@tsinghua.org.cn
308544Sguodeyuan@tsinghua.org.cn  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
318544Sguodeyuan@tsinghua.org.cn  changes you are making here.
328544Sguodeyuan@tsinghua.org.cn
338544Sguodeyuan@tsinghua.org.cn      Name, Affiliation, Date:
348544Sguodeyuan@tsinghua.org.cn  Description of Modification:
358544Sguodeyuan@tsinghua.org.cn
368544Sguodeyuan@tsinghua.org.cn *****************************************************************************/
378544Sguodeyuan@tsinghua.org.cn
388544Sguodeyuan@tsinghua.org.cn                /****************************************/
398544Sguodeyuan@tsinghua.org.cn                /* Main Filename:       main.cc         */
408544Sguodeyuan@tsinghua.org.cn                /****************************************/
418544Sguodeyuan@tsinghua.org.cn                /*                                      */
428544Sguodeyuan@tsinghua.org.cn                /* 7-bit bool = 6-bit bool + 6-bit bool */
438544Sguodeyuan@tsinghua.org.cn                /*                                      */
448544Sguodeyuan@tsinghua.org.cn		/*	Max addition is 63 + 63	        */
4511274Sshingarov@labware.com                /*                                      */
468544Sguodeyuan@tsinghua.org.cn                /****************************************/
478544Sguodeyuan@tsinghua.org.cn
488544Sguodeyuan@tsinghua.org.cn#include "datawidth.h"
498544Sguodeyuan@tsinghua.org.cn#include "stimgen.h"
508544Sguodeyuan@tsinghua.org.cn
518544Sguodeyuan@tsinghua.org.cnint sc_main(int ac, char *av[])
528544Sguodeyuan@tsinghua.org.cn{
538544Sguodeyuan@tsinghua.org.cn
548544Sguodeyuan@tsinghua.org.cn// Parameter Settings
558544Sguodeyuan@tsinghua.org.cn  int result_size = 7;
568544Sguodeyuan@tsinghua.org.cn  int in1_size = 6;
578544Sguodeyuan@tsinghua.org.cn  int in2_size = 6;
588544Sguodeyuan@tsinghua.org.cn
598544Sguodeyuan@tsinghua.org.cn// Signal Instantiation
608544Sguodeyuan@tsinghua.org.cn  signal_bool_vector6  	  in1 		("in1");
618544Sguodeyuan@tsinghua.org.cn  signal_bool_vector6  	  in2		("in2");
628544Sguodeyuan@tsinghua.org.cn  signal_bool_vector7  	  result 	("result");
638544Sguodeyuan@tsinghua.org.cn  sc_signal<bool> 	  ready 	("ready");
648544Sguodeyuan@tsinghua.org.cn
658544Sguodeyuan@tsinghua.org.cn// Clock Instantiation
668544Sguodeyuan@tsinghua.org.cn  sc_clock clk( "clock", 10, SC_NS, 0.5, 0, SC_NS);
678544Sguodeyuan@tsinghua.org.cn
688544Sguodeyuan@tsinghua.org.cn// Process Instantiation
698544Sguodeyuan@tsinghua.org.cn  datawidth	D1 ("D1", clk, in1, in2, ready, result,
708544Sguodeyuan@tsinghua.org.cn			  in1_size, in2_size, result_size);
718544Sguodeyuan@tsinghua.org.cn
728544Sguodeyuan@tsinghua.org.cn  stimgen	T1 ("T1", clk, result, in1, in2, ready);
738544Sguodeyuan@tsinghua.org.cn
748544Sguodeyuan@tsinghua.org.cn// Simulation Run Control
758544Sguodeyuan@tsinghua.org.cn  sc_start();
768544Sguodeyuan@tsinghua.org.cn  return 0;
778544Sguodeyuan@tsinghua.org.cn}
788544Sguodeyuan@tsinghua.org.cn