improved the BASYS3 PLL parameters

This commit is contained in:
hneemann 2019-05-18 15:04:21 +02:00
parent 587a6d0fda
commit 416e908d01
3 changed files with 15 additions and 11 deletions

View File

@ -113,10 +113,14 @@ begin
F_VCO = (F_IN*M)/D; F_VCO = (F_IN*M)/D;
} }
DIV := min(128,max(1,round(F_VCO/F_DES*1000)/1000.0)); DIV := min(128,max(1,round(F_VCO/F_DES*8)/8.0));
// correct to fractional M
M=round((F_DES*D*DIV*1000)/F_IN)/1000.0;
F_VCO = (F_IN*M)/D;
log(format("M_ideal=%.2f",M_IDEAL)); log(format("M_ideal=%.2f",M_IDEAL));
log(format("M=%d",M)); log(format("M=%.3f",M));
log(format("D=%d",D)); log(format("D=%d",D));
log(format("DIV=%f",DIV)); log(format("DIV=%f",DIV));
@ -127,8 +131,6 @@ begin
log(format("F_VCO=%.2f",F_VCO)); log(format("F_VCO=%.2f",F_VCO));
log(format("F_OUT=%f",F_OUT)); log(format("F_OUT=%f",F_OUT));
log(format("F_Desired=%f",F_DES)); log(format("F_Desired=%f",F_DES));
M = float(M);
?> ?>
DEV_NULL <= '0'; DEV_NULL <= '0';

View File

@ -46,7 +46,7 @@ all: $(PROJ).bin
icepack $&lt; $@ icepack $&lt; $@
%.rpt: %.asc %.rpt: %.asc
icetime -d $(DEVICE) -C C:\Users\helmut.neemann\.apio\packages\toolchain-icestorm\share\icebox -mtr $@ $&lt; icetime -d $(DEVICE) -C icebox -mtr $@ $&lt;
%_tb: %_tb.v %.v %_tb: %_tb.v %.v
iverilog -o $@ $^ iverilog -o $@ $^

View File

@ -106,15 +106,15 @@ public class OSExecute {
throw new IOException(Lang.get("err_processDoesNotTerminate_N", processBuilder.command())); throw new IOException(Lang.get("err_processDoesNotTerminate_N", processBuilder.command()));
} }
if (process.exitValue() != 0 && !ignoreReturnCode)
throw new IOException(Lang.get("err_processExitedWithError_N1_N2", process.exitValue(), "\n" + consoleReader.toString()));
try { try {
consoleReader.join(); consoleReader.join();
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (process.exitValue() != 0 && !ignoreReturnCode)
throw new IOException(Lang.get("err_processExitedWithError_N1_N2", process.exitValue(), "\n" + consoleReader.toString()));
if (consoleReader.getException() != null) if (consoleReader.getException() != null)
throw consoleReader.getException(); throw consoleReader.getException();
@ -166,7 +166,7 @@ public class OSExecute {
byte[] data = new byte[4096]; byte[] data = new byte[4096];
int l; int l;
while ((l = console.read(data)) >= 0) { while ((l = console.read(data)) >= 0) {
synchronized (this) { synchronized (baos) {
baos.write(data, 0, l); baos.write(data, 0, l);
} }
} }
@ -180,8 +180,10 @@ public class OSExecute {
} }
@Override @Override
public synchronized String toString() { public String toString() {
return baos.toString(); synchronized (baos) {
return baos.toString();
}
} }
} }