class FIFO_READ_HS: public sc_module, public " /> class FIFO_READ_HS: public sc_module, public " /> class FIFO_READ_HS: public sc_module, public "/>

error: declaration of 'class T' template <class T> class FIFO_READ_HS: public sc_module, public sc_fifo_in_if<T>

35 Views Asked by At

Coming accross declaration of 'class T' error.

I have this code:

#include "systemc.h"

template <class T> class FIFO_READ_HS: public sc_module, public sc_fifo_in_if<T>
{
    public:
        // ports
        sc_in_clk clock;
        sc_in<T> data;
        sc_in<bool> valid;
        sc_out<bool> ready;

        // blocking read
        void read(T& x) 
        {
        // signal that we are ready to consume a token
        ready.write(true);
        
        // wait until we've got valid data
        do
            wait(clock->posedge_event());
        while (valid.read() != true);
        
        // read data
        x = data.read();
        
        // no more consumption for the moment
        ready.write(false);
        
        } // end of void read()

        // constructor
        SC_CTOR(FIFO_READ_HS) 
        {
        ready.initialize(false);
        } // end constructor

        // Here, provide dummy implementations for unneeded sc_fifo_in_if <T> methods
        bool nb_read(T&) 
        { 
            assert(0); 
            return false; 
        }
        
        int num_available() const 
        { 
            assert(0); 
            return 0; 
        }
        
        const sc_event& data_written_event() const
        { 
            static sc_event dummy; 
            assert(0); 
            return dummy; 
        }

        virtual T read() 
        {
        T tmp;
        read(tmp);
        return tmp;
        
        }// end of virtual read

};

And getting this erro: error

0

There are 0 best solutions below