Skip to content
Snippets Groups Projects
Commit d3407d96 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Added tech_nat_to_mbps_str() that is a renamed copy of trnb_nat_to_str() in tr_nonbonded_pkg.vhd.

parent 20c95a39
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,8 @@ PACKAGE technology_pkg IS
FUNCTION tech_true_log2(n : NATURAL) RETURN NATURAL; -- tech_true_log2(n) = log2(n)
FUNCTION tech_ceil_log2(n : NATURAL) RETURN NATURAL; -- tech_ceil_log2(n) = log2(n), but force tech_ceil_log2(1) = 1
FUNCTION tech_nat_to_mbps_str( n : IN NATURAL ) RETURN STRING;
END technology_pkg;
PACKAGE BODY technology_pkg IS
......@@ -82,4 +84,19 @@ PACKAGE BODY technology_pkg IS
END IF;
END;
FUNCTION tech_nat_to_mbps_str( n : IN NATURAL ) RETURN STRING IS -- Converts a selection of naturals to Mbps strings, used for edited MegaWizard file in ip_stratixiv_hssi_*_generic.vhd
VARIABLE r : STRING(1 TO 9);
BEGIN
CASE n is
WHEN 2500 => r := "2500 Mbps";
WHEN 3125 => r := "3125 Mbps";
WHEN 5000 => r := "5000 Mbps";
WHEN 6250 => r := "6250 Mbps";
WHEN OTHERS =>
r := "ERROR: tech_nat_to_mbps_str UNSUPPORTED DATA RATE"; -- This too long string will cause an error in Quartus synthesis
REPORT r SEVERITY FAILURE; -- Severity Failure will stop the Modelsim simulation
END CASE;
RETURN r;
END;
END technology_pkg;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment