When inputs from multiple IO cells drive the same interface/peripheral there needs to be an implicite priority between the rules updating the same wire (going to the interface). The current pinmap in this commit creates the above scenario.
To enable the implicit scheduling the rules names need to be different. This commit ensures this as well
Also currently the ordering is based on the order in which the user provides the two instances. the first instance os uart_rx is given priority over the later instance in the pinmap.txt file.
muxed
0 uart0_tx spi0_sclk
1 uart0_rx spi0_mosi
-2 uart1_tx spi0_ss
-3 uart1_rx spi0_miso
+2 spi0_ss uart0_rx
+3 uart1_tx spi0_miso
## dictionary of properties of signals that are supported.
dictionary={
- "uart_rx":"input",
- "uart_tx":"output",
- "spi_sclk":"output",
- "spi_mosi":"output",
- "spi_ss": "output",
- "spi_miso":"input"
+ "uart_rx" :"input",
+ "uart_tx" :"output",
+ "spi_sclk" :"output",
+ "spi_mosi" :"output",
+ "spi_ss" :"output",
+ "spi_miso" :"input"
}
# second argument is the mux value.
# Third argument is the signal from the pinmap file
input_wire='''
- rule assign_input_for_{2}(wrmux{0}=={1});
+ rule assign_input_for_{2}_on_cell{0}(wrmux{0}=={1});
wr{2}<=cell{0}_in;
endrule
'''
if(x==None):
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"):
+ if(x=="input" or x=="inout"):
pinmux=pinmux+input_wire.format(line1[0],i,line1[i+1])+"\n"
################################################################################
###########################################