aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2022-05-30 10:12:49 +0200
committerGitHub <noreply@github.com>2022-05-30 10:12:49 +0200
commitcb067cf3945b2c517c6cf257bfe26e8f1b56a0cb (patch)
treea3e1cf0d2d6a2ffe4d730c1c6e4d9abbd700d75b
parent29556af238e4efea040eded319ebe9c781510733 (diff)
parente368f15a7f71fcd066318400b7867b5d1595ae39 (diff)
downloadicestorm-cb067cf3945b2c517c6cf257bfe26e8f1b56a0cb.tar.gz
icestorm-cb067cf3945b2c517c6cf257bfe26e8f1b56a0cb.tar.bz2
icestorm-cb067cf3945b2c517c6cf257bfe26e8f1b56a0cb.zip
Merge pull request #278 from davidthings/master
Add an option (-p) to icepll to force use of SB_PLL40_PAD
-rw-r--r--icepll/icepll.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/icepll/icepll.cc b/icepll/icepll.cc
index 398b545..b27d184 100644
--- a/icepll/icepll.cc
+++ b/icepll/icepll.cc
@@ -48,6 +48,9 @@ void help(const char *cmd)
printf(" -o <output_freq_mhz>\n");
printf(" PLL Output Frequency (default: 60 MHz)\n");
printf("\n");
+ printf(" -p\n");
+ printf(" Clock source is an input pad rather than FPGA routing\n");
+ printf("\n");
printf(" -S\n");
printf(" Disable SIMPLE feedback path mode\n");
printf("\n");
@@ -204,6 +207,7 @@ int main(int argc, char **argv)
double f_pllin = 12;
double f_pllout = 60;
+ bool pad = false;
bool simple_feedback = true;
const char* filename = NULL;
bool file_stdout = false;
@@ -214,7 +218,7 @@ int main(int argc, char **argv)
bool quiet = false;
int opt;
- while ((opt = getopt(argc, argv, "i:o:Smf:n:bB:q")) != -1)
+ while ((opt = getopt(argc, argv, "i:o:pSmf:n:bB:q")) != -1)
{
switch (opt)
{
@@ -224,6 +228,9 @@ int main(int argc, char **argv)
case 'o':
f_pllout = atof(optarg);
break;
+ case 'p':
+ pad = true;
+ break;
case 'S':
simple_feedback = false;
break;
@@ -395,7 +402,7 @@ int main(int argc, char **argv)
);
// save iCE40 PLL tile configuration
- fprintf(f, "SB_PLL40_CORE #(\n");
+ fprintf(f, "%s #(\n", (pad ? "SB_PLL40_PAD" : "SB_PLL40_CORE"));
fprintf(f, "\t\t.FEEDBACK_PATH(\"%s\"),\n", (simple_feedback ? "SIMPLE" : "NON_SIMPLE"));
fprintf(f, "\t\t.DIVR(4'b%s),\t\t" "// DIVR = %2d\n", binstr(best_divr, 4), best_divr);
fprintf(f, "\t\t.DIVF(7'b%s),\t" "// DIVF = %2d\n", binstr(best_divf, 7), best_divf);
@@ -405,9 +412,9 @@ int main(int argc, char **argv)
"\t\t.LOCK(locked),\n"
"\t\t.RESETB(1'b1),\n"
"\t\t.BYPASS(1'b0),\n"
- "\t\t.REFERENCECLK(clock_in),\n"
+ "\t\t.%s(clock_in),\n"
"\t\t.PLLOUTCORE(clock_out)\n"
- "\t\t);\n\n"
+ "\t\t);\n\n", (pad ? "PACKAGEPIN":"REFERENCECLK")
);
fprintf(f, "endmodule\n");