From a78d43465eef4564719a6a6fa2874ff6ae4abe5f Mon Sep 17 00:00:00 2001 From: Neel Date: Mon, 12 Mar 2018 18:02:00 +0530 Subject: [PATCH] partial support for dedicated pins removed unwanted print statements from scripts --- pinmap.txt | 3 +++ src/actual_pinmux.py | 14 +++++++++++--- src/params.py | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/pinmap.txt b/pinmap.txt index a6fe30d..08fc607 100644 --- a/pinmap.txt +++ b/pinmap.txt @@ -3,3 +3,6 @@ muxed 1 uart0_rx spi0_mosi 2 twi0_sda spi0_ss 3 twi0_scl spi0_miso +dedicated +4 uart1_tx +5 uart1_rx diff --git a/src/actual_pinmux.py b/src/actual_pinmux.py index 139df1c..a7ff1fe 100644 --- a/src/actual_pinmux.py +++ b/src/actual_pinmux.py @@ -28,9 +28,15 @@ input_wire=''' ######################################### pinmux=''' ''' pinmap_file=open("./pinmap.txt","r") +dedicated=False for lineno,line in enumerate(pinmap_file): line1=line.split() - if(lineno>0): + if("muxed" in line): + dedicated=False + elif("dedicated" in line): + dedicated=True + ############################## Logic for muxed pins ############################## + if(len(line1)>1 and not(dedicated)): if(lineno>N_IO): print("ERROR: Parameter N_IO("+str(N_IO)+") is less than the pin number in line: "+str(lineno)+" of pinmap.txt") exit(1) @@ -61,11 +67,13 @@ for lineno,line in enumerate(pinmap_file): print("Error: The signal : "+str(line1[i+1])+" in lineno: "+str(lineno)+"of pinmap.txt is not present in the current dictionary.\nSoln: Either update the dictionary or fix typo.") exit(1) if(x=="input"): - print(line1[i+1]+" "+x) pinmux=pinmux+input_wire.format(line1[0],i,"wr"+line1[i+1])+"\n" elif(x=="inout"): - print(line1[i+1]+" "+x) pinmux=pinmux+input_wire.format(line1[0],i,"wr"+line1[i+1]+"_in")+"\n" ################################################################################ + + ############################## Logic for dedicated pins ############################## + elif(len(line1)>1 and dedicated): + pinmux=pinmux+" cell"+str(line1[0])+"_out="+line1[1]+"_io;\n" ########################################### diff --git a/src/params.py b/src/params.py index 7257f00..d77a533 100644 --- a/src/params.py +++ b/src/params.py @@ -1,6 +1,6 @@ #== Parameters ==# N_MUX=1 # number of selection lines for the mux per io -N_IO=4 +N_IO=6 N_UART=2 N_SPI=1 N_TWI=1 -- 2.30.2