tb.h revision 12855:588919e0e4aa
12139SN/A/*****************************************************************************
22139SN/A
32139SN/A  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
42139SN/A  more contributor license agreements.  See the NOTICE file distributed
52139SN/A  with this work for additional information regarding copyright ownership.
62139SN/A  Accellera licenses this file to you under the Apache License, Version 2.0
72139SN/A  (the "License"); you may not use this file except in compliance with the
82139SN/A  License.  You may obtain a copy of the License at
92139SN/A
102139SN/A    http://www.apache.org/licenses/LICENSE-2.0
112139SN/A
122139SN/A  Unless required by applicable law or agreed to in writing, software
132139SN/A  distributed under the License is distributed on an "AS IS" BASIS,
142139SN/A  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152139SN/A  implied.  See the License for the specific language governing
162139SN/A  permissions and limitations under the License.
172139SN/A
182139SN/A *****************************************************************************/
192139SN/A
202139SN/A/*****************************************************************************
212139SN/A
222139SN/A  tb.h --
232139SN/A
242139SN/A  Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
252139SN/A
262139SN/A *****************************************************************************/
272139SN/A
282665Ssaidi@eecs.umich.edu/*****************************************************************************
292665Ssaidi@eecs.umich.edu
302139SN/A  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
314202Sbinkertn@umich.edu  changes you are making here.
322139SN/A
334202Sbinkertn@umich.edu      Name, Affiliation, Date:
342152SN/A  Description of Modification:
352152SN/A
362139SN/A *****************************************************************************/
372139SN/A
382139SN/A/* Common interface file for test bench
392139SN/A   Author: PRP
402139SN/A   */
412152SN/A
422152SN/ASC_MODULE( tb )
432139SN/A{
442139SN/A    SC_HAS_PROCESS( tb );
452139SN/A
464781Snate@binkert.org    sc_in_clk clk;
474781Snate@binkert.org
484781Snate@binkert.org        // Output Reset Port
496313Sgblack@eecs.umich.edu        sc_signal<bool>& reset_sig;
504781Snate@binkert.org
514781Snate@binkert.org        // Output Data Ports
523170Sstever@eecs.umich.edu	sc_signal<int>& i1;
535664Sgblack@eecs.umich.edu	sc_signal<int>& i2;
543806Ssaidi@eecs.umich.edu	sc_signal<int>& i3;
556179Sksewell@umich.edu	sc_signal<int>& i4;
564781Snate@binkert.org	sc_signal<int>& i5;
574781Snate@binkert.org
586329Sgblack@eecs.umich.edu        // Output Control Ports
594781Snate@binkert.org	sc_signal<bool>& cont1;
604781Snate@binkert.org	sc_signal<bool>& cont2;
614781Snate@binkert.org	sc_signal<bool>& cont3;
624781Snate@binkert.org
634781Snate@binkert.org        // Input Data Ports
644781Snate@binkert.org	const sc_signal<int>& o1;
652139SN/A	const sc_signal<int>& o2;
662139SN/A	const sc_signal<int>& o3;
673546Sgblack@eecs.umich.edu	const sc_signal<int>& o4;
684202Sbinkertn@umich.edu	const sc_signal<int>& o5;
692152SN/A
702152SN/A	// Constructor
712152SN/A	tb (
722152SN/A        sc_module_name NAME,
732152SN/A	sc_clock& CLK,
742152SN/A
752152SN/A        sc_signal<bool>& RESET_SIG,
762152SN/A
772152SN/A	sc_signal<int>& I1,
782152SN/A	sc_signal<int>& I2,
792152SN/A	sc_signal<int>& I3,
802152SN/A	sc_signal<int>& I4,
812504SN/A	sc_signal<int>& I5,
822504SN/A
832504SN/A	sc_signal<bool>& CONT1,
842504SN/A	sc_signal<bool>& CONT2,
852152SN/A	sc_signal<bool>& CONT3,
862504SN/A
872152SN/A	const sc_signal<int>& O1,
882152SN/A	const sc_signal<int>& O2,
892152SN/A	const sc_signal<int>& O3,
902152SN/A	const sc_signal<int>& O4,
912152SN/A	const sc_signal<int>& O5)
922152SN/A	  : reset_sig(RESET_SIG), i1(I1),  i2(I2),
936993Snate@binkert.org	    i3(I3),  i4(I4), i5(I5), cont1 (CONT1), cont2 (CONT2),
946993Snate@binkert.org	    cont3 (CONT3), o1(O1),  o2(O2),  o3(O3),  o4(O4),  o5(O5)
956993Snate@binkert.org        {
966993Snate@binkert.org	  clk(CLK);
976993Snate@binkert.org            SC_CTHREAD( entry, clk.pos() );
986993Snate@binkert.org	}
996993Snate@binkert.org
1006993Snate@binkert.org  void entry();
1016993Snate@binkert.org};
1026993Snate@binkert.org