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

Subversion Repositories cpu8080

[/] [cpu8080/] [trunk/] [project/] [isim/] [work/] [testbench/] [xsimtestbench.cpp] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 samiam9512
#include "isim/work/testbench/testbench.h"
2
#include "isim/work/glbl/glbl.h"
3
static const char * HSimCopyRightNotice = "Copyright 2004-2005, Xilinx Inc. All rights reserved.";
4
 
5
 
6
#include "work/testbench/testbench.h"
7
static HSim__s6* IF0(HSim__s6 *Arch,const char* label,int nGenerics,
8
va_list vap)
9
{
10
    HSim__s6 *blk = new workMtestbench(label);
11
    return blk;
12
}
13
 
14
 
15
#include "work/alu/alu.h"
16
static HSim__s6* IF1(HSim__s6 *Arch,const char* label,int nGenerics,
17
va_list vap)
18
{
19
    HSim__s6 *blk = new workMalu(label);
20
    return blk;
21
}
22
 
23
 
24
#include "work/rom/rom.h"
25
static HSim__s6* IF2(HSim__s6 *Arch,const char* label,int nGenerics,
26
va_list vap)
27
{
28
    HSim__s6 *blk = new workMrom(label);
29
    return blk;
30
}
31
 
32
 
33
#include "work/cpu8080/cpu8080.h"
34
static HSim__s6* IF3(HSim__s6 *Arch,const char* label,int nGenerics,
35
va_list vap)
36
{
37
    HSim__s6 *blk = new workMcpu8080(label);
38
    return blk;
39
}
40
 
41
 
42
#include "work/glbl/glbl.h"
43
static HSim__s6* IF4(HSim__s6 *Arch,const char* label,int nGenerics,
44
va_list vap)
45
{
46
    HSim__s6 *blk = new workMglbl(label);
47
    return blk;
48
}
49
 
50
class _top : public HSim__s6 {
51
public:
52
    _top() : HSim__s6(false, "_top", "_top", 0, 0, HSim::VerilogModule) {}
53
    HSimConfigDecl * topModuleInstantiate() {
54
        HSimConfigDecl * cfgvh = 0;
55
        cfgvh = new HSimConfigDecl("default");
56
        (*cfgvh).addVlogModule("testbench", (HSimInstFactoryPtr)IF0);
57
        (*cfgvh).addVlogModule("alu", (HSimInstFactoryPtr)IF1);
58
        (*cfgvh).addVlogModule("rom", (HSimInstFactoryPtr)IF2);
59
        (*cfgvh).addVlogModule("cpu8080", (HSimInstFactoryPtr)IF3);
60
        (*cfgvh).addVlogModule("glbl", (HSimInstFactoryPtr)IF4);
61
        HSim__s5 * topvl = 0;
62
        topvl = new workMtestbench("testbench");
63
        topvl->moduleInstantiate(cfgvh);
64
        addChild(topvl);
65
        topvl = new workMglbl("glbl");
66
        topvl->moduleInstantiate(cfgvh);
67
        addChild(topvl);
68
        return cfgvh;
69
}
70
};
71
 
72
main(int argc, char **argv) {
73
  HSimDesign::initDesign();
74
  globalKernel->getOptions(argc,argv);
75
  HSim__s6 * _top_i = 0;
76
  try {
77
    HSimConfigDecl *cfg;
78
 _top_i = new _top();
79
  cfg =  _top_i->topModuleInstantiate();
80
    return globalKernel->runTcl(cfg, _top_i, "_top", argc, argv);
81
  }
82
  catch (HSimError& msg){
83
    try {
84
      globalKernel->error(msg.ErrMsg);
85
      return 1;
86
    }
87
    catch(...) {}
88
      return 1;
89
  }
90
  catch (...){
91
    globalKernel->fatalError();
92
    return 1;
93
  }
94
}

powered by: WebSVN 2.1.0

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