Skip to content

Commit 7165d06

Browse files
committed
Changing ADC and DAC models to support interface between DE and TDF
1 parent bd3ebff commit 7165d06

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

modules/adc/include/adc.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,21 @@ SCA_TDF_MODULE(adc)
2929
// Input analog voltage
3030
sca_tdf::sca_in<double> in;
3131
// Output digital code
32-
sca_tdf::sca_out<sc_dt::sc_uint<BITS> > out;
32+
sca_tdf::sca_de::sca_out<sc_dt::sc_uint<BITS> > out;
3333

3434
/**
3535
* @brief Construct a new adc object
3636
*
3737
*/
38-
SCA_CTOR(adc) : in("in"), out("out") {
38+
SCA_CTOR(adc) : in("in"), out("out")
39+
{
40+
}
41+
42+
void set_attributes()
43+
{
3944
// Propagation time from input to output
40-
set_timestep(sca_core::sca_time(13, sc_core::SC_NS));
45+
set_timestep(sca_core::sca_time(1, sc_core::SC_NS));
46+
this->out.set_delay(13);
4147
}
4248

4349
/**

modules/dac/include/dac.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SCA_TDF_MODULE(dac)
2727
const double MAX_DIG = static_cast<double>((1 << BITS) - 1);
2828
public:
2929
// Input digital code
30-
sca_tdf::sca_in<sc_dt::sc_uint<BITS> > in;
30+
sca_tdf::sca_de::sca_in<sc_dt::sc_uint<BITS> > in;
3131
// Output analog voltage
3232
sca_tdf::sca_out<double> out;
3333

@@ -36,9 +36,14 @@ SCA_TDF_MODULE(dac)
3636
*
3737
*/
3838
SCA_CTOR(dac) : in("in"), out("out")
39+
{
40+
}
41+
42+
void set_attributes()
3943
{
4044
// Propagation time from input to output
41-
set_timestep(sca_core::sca_time(17, sc_core::SC_NS));
45+
set_timestep(sca_core::sca_time(1, sc_core::SC_NS));
46+
this->out.set_delay(17);
4247
}
4348

4449
/**

0 commit comments

Comments
 (0)