Abstract
寫一個硬體的加法器,幾乎就跟軟體的HelloWorld一樣,是最基本的程式,此範例Demo如何用SystemC寫一個加法器。
Introduction
Adder.h
1
#include "SystemC.h"
2
3
;
2
3
Adder.cpp
1
#include "systemc.h"
2
#include "Adder.h"
3
4
}
2
3
4
AdderTest.cpp (TestBench)
1
#include <iostream>
2
#include "systemc.h"
3
#include "Adder.h"
4
5
using namespace std;
6
7
}
2
3
4
5
6
7
執行結果
1
2
SystemC 2.1.v1 --- Oct 18 2006 02:34:01
3
Copyright (c) 1996-2005 by all Contributors
4
ALL RIGHTS RESERVED
5
3
6
Press any key to continue
2
3
4
5
6