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

Subversion Repositories scarm

[/] [scarm/] [branches/] [release_0_1/] [src/] [sc_mem_ch.cpp] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 zhong
// sc_mem_ch.cpp: implementation of the sc_mem_ch class.
2
//
3
//////////////////////////////////////////////////////////////////////
4
 
5
#include "sc_mem_ch.h"
6
 
7
//////////////////////////////////////////////////////////////////////
8
// Construction/Destruction
9
//////////////////////////////////////////////////////////////////////
10
bool sc_mem_ch::write_mem(uint32_t addr,uint32_t data)
11
{
12
    nRW=1;
13
    A=addr;
14
        D=data;
15
 return true;
16
 
17
}
18
uint32_t sc_mem_ch::read_mem(uint32_t addr)
19
{
20
 
21
    nRW=0;
22
        cout<<"read & mem"<<endl;
23
    A=addr;
24
        cout<<"return data"<<endl;
25
        return data;
26
 
27
}
28
sc_mem_ch::sc_mem_ch(sc_module_name name_):sc_module(name_)
29
{
30
 
31
         SC_SLAVE(read,D);
32
 
33
}
34
 
35
sc_mem_ch::~sc_mem_ch()
36
{
37
 
38
}
39
 
40
 
41
 
42
void sc_mem_ch::read()
43
{
44
        cout<<"data deliver"<<endl;
45
       data=D;
46
}

powered by: WebSVN 2.1.0

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