From 0a3f257e9b86c0ea31b6c3b2df03be4e9064fb8d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 May 2025 19:01:43 +0100 Subject: various improvements --- fpga/hp_lcd_driver/g | 2 +- fpga/hp_lcd_driver/hp_lcd_driver.vhdl | 15 +++++---- fpga/hp_lcd_driver/prog | 5 +-- fpga/hp_lcd_driver/smh-ac415.mk | 61 ++++++++++++++++++++++++++++++++++- 4 files changed, 72 insertions(+), 11 deletions(-) (limited to 'fpga/hp_lcd_driver') diff --git a/fpga/hp_lcd_driver/g b/fpga/hp_lcd_driver/g index 1ee944e..90be90b 100755 --- a/fpga/hp_lcd_driver/g +++ b/fpga/hp_lcd_driver/g @@ -2,4 +2,4 @@ set -e make smh-ac415 rsync -varP -e ssh ./ 10.16.66.111:${PWD}/ -ssh 10.16.66.111 "cd ${PWD} && /root/prog" +ssh 10.16.66.111 "cd ${PWD} && ./prog" diff --git a/fpga/hp_lcd_driver/hp_lcd_driver.vhdl b/fpga/hp_lcd_driver/hp_lcd_driver.vhdl index 98714e4..8d1635f 100644 --- a/fpga/hp_lcd_driver/hp_lcd_driver.vhdl +++ b/fpga/hp_lcd_driver/hp_lcd_driver.vhdl @@ -193,14 +193,15 @@ begin rd_data => rd_data ); + + + r<=x"00"; + b<=x"00"; + + g <= x"ff" when rd_data(1) = '1' else + x"80" when rd_data(0) = '1' else + x"00"; - r <= x"ff" when rd_data(1) = '1' else - x"00"; - g <= x"ff" when rd_data(0) = '1' else - x"ff" when rd_data(1) = '1' else - x"00"; - b <= x"ff" when rd_data(1) = '1' else - x"00"; diff --git a/fpga/hp_lcd_driver/prog b/fpga/hp_lcd_driver/prog index eab1443..cf26f2f 100755 --- a/fpga/hp_lcd_driver/prog +++ b/fpga/hp_lcd_driver/prog @@ -1,7 +1,8 @@ #!/bin/bash -OPENOCD="/root/projects/hp_instrument_lcds/fpga/prefix/bin/openocd -f interface/altera-usb-blaster.cfg -f ep4ce15.cfg" -${OPENOCD} -c 'svf -tap $CHIPNAME.tap ./build_smh-ac415/hp_lcd_driver.svf; shutdown ; quit' +#OPENOCD="/root/projects/hp_instrument_lcds/fpga/prefix/bin/openocd -f interface/altera-usb-blaster.cfg -f ep4ce15.cfg" +OPENOCD="openocd -f interface/altera-usb-blaster.cfg -f ep4ce15.cfg" +${OPENOCD} -c 'svf -tap $CHIPNAME.tap ./build_smh-ac415/hp_lcd_driver-p.svf; shutdown ; quit' diff --git a/fpga/hp_lcd_driver/smh-ac415.mk b/fpga/hp_lcd_driver/smh-ac415.mk index 7c2d649..2fdacc5 100644 --- a/fpga/hp_lcd_driver/smh-ac415.mk +++ b/fpga/hp_lcd_driver/smh-ac415.mk @@ -3,6 +3,9 @@ include relpath.mk BOARD=smh-ac415 FAMILY=Cyclone IV E PART=EP4CE15F23C8 +CPART1=CFI_64M +CPART2=QSPI_64M +#EPCS16 TOP=hp_lcd_driver BUILD=build_${BOARD} OF=output_files @@ -30,9 +33,15 @@ FIT=${BUILD}/${OF}/$(PROJECT).fit.rpt ASM=${BUILD}/${OF}/$(PROJECT).asm.rpt ASM=${BUILD}/${OF}/$(PROJECT).sta.rpt SOF=${BUILD}/${OF}/${PROJECT}.sof +COF=${BUILD}/${OF}/${PROJECT}.cof +POF=${BUILD}/${OF}/${PROJECT}.pof +#JIC=${BUILD}/${OF}/${PROJECT}.jic +CDF=${BUILD}/${OF}/${PROJECT}.cdf SVF=${BUILD}/${PROJECT}.svf +PSVF=${BUILD}/${PROJECT}-p.svf -default:${SVF} +default:${SVF} ${PSVF} + echo ${PSVF} ${BUILD}/%.vhd ${BUILD}/%.qip:%.vhdl @@ -81,6 +90,56 @@ ${STA}:${FIT} svf:${SVF} ${SVF}:${SOF} (cd ${BUILD} && run_quartus quartus_cpf ${CPF_ARGS} $(call relpath,$<,${BUILD}) $(call relpath,$@,${BUILD}) ) +#${JIC}:${SOF} +# (cd ${BUILD} && run_quartus quartus_cpf -c -s ${PART} -d ${CPART} $(call relpath,$<,${BUILD}) $(call relpath,$@,${BUILD}) ) +#${SVFP}:${JIC} +# (cd ${BUILD} && run_quartus quartus_cpf ${CPF_ARGS} $(call relpath,$<,${BUILD}) $(call relpath,$@,${BUILD}) ) + + +${COF}: ${SOF} + echo '' > $@ + echo '' >> $@ + echo ' ${CPART_1}' >> $@ + echo ' $(call relpath,${POF},${BUILD})' >> $@ + echo ' 1' >> $@ + echo ' 1' >> $@ + echo ' 0' >> $@ + echo ' ' >> $@ + echo ' Page_0' >> $@ + echo ' 1' >> $@ + echo ' ' >> $@ + echo ' $(call relpath,${SOF},${BUILD})' >> $@ + echo ' ' >> $@ + echo ' ' >> $@ + echo ' 5' >> $@ + echo ' 0' >> $@ + echo ' ' >> $@ + echo ' 1' >> $@ + echo ' 0' >> $@ + echo ' 0' >> $@ + echo ' ' >> $@ + echo '' >> $@ + +${POF}:${COF} + (cd ${BUILD} && run_quartus quartus_cpf -c $(call relpath,$<,${BUILD})) +# (cd ${BUILD} && run_quartus quartus_cpf -c -d EPCQ64 $(call relpath,$<,${BUILD}) $(call relpath,$@,${BUILD}) ) + +${CDF}:${POF} + echo 'JedecChain;' > $@ + echo ' FileRevision(JESD32A);' >> $@ + echo ' DefaultMfr(6E);' >> $@ + echo '' >> $@ + echo ' P ActionCode(Ign)' >> $@ + echo ' Device PartName(${CPART2}) MfrSpec(OpMask(0) SEC_Device(QSPI_64MB) Child_OpMask(3 0 0 0) FullPath("$(call relpath,${SOF},${BUILD})") PFLPath("$(call relpath,${POF},${BUILD})"));' >> $@ + echo '' >> $@ + echo 'ChainEnd;' >> $@ + echo '' >> $@ + echo 'AlteraBegin;' >> $@ + echo ' ChainType(JTAG);' >> $@ + echo 'AlteraEnd;' >> $@ + +${PSVF}:${CDF} + (cd ${BUILD} && run_quartus quartus_cpf ${CPF_ARGS} $(call relpath,$<,${BUILD}) $(call relpath,$@,${BUILD}) ) -- cgit v1.2.3