cours2: shift_left_32.h
| File shift_left_32.h, 401 bytes (added by , 16 years ago) |
|---|
| Line | |
|---|---|
| 1 | #ifndef _SHIFT_LEFT_32_H |
| 2 | #define _SHIFT_LEFT_32_H |
| 3 | #include "systemc.h" |
| 4 | |
| 5 | SC_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 |
![(please configure the [header_logo] section in trac.ini)](/trac/sesi-systemc/chrome/site/your_project_logo.png)