OpenCores
URL https://opencores.org/ocsvn/scarm/scarm/trunk

Subversion Repositories scarm

[/] [scarm/] [branches/] [release_0_1/] [src/] [main.cpp] - Diff between revs 2 and 5

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 5
Line 1... Line 1...
///////////////////////////////////////////////////////////////////////////////
/***************************************************************************
// This program is free software; you can redistribute it and/or
                          main.cpp  -  description
// modify it under the terms of the GNU General Public License
                             -------------------
// as published by the Free Software Foundation; either version 2
    begin                : Oct 2 2002
// of the License, or (at your option) any later version.
    copyright            : (C) 2002 UESTC
//
    author               : Zhong Tao
// This program is distributed in the hope that it will be useful,
    email                : zhong@opencores.org
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 ***************************************************************************/
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
// GNU General Public License for more details.
/***************************************************************************
//
 *                                                                         *
// You should have received a copy of the GNU General Public License
 *   This program is free software; you can redistribute it and/or modify  *
// along with this program; if not, write to the Free Software
 *   it under the terms of the GNU General Public License as published by  *
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *   the Free Software Foundation; either version 2 of the License, or     *
//
 *   (at your option) any later version.                                   *
//  main.cpp -- This is a simple ARM core modeling with SystemC.
 *                                                                         *
//               Architecure defined by Allen Tao Zhong.
 ***************************************************************************/
//          
#include <systemc.h>
//  Original Author: Allen Tao Zhong,
#include "top.h"
//  University of Electronic Science and Technology in China
 
//  email: zhong@opencores.org
int sc_main(int argc,char* argv[])
//  header main.h
 
//  info   This is a simple ARM modeling using SystemC.
 
//               Architecure defined by Allen Tao Zhong. 
 
//
 
///////////////////////////////////////////////////////////////////////////////
 
 
 
/*****************************************************************************
 
 
 
  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
 
  changes you are making here.
 
 
 
      Name, Affiliation, Date:
 
  Description of Modification:
 
 
 
 *****************************************************************************/
 
#include "main.h"
 
#include  <stdlib.h>
 
#include "scTypes.h"
 
#include ".\SOC\scARMSoC.h"
 
#include ".\SOC\Mem\scMemory.h"
 
int sc_main(int ac, char *av[])
 
{
{
    // First check the args
    cout<<"********************************************"<<endl;
  if (ac <= 1)
        cout<<"*    scARM:A GNU SystemC ARM Simulator!    *"<<endl;
 
        cout<<"*         author:Zhong Tao                 *"<<endl;
 
        cout<<"*       email    zhong@opencores.org       *"<<endl;
 
    cout<<"********************************************"<<endl;
 
 
 
        char *prog_name = NULL;
 
    top  board("board");
 
 
 
        for(int i = 1; i < argc; i++)
    {
    {
      cout<< "Usage: scARM  sim_time  \n";
 
      exit (0);
 
    }
 
    int time=atoi(av[1]);
 
 
 
    sc_clock CLK("clock1",10,0.5,1,true);
                        prog_name = argv[i];
    sc_link_mp<uint32_t> l_n_addr;
 
        sc_link_mp<uint32_t> l_n_data;
 
 
 
    scMemory ram("ram");
        }
    scARMSoC processor("processor");
 
 
 
     ram(CLK,l_n_addr,l_n_data);
        if(prog_name)
         processor(CLK,l_n_addr,l_n_data);
        {
 
 
  //start simulation
        board.init(prog_name);//load program
 
                sc_start(-1);
 
 
   sc_start(time);
 
 
 
 
        }
 
        else
 
        {
 
                cout<<"  usage : scARM <file name> <args...>"<<endl;
 
                cout<<"  file name : a program to execute"<<endl;
 
                cout<<"  Note:Program should be plain bianery format."<<endl;
 
                cout<<"  args : arguments to the file"<<endl;
 
        }
 
        return 0;
 
 
 return (0);
 
}
}
// EOF
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.