pr213.cpp revision 12855:588919e0e4aa
12381SN/A/***************************************************************************** 212342Snikos.nikoleris@arm.com 38711Sandreas.hansson@arm.com Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 48711Sandreas.hansson@arm.com more contributor license agreements. See the NOTICE file distributed 58711Sandreas.hansson@arm.com with this work for additional information regarding copyright ownership. 68711Sandreas.hansson@arm.com Accellera licenses this file to you under the Apache License, Version 2.0 78711Sandreas.hansson@arm.com (the "License"); you may not use this file except in compliance with the 88711Sandreas.hansson@arm.com License. You may obtain a copy of the License at 98711Sandreas.hansson@arm.com 108711Sandreas.hansson@arm.com http://www.apache.org/licenses/LICENSE-2.0 118711Sandreas.hansson@arm.com 128711Sandreas.hansson@arm.com Unless required by applicable law or agreed to in writing, software 138711Sandreas.hansson@arm.com distributed under the License is distributed on an "AS IS" BASIS, 142381SN/A WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 152381SN/A implied. See the License for the specific language governing 162381SN/A permissions and limitations under the License. 172381SN/A 182381SN/A *****************************************************************************/ 192381SN/A 202381SN/A/***************************************************************************** 212381SN/A 222381SN/A pr213.cpp -- 232381SN/A 242381SN/A Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 252381SN/A 262381SN/A *****************************************************************************/ 272381SN/A 282381SN/A/***************************************************************************** 292381SN/A 302381SN/A MODIFICATION LOG - modifiers, enter your name, affiliation, date and 312381SN/A changes you are making here. 322381SN/A 332381SN/A Name, Affiliation, Date: 342381SN/A Description of Modification: 352381SN/A 362381SN/A *****************************************************************************/ 372381SN/A 382381SN/A#include "systemc.h" 392665Ssaidi@eecs.umich.edu 402665Ssaidi@eecs.umich.eduSC_MODULE( abc ) 418853Sandreas.hansson@arm.com{ 428922Swilliam.wang@arm.com SC_HAS_PROCESS( abc ); 432381SN/A 442381SN/A sc_in_clk clk; 452381SN/A 462381SN/A const sc_signal<bool>& a; 478922Swilliam.wang@arm.com const sc_signal<bool>& b; 482381SN/A sc_signal<bool>& c; 492381SN/A 502381SN/A abc( sc_module_name NAME, 512381SN/A sc_clock& CLK, 522381SN/A 539235Sandreas.hansson@arm.com const sc_signal<bool>& A, 542381SN/A const sc_signal<bool>& B, 5514185Sgabeblack@google.com sc_signal<bool>& C ) 5614185Sgabeblack@google.com 5714185Sgabeblack@google.com : 5813771Sgabeblack@google.com a(A), b(B), c(C) 592381SN/A { 6013892Sgabeblack@google.com clk(CLK); 613401Sktlim@umich.edu SC_CTHREAD( entry, clk.pos() ); 628922Swilliam.wang@arm.com } 638922Swilliam.wang@arm.com void entry(); 648922Swilliam.wang@arm.com}; 658922Swilliam.wang@arm.com 669294Sandreas.hansson@arm.comvoid 679294Sandreas.hansson@arm.comabc::entry() 689294Sandreas.hansson@arm.com{ 699294Sandreas.hansson@arm.com int i = 0, j = 0; 709294Sandreas.hansson@arm.com do { 7114183Sgabeblack@google.com i++; 7214183Sgabeblack@google.com if (i == 5) continue; 7314183Sgabeblack@google.com if (i == 7) break; 748922Swilliam.wang@arm.com j = j + 2; 7514193Sgabeblack@google.com wait(); 7614183Sgabeblack@google.com } while (a.read() && b.read()); 778922Swilliam.wang@arm.com} 788975Sandreas.hansson@arm.com 798975Sandreas.hansson@arm.comint sc_main( int, char** ) { return 0; } 808922Swilliam.wang@arm.com