cours2: shift_left_32.h

File shift_left_32.h, 401 bytes (added by fpecheux, 15 years ago)
Line 
1#ifndef _SHIFT_LEFT_32_H
2#define _SHIFT_LEFT_32_H
3#include "systemc.h"
4
5SC_MODULE(shift_left_32)
6{
7        sc_in<sc_uint<32> > I;
8        sc_out<sc_uint<32> > O;
9
10        SC_CTOR(shift_left_32)
11        {
12                SC_METHOD(mWrite);
13                sensitive << I ;
14        }
15
16        void mWrite()
17        {
18                sc_uint<32> i_value=I.read();
19                sc_uint<32> o_value=0;
20
21                o_value.range(31,2)=i_value.range(29,0);
22
23                O.write(o_value);
24        }
25};
26#endif
27