source: trunk/platforms/dsx/v1_1cluster_phys_dma/system_driver/system_driver.cpp @ 93

Last change on this file since 93 was 93, checked in by choichil, 14 years ago

Platform with DMA

File size: 1.1 KB
Line 
1
2/**
3 ** MARKER_BEGIN
4 ** Auto-generated file, dont modify directly
5 ** your changes will be lost !
6 **
7 ** Generated by DSX on 2010-09-14 10:44:49.452751
8 ** by choichil@tchaikovsky
9 ** MARKER_END
10 **/
11
12#include <systemc>
13#include "system_driver.h"
14#include "topcell_.h"
15
16system_driver::system_driver(sc_core::sc_module_name name)
17        : sc_core::sc_module(name),
18          m_clock("clock"),
19          m_resetn("resetn")
20{
21        topcell_* topcell = new topcell_("top");
22        topcell->p_resetn(m_resetn);
23        topcell->p_clock(m_clock);
24
25    m_topcell = (uintptr_t)(void*)topcell;
26
27        SC_THREAD(gen_clock);
28}
29
30system_driver::~system_driver()
31{
32    if ( m_topcell )
33        delete (topcell_*)(void *)m_topcell;
34}
35
36void system_driver::gen_clock()
37{
38        m_clock = 0;
39        m_resetn = 0;
40        sc_core::wait(sc_core::sc_time(.5, sc_core::SC_NS));
41        m_clock = 1;
42        sc_core::wait(sc_core::sc_time(.5, sc_core::SC_NS));
43        m_clock = 0;
44        m_resetn = 1;
45
46        for(;;) {
47                sc_core::wait(sc_core::sc_time(.5, sc_core::SC_NS));
48                m_clock = 1;
49                sc_core::wait(sc_core::sc_time(.5, sc_core::SC_NS));
50                m_clock = 0;
51        }
52}
53
54SC_MODULE_EXPORT(system_driver);
Note: See TracBrowser for help on using the repository browser.