Changeset 40 for PROJECT_CORE_MPI


Ignore:
Timestamp:
Dec 7, 2012, 11:32:04 AM (12 years ago)
Author:
rolagamo
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • PROJECT_CORE_MPI/SWITCH_GEN/BRANCHES/v0.01/CoreTypes.vhd

    r36 r40  
    148148  --renvoie un std_logic_vector de taille width
    149149  Function Stdlv (s1 : natural;width:positive ) return std_logic_vector;
     150  function image(L: bit_vector) return String;
     151  function image(L: bit) return String;
     152   function image(L: std_logic_vector) return String;
     153  function image(L: std_logic) return String;
     154--  function HexImage(L: unsigned) return String;
     155--  function HexImage(L: signed) return String;
     156--  function HexImage(L: std_ulogic_vector) return String;
     157--  function HexImage(L: std_logic_vector) return String;
     158--  function HexImage(L: bit_vector) return String;
    150159end CoreTypes;
    151160
     
    238247        return V;
    239248 end stdlv;
     249 
     250 -- Start of heximage functions
     251--function HexImage(L: bit_vector) return String is
     252--begin
     253--return(HexImage(imge(L)));
     254--end function HexImage;
     255--
     256--function HexImage(L: std_ulogic_vector) return String is
     257--begin
     258--return(HexImage(image(to_x01(L))));
     259--end function HexImage;
     260
     261--function HexImage(L: std_logic_vector) return String is
     262--begin
     263--return(HexImage(imge(to_x01(L))));
     264--end function HexImage;
     265--
     266--function HexImage(L: signed) return String is
     267--begin
     268--return(HexImage(imge(L)));
     269--end function HexImage;
     270--
     271--function HexImage(L: unsigned) return String is
     272--begin
     273--return(HexImage(image(L)));
     274--end function HexImage;
     275-- End of heximage functions
     276-- Start of an example image function
     277function image(L: bit) return String is
     278constant bit_image: String := bit'image(L);
     279begin
     280return(bit_image(2 to 2));
     281end function image;
     282
     283
     284function image(L: std_logic) return String is
     285variable bit_image: String := std_logic'image(L);
     286begin
     287return(bit_image(2 to 2));
     288end function image;
     289
     290function image(L: bit_vector) return String is
     291variable Lx: bit_vector(1 to L'length);
     292variable RetVal: String(1 to L'length);
     293begin
     294Lx := L;
     295for i in Lx'range loop
     296RetVal(i to i) := image(Lx(i));
     297end loop;
     298return(RetVal);
     299end function image;
     300
     301
     302function image(L: std_logic_vector) return String is
     303variable Lx: std_logic_vector(1 to L'length);
     304variable RetVal: String(1 to L'length);
     305begin
     306Lx := L;
     307for i in Lx'range loop
     308RetVal(i to i) := image(Lx(i));
     309end loop;
     310return(RetVal);
     311end function image;
    240312end CoreTypes;
Note: See TracChangeset for help on using the changeset viewer.