forked from dcblack/ModernSystemC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtop.cpp
More file actions
37 lines (35 loc) · 1.21 KB
/
top.cpp
File metadata and controls
37 lines (35 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* @file top.cpp
* @brief Top-level interconnect implementation
*/
#include "top.hpp"
#include "stimulus.hpp"
#include "duplicator.hpp"
#include "processing.hpp"
#include "checker.hpp"
#include "sc_cxx11.hpp"
using namespace sc_core;
//..............................................................................
Top_module::Top_module( sc_module_name instance ) //< Constructor
{
/**
* Instantiate
*/
stim = std::make_unique<Stimulus_module> ( "stim" );
dupl = std::make_unique<Duplicator_module> ( "dupl" );
process = std::make_unique<Processing_module> ( "process" );
check = std::make_unique<Checker_module> ( "check" );
clock = std::make_unique<sc_clock> ( "clock", 10_ns );
/**
* Connect
*/
stim->rawout_port .bind( raw_fifo );
dupl->input_port .bind( raw_fifo );
process->input_port .bind( dupl->out1_xport );
process->output_port.bind( result_buffer );
process->clk_port .bind( *clock );
check->result_port .bind( result_buffer );
check->rawin_port .bind( dupl->out2_xport );
}
//..............................................................................
Top_module::~Top_module( void ) = default;