[sv-ec] Problems with Appendix D - "Linked List"

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Mon Apr 03 2006 - 13:49:36 PDT
In Appendix D, List is described as being a 'include of a set of
parameterized class definitions.  This appears to be a flawed
approach due to how parameterized class specializations are
defined in 7.23.

Consider:

------  file p.sv
     package pkg;
     'include <List.svh>
     function void dump_list(input List#(int) thelist);
       ...
     endfunction
     endpackage

------ file top.sv

     module top;
        import pkg::*;

        'include <List.svh>
        List#(int) mylist;
          ....
        initial  pkg::dump_list(mylist);
     endmodule

This will fail.  The **included** parameterized class
definitions create two "universes" of incompatible types;
the specialization inside top and the one inside pkg are
different types.  Moving the 'include in top.sv outside
of the module still doesn't help since then the
parameterized class (and its specializations) are bound
to the $unit and are not shared with the ones in
package pkg.


It isn't obvious that List is really needed in SV;
queues have closely related functionality that it doesn't
seem that List presents that much additional functionality --
a few additional methods (swap, etc) but it isn't obvious
that we should retain it at all.

If we do want to retain List, at the very least the List type
should move to package std so that the type specializations
can be usefully shared through the design (which I expect was
the  original intent).

Gord
-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com
Received on Mon Apr 3 13:49:39 2006

This archive was generated by hypermail 2.1.8 : Mon Apr 03 2006 - 13:49:46 PDT