Email: bknpk@hotmail.com Phone: +972-54-7649119
V

 

ASIC/FPGA Design and Verification Out Source Services

SPECMAN Text to Integer Conversion Method

  1. This doc explains a very simple SPECMAN method. The method gets a string as input. The string starts with VC and than some digits may follow. Later in the input string we expect the letter P followed by a number. This number is converted to an integer.
  2. As an exercise this method demonstrates work with lists and AWK style command from SPECMAN.
  3. Method execution flow description:
    Extract a list of digits from the string. Get the list size and for each digit, sum to the result.

  4. text_to_int() : uint is {
      var Bmatch : bool = name ~ "/VC.*P([0-9]*)/";
      var Smatch : string = $1;
      var Umatch := Smatch.as_a(list of int);
      var Usize := Umatch.size()-1;
      var pwr : uint = 1;
      result=0;
      for each in Umatch do {
        result=result + (pwr*(Umatch[Usize-index]-48));
        pwr=pwr*10;
      };--for
    };--text_to_int

Contact me now at:

  ...


I would be happy to offer my services. Call ASAP !


Home

e-code for E1-crc4

Download Area






Search This Site


Feedback This Site




new pages on this site