Skip to content

Commit 78a354e

Browse files
committed
feat+fix: adding a config option so that new frameworks strictly enforce pin declaration checks (error instead of warning), fixed projects accordingly
1 parent c078cbf commit 78a354e

File tree

7 files changed

+17
-6
lines changed

7 files changed

+17
-6
lines changed

frameworks/boards/icebreaker/icebreaker.v

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ $$config['dualport_bram_wenable0_width'] = '1'
3939
$$config['dualport_bram_wenable1_width'] = '1'
4040
$$config['simple_dualport_bram_wenable0_width'] = '1'
4141
$$config['simple_dualport_bram_wenable1_width'] = '1'
42+
$$config['allow_deprecated_framework'] = 'no'
4243
// declare package pins (has to match the hardware pin definition)
4344
// pin.NAME = <WIDTH>
4445
$$pin.LED1=1 pin.LED2=1 pin.LED3=1 pin.LED4=1 pin.LED5=1

frameworks/boards/icestick/icestick.v

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ $$config['dualport_bram_wenable0_width'] = '1'
3939
$$config['dualport_bram_wenable1_width'] = '1'
4040
$$config['simple_dualport_bram_wenable0_width'] = '1'
4141
$$config['simple_dualport_bram_wenable1_width'] = '1'
42+
$$config['allow_deprecated_framework'] = 'no'
4243
// declare package pins (has to match the hardware pin definition)
4344
// pin.NAME = <WIDTH>
4445
$$pin.D1 = 1 pin.D2 = 1 pin.D3 = 1 pin.D4 = 1 pin.D5 = 1
@@ -58,6 +59,11 @@ $$pin.vga_g = {pin.TR10,pin.TR9,pin.TR8,pin.TR7,pin.TR6,pin.TR5}
5859
$$pin.vga_b = {pin.BR10,pin.BR9,pin.BR8,pin.BR7,pin.BR6,pin.BR5}
5960
$$pin.vga_hs = {pin.PMOD7}
6061
$$pin.vga_vs = {pin.PMOD10}
62+
$$pin.video_r = {pin.PMOD1,pin.PMOD2,pin.PMOD3,pin.PMOD4,pin.PMOD8,pin.PMOD9}
63+
$$pin.video_g = {pin.TR10,pin.TR9,pin.TR8,pin.TR7,pin.TR6,pin.TR5}
64+
$$pin.video_b = {pin.BR10,pin.BR9,pin.BR8,pin.BR7,pin.BR6,pin.BR5}
65+
$$pin.video_hs = {pin.PMOD7}
66+
$$pin.video_vs = {pin.PMOD10}
6167
$$pin.pmod = {pin.PMOD10,pin.PMOD9,pin.PMOD8,pin.PMOD7,pin.PMOD4,pin.PMOD3,pin.PMOD2,pin.PMOD1}
6268
$$pin.uart_tx = {pin.TX}
6369
$$pin.uart_rx = {pin.RX}

frameworks/boards/ulx3s/ulx3s.v

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ $$NUM_BTNS = 7
4040
$$color_depth = 6
4141
$$color_max = 63
4242
$$config['dualport_bram_supported'] = 'yes'
43+
$$config['allow_deprecated_framework'] = 'no'
4344
// declare package pins (has to match the hardware pin definition)
4445
// pin.NAME = <WIDTH>
4546
$$pin.gp = 28
@@ -78,6 +79,8 @@ $$pin.usb_fpga_bd_dp = 1
7879
$$pin.usb_fpga_bd_dn = 1
7980
$$pin.usb_fpga_pu_dp = 1
8081
$$pin.usb_fpga_pu_dn = 1
82+
$$pin.us2_bd_dp = pin.usb_fpga_bd_dp
83+
$$pin.us2_bd_dn = pin.usb_fpga_bd_dn
8184
$$pin.ftdi_rxd = 1
8285
$$pin.ftdi_txd = 1
8386
$$pin.uart_rx = 1

projects/oled_sdcard_test/oled_sdcard_imgview.si

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $$dofile('pre_sdcard_image.lua')
2121

2222
algorithm main(
2323
output uint8 leds,
24-
input uint7 btn,
24+
input uint7 btns,
2525
output uint1 oled_clk,
2626
output uint1 oled_mosi,
2727
output uint1 oled_dc,
@@ -58,7 +58,7 @@ algorithm main(
5858

5959
uint7 btn_latch = 0;
6060

61-
btn_latch := btn;
61+
btn_latch := btns;
6262

6363
// maintain low (pulses high when needed)
6464
io.start_rect := 0;

projects/oled_text/oled_text.si

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $$end
7575
algorithm main(
7676
$$if ULX3S then
7777
output uint8 leds,
78-
input uint7 btn,
78+
input uint7 btns,
7979
output uint1 oled_clk,
8080
output uint1 oled_mosi,
8181
output uint1 oled_dc,

src/SiliceCompiler.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ using namespace Silice::Utils;
4949

5050
// -------------------------------------------------
5151

52-
bool g_Disable_CL0006 = false; // allows to force the use of outdates frameworks
52+
bool g_Disable_CL0006 = false; // turn the check for missing pins into a warning
5353

5454
extern bool g_SplitInouts;
5555

@@ -379,6 +379,7 @@ void SiliceCompiler::beginParsing(
379379
CONFIG.keyValues()["frameworks_dir"] = frameworks_dir;
380380
CONFIG.keyValues()["templates_path"] = frameworks_dir + "/templates";
381381
CONFIG.keyValues()["libraries_path"] = frameworks_dir + "/libraries";
382+
CONFIG.keyValues()["allow_deprecated_framework"] = "yes"; /// TODO: enforce this next major version
382383
// create the preprocessor
383384
AutoPtr<LuaPreProcessor> lpp(new LuaPreProcessor());
384385
lpp->enableFilesReport(fresult + ".files.log");
@@ -555,7 +556,7 @@ bool SiliceCompiler::addTopModulePort(
555556
) {
556557
if (!m_BodyContext->lpp->isIOPortDefined(port)) {
557558
CHANGELOG.addPointOfInterest("CL0006", srcloc);
558-
if (g_Disable_CL0006) {
559+
if (g_Disable_CL0006 || CONFIG.keyValues()["allow_deprecated_framework"] == "yes") {
559560
warn(Deprecation, srcloc, "pin '%s' is not declared in framework\n This may result in incorrect Verilog code.\n", port.c_str());
560561
} else {
561562
reportError(srcloc, "pin '%s' is not declared in framework\n This may result in incorrect Verilog code.\n Use --no-pin-check on command line to force.", port.c_str());

src/silice.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int main(int argc, char **argv)
9292
cmd.add(exportParam);
9393
TCLAP::SwitchArg forceResetInit("", "force-reset-init", "forces initialization at reset of initialized registers", false);
9494
cmd.add(forceResetInit);
95-
TCLAP::SwitchArg disableCL0006("", "no-pin-check", "disable check for pin declaration in frameworks (see CL0006)", true); /// ////////// TODO set to false once no longer wip
95+
TCLAP::SwitchArg disableCL0006("", "no-pin-check", "force disable check for pin declaration in frameworks (see CL0006)", false);
9696
cmd.add(disableCL0006);
9797
TCLAP::SwitchArg splitInouts("", "split-inouts", "splits all inouts into enable, in, out pins", false);
9898
cmd.add(splitInouts);

0 commit comments

Comments
 (0)