main.cpp

来自「Kluwer.Academic.Pub.Systemc.From.The.Gro」· C++ 代码 · 共 44 行

CPP
44
字号
//BEGIN main.cpp//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//See fifo_of_ptr.h for more information//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#include <iostream>using std::cout;using std::endl;#include <systemc.h>#include "fifo_of_ptr.h"unsigned errors = 0;char* simulation_name = "fifo_of_ptr";int sc_main(int argc, char* argv[]) {  // Process command-line arguments  if (argc == 2) {    // Better be an integer...    DEPTH = atoi(argv[1]);  }//endif  std::cout << "Using FIFO depth of " << DEPTH << std::endl;  std::cout << "Sending " << SEND << " values" << std::endl;  cout << "INFO: Elaborating "<< simulation_name << endl;  sc_fifo<mydata*> myfifo(DEPTH);  src src_i("src_i");  src_i.out(myfifo);  snk snk_i("snk_i");  snk_i.in(myfifo);  cout << "INFO: Simulating "<< simulation_name << endl;  sc_start();  cout << "INFO: Post-processing "<< simulation_name << endl;  cout << "INFO: Simulation " << simulation_name       << " " << (errors?"FAILED":"PASSED")       << " with " << errors << " errors"       << endl;  return errors?1:0;}//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//END $Id: main.cpp,v 1.1 2004/01/17 05:09:07 dcblack Exp $

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?