Oh, those should both be "function" and not "task" throughout Tom's
original and my modification.
Gord
On 11/8/2010 11:28 AM, Gordon Vreugdenhil wrote:
>
> Tom, here is what I had in mind. Now, clearly, the rules for virtual
> method overrides
> don't work for implementing "virtual taks void put (T_in a)" since the
> name of
> the type T_in is not identical to the name of the type T in the base.
>
> *class*Fifo#(*type* T_in = *logic*,
> *type* T_out = logic,
> DEPTH = 1) *implements* PutImp#(T_in), GetImp#(T_out);
>
> T_in [DEPTH-1:0] myFifo;
>
> *virtual task void* put(T_in a);
>
> // Put implementation
>
> *virtual task* T_out get();
>
> // Get implementation
>
> *endclass*
>
> Gord
>
> On 11/8/2010 11:01 AM, Alsop, Thomas R wrote:
>>
>> For discussion today... I tried adding another type to the PutImp
>> below and I want to walk through it to get clarification on if this
>> makes sense, if this is what was asked for and how to put rules
>> behind it, as requested two weeks ago. More to come. -Tom
>>
>> *interface class*PutImp#(*type* T = *logic, string *MyPutSignal = "a");
>>
>> *pure virtual task void* put(T MyPutSignal);
>>
>> *endclass***
>>
>> *interface class*GetImp#(*type* T = *logic*);
>>
>> *pure virtual task *T get();
>>
>> *endclass***
>>
>> *class*Fifo#(*type* T = *logic*, DEPTH = 1) *implements* PutImp#(T),
>> GetImp#(T);
>>
>> T [DEPTH-1:0] myFifo;
>>
>> *virtual task void* put(T, a);
>>
>> // Put implementation
>>
>> *virtual task* T get();
>>
>> // Get implementation
>>
>> *endclass*
>>
>> **
>>
>> *class *MyQueue(*type* T = *logic*, DEPTH = 1, *string *MyPutSignal =
>> "a");
>>
>> *T* [DEPTH-1:0] PipeQueue[$];
>>
>> *virtual* *function* void deleteQ();
>>
>> // Delete implementation
>>
>> *endfunction*
>>
>> *endclass*
>>
>> **
>>
>> *class*Fifo extends MyQueue#(T, DEPTH), *implements* PutImp#(T),
>> GetImp#(T);
>>
>> *virtual task void* put(T, b);
>>
>> // Put implementation
>>
>> *virtual task* T get();
>>
>> // Get implementation
>>
>> *endclass*
>>
>> **
>>
>> Need more interesting types instead of just 'T'. Pass in two
>> different types, have put and get use two different types working in
>> each case.Why not explicitly state this?. So we need rules behind
>> them and not just examples.
>>
>>
>> --
>> This message has been scanned for viruses and
>> dangerous content by *MailScanner* <http://www.mailscanner.info/>,
>> and is
>> believed to be clean.
>
> --
> --------------------------------------------------------------------
> Gordon Vreugdenhil 503-685-0808
> Model Technology (Mentor Graphics)gordonv@model.com
-- -------------------------------------------------------------------- Gordon Vreugdenhil 503-685-0808 Model Technology (Mentor Graphics) gordonv@model.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Mon Nov 8 11:29:45 2010
This archive was generated by hypermail 2.1.8 : Mon Nov 08 2010 - 11:29:47 PST