Переглянути джерело

synchro.sv: use global version of tostr()

tostr() has been moved to functions.sv, can use it there.
H. Peter Anvin 3 роки тому
батько
коміт
873b48e082
3 змінених файлів з 2 додано та 30 видалено
  1. 2 2
      output_files/max80.jam
  2. BIN
      output_files/max80.sof
  3. 0 28
      synchro.sv

+ 2 - 2
output_files/max80.jam

@@ -13,7 +13,7 @@
 'refer to the applicable agreement for further details, at
 'https://fpgasoftware.intel.com/eula.
 
-'Device #1: EP4CE15 - /home/hpa/abc80/max80/blinktest/output_files/max80.sof Thu Sep 23 09:25:26 2021
+'Device #1: EP4CE15 - /home/hpa/abc80/max80/blinktest/output_files/max80.sof Thu Sep 23 09:39:37 2021
 
 
 NOTE "CREATOR" "QUARTUS PRIME JAM COMPOSER 20.1";
@@ -4272,4 +4272,4 @@ NEXT j;
 POP j;
 ENDPROC;
 ' END OF FILE
-CRC 0175;
+CRC 621B;

BIN
output_files/max80.sof


+ 0 - 28
synchro.sv

@@ -18,34 +18,6 @@ module synchronizer #(parameter width = 1, parameter stages = 2)
     output [width-1:0] q
     );
 
-   // Quartus doesn't support $sformatf() for synthesis, sigh...
-   function string tostr(input integer i);
-     if (i < 0)
-       tostr = {"-",tostr(-i)};
-     else if (i >= 10)
-       tostr = {tostr(i/10), tostr(i%10)};
-     else if (i == 0)
-       tostr = "0";
-     else if (i == 1)
-       tostr = "1";
-     else if (i == 2)
-       tostr = "2";
-     else if (i == 3)
-       tostr = "3";
-     else if (i == 4)
-       tostr = "4";
-     else if (i == 5)
-       tostr = "5";
-     else if (i == 6)
-       tostr = "6";
-     else if (i == 7)
-       tostr = "7";
-     else if (i == 8)
-       tostr = "8";
-     else
-       tostr = "9";
-   endfunction
-
    // SYNCHRONIZER_IDENTIFICATION FORCED identifies the *beginning* of
    // the synchro; it needs to be used with AUTO for the other stages or
    // the chains will be broken up for each stage.