From: ian Date: Thu, 26 Aug 2004 18:57:55 +0000 (+0000) Subject: generates detectors as well as reversers netlist X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=4ce1f77884d3b8ccd1a4197ba0930db8f1c0ff54;p=trains.git generates detectors as well as reversers netlist --- diff --git a/.cvsignore b/.cvsignore index f95e861..c25d6b3 100644 --- a/.cvsignore +++ b/.cvsignore @@ -27,3 +27,8 @@ flash-all.cod reversers.pcb.output_*.* reversers.net reversers.net-info +reversers.net-spec +detectors.pcb.output_*.* +detectors.net +detectors.net-info +detectors.net-spec diff --git a/pcb/Makefile b/pcb/Makefile index c2e1ea8..c6b4974 100644 --- a/pcb/Makefile +++ b/pcb/Makefile @@ -136,4 +136,4 @@ clean: -rm -f t,gnuplots.sh reversers.net reversers.net-info -rm -f flasher.hex flasher.cod flasher.lst -.PRECIOUS: reversers.net-info +.PRECIOUS: %.net-info %.net-spec diff --git a/pcb/generate-netspec.pl b/pcb/generate-netspec.pl index 83f3947..03a0952 100755 --- a/pcb/generate-netspec.pl +++ b/pcb/generate-netspec.pl @@ -1,12 +1,22 @@ #!/usr/bin/perl +# -*- fundamental -*- use IO::Handle; -die unless @ARGV==0 || @ARGV==1 && $ARGV[0] eq 'reversers.net-spec'; +die unless @ARGV==1; +$ARGV[0] =~ m,\b(reversers|detectors)(?:\.net-spec)?$, or die; +$$1= 1; -@indiv= qw(icsp_pcq l_gnd led_red led_green); +@indiv= qw( + icsp_pcq + l_gnd + led_red + led_green + ); -push @indiv, qw(cdu_enable +if ($reversers) { + push @indiv, qw( + cdu_enable booster_retry booster_cutout booster_flag @@ -20,11 +30,43 @@ push @indiv, qw(cdu_enable rs232_fcin rs232_fcout ); + print "INDIV1 26 @indiv\n"; # 25-way D + %val = qw( + q 5 + p 17 + x qmid= + ); +} else { + push @indiv, qw( + spare0 + analogue + rs232_rxin + rs232_txout + pwmout + extint0 + extint1 + pt0..10 + ); + %val = qw( + q 20 + p 9 + x q + ); +} print "INDIV0 25 :1%13/2 @indiv\n"; # 26-way ribbon -print "INDIV1 26 @indiv\n";; # 25-way D -while () { print; } +$doing= 1; + +while () { + if (m/^\^\=(reversers|detectors)\:\s*$/) { + $doing= $$1; + next; + } + next unless $doing; + s/\^(\w)/ die unless exists $val{$1}; $val{$1}; /ge; + print; +} die $! if STDOUT->error; @@ -44,8 +86,77 @@ rly_v12 Power 31 l_gnd l_vcc 33 RB0..7 -!type Fat q0..5 qmid0..5 t0..5 -!type Power ptdrain0..17 +!type Fat q0..^q qmid0..^q +!type Power ptdrain0..^p + +# 32-way ribbon +BUS 32 + icsp_pdw + l_gnd icsp_pdrany + l_gnd icsp_pdrall + l_gnd clock + l_gnd l_vcc mclr + l_gnd i2c_clock led_reflow i2c_data led_refhigh + rly_gnd rly_v12 + cdu_gnd cdu_out + +CAC05 2 l_gnd l_vcc +0-1/1 CPIC= 2 l_gnd l_vcc + +0-5/4 OC= 16==8 + :1+2 sensei<..> + :2+2 q*& + :-1-2 l_gnd*& + :-0-2 sense<..> + +0-^q/1 BR= 4 + :1+2 sshort=*2 + :2 ^x + :4 q + +0-^q/1 RS= 2 + sensei= qmid= + +AC05 14 + :8+ + icsp_pdrall icsp_pdrall_mid icsp_pdrall_mid icsp_pd + icsp_pdrany icsp_pd + l_vcc + :7- + l_gnd + icsp_pdw_mid icsp_pdw + ptgate0 icsp_pd + - l_gnd + +RPDR 2 icsp_pdrall_mid l_vcc +RPDWU 2 icsp_pdw_mid l_vcc +RPDWI 2 icsp_pdw_mid icsp_pd +RPT0U 2 ptgate0 l_vcc + +RPCI 2 icsp_pc icsp_pcq +RPCL 2 icsp_pc l_gnd +RPCPT 2 icsp_pc ptgate1 + +0-^p/1 PTFET= 3 ptgate= ptdrain= cdu_gnd +0-^p/1 PTD= 2 cdu_out ptdrain= +2-^p/8 RAP= 16 :1 pt<..> :-0- ptgate<..> + +cdu_out Power +cdu_gnd Power + +TS912 8 + :1 ledmid_red perpicled led_reflow + :7- ledmid_green led_refhigh perpicled + :4 l_gnd + :8 l_vcc + +RLG 2 ledmid_green led_green +RLR 2 ledmid_red led_red +RLL 2 perpicled l_gnd + +^=reversers: + +!type Fat t0..5 !PIC-ASSIGN 1 mclr @@ -83,17 +194,6 @@ rly_v12 Power pt5 21 perpicled -# 32-way ribbon -BUS 32 - icsp_pdw - l_gnd icsp_pdrany - l_gnd icsp_pdrall - l_gnd clock - l_gnd l_vcc mclr - l_gnd i2c_clock led_reflow i2c_data led_refhigh - rly_gnd rly_v12 - cdu_gnd cdu_out - TERM 14 1 t q :3+2 t0..5 @@ -106,65 +206,16 @@ ULN 18 :10 rly_v12 CULN 2 rly_gnd rly_v12 -CAC05 2 l_gnd l_vcc -0-1/1 CPIC= 2 l_gnd l_vcc RAS 9 l_vcc :2 sense3..0 sense5..4 - perpicled -0-5/4 OC= 16==8 - :1+2 sensei<..> - :2+2 q*& - :-1-2 l_gnd*& - :-0-2 sense<..> - - -0-5/1 RS= 2 - sensei= qmid= - -AC05 14 - :8+ - icsp_pdrall icsp_pdrall_mid icsp_pdrall_mid icsp_pd - icsp_pdrany icsp_pd - l_vcc - :7- - l_gnd - icsp_pdw_mid icsp_pdw - ptgate0 icsp_pd - - l_gnd - -RPDR 2 icsp_pdrall_mid l_vcc -RPDWU 2 icsp_pdw_mid l_vcc -RPDWI 2 icsp_pdw_mid icsp_pd -RPT0U 2 ptgate0 l_vcc - -RPCI 2 icsp_pc icsp_pcq -RPCL 2 icsp_pc l_gnd -RPCPT 2 icsp_pc ptgate1 - -0-17/1 PTFET= 3 ptgate= ptdrain= cdu_gnd -0-17/1 PTD= 2 cdu_out ptdrain= -2-17/8 RAP= 16 :1 pt<..> :-0- ptgate<..> - -cdu_out Power -cdu_gnd Power - POINTS 25 :1 ptdrain1..17 :25 ptdrain0 -TS912 8 - :1 ledmid_red perpicled led_reflow - :7- ledmid_green led_refhigh perpicled - :4 l_gnd - :8 l_vcc - -RLG 2 ledmid_green led_green -RLR 2 ledmid_red led_red -RLL 2 perpicled l_gnd - 0-5/1 RLY= 16 :1 rly_v12 :4 q= @@ -175,7 +226,39 @@ RLL 2 perpicled l_gnd :13 t= :16 rlydrv= -0-5/1 BR= 4 - :1+2 sshort=*2 - :2 qmid= - :4 q +^=detectors: + +RAS 9 + l_vcc + :2 sense3..0 sense5..4 + - perpicled + +!PIC-ASSIGN + 1 mclr + pt4,analogue + pt5,spare0 + sense0..6 + l_vcc l_gnd clock + sense7..10 + i2c_clock + sense11..12 + :40- + pt0,icsp_pd + pt1,icsp_pc + pt2 + sense20..18 + pt6,extint1 + pt7,extint0 + l_vcc + l_gnd + sense17..15 + pt3,pwmout + pt8,rs232_rxin + pt9,rs232_txout + sense14 + i2c_data + sense13 + 21 perpicled + +TERM 22 + q q0..20 diff --git a/pic.make b/pic.make index c2e1ea8..c6b4974 100644 --- a/pic.make +++ b/pic.make @@ -136,4 +136,4 @@ clean: -rm -f t,gnuplots.sh reversers.net reversers.net-info -rm -f flasher.hex flasher.cod flasher.lst -.PRECIOUS: reversers.net-info +.PRECIOUS: %.net-info %.net-spec diff --git a/spice/Makefile b/spice/Makefile index c2e1ea8..c6b4974 100644 --- a/spice/Makefile +++ b/spice/Makefile @@ -136,4 +136,4 @@ clean: -rm -f t,gnuplots.sh reversers.net reversers.net-info -rm -f flasher.hex flasher.cod flasher.lst -.PRECIOUS: reversers.net-info +.PRECIOUS: %.net-info %.net-spec