[J-core] What's involved with putting serial ports on GPIO pins?

Geoff Salmon gsalmon at se-instruments.com
Fri Apr 29 15:26:34 EDT 2016


On 16-04-29 12:37 PM, Geoff Salmon wrote:
> Delete
>
>    {:match "uart_tx" :signal "uart0_rx"}
>    {:match "uart_rx" :signal "uart0_tx" :attrs {:drive 8 :slew "fast"}}
>
> and change the end of the :rules vector from
>
>           {:match ["io_p" n "_" m] :signal ["io_p" n "(" m ")"]
>            :attrs {:drive 8 :slew "fast"}}]}
>
> to
>
>           {:match ["io_p" n "_" m] :signal ["io_p" n "(" m ")"]
>            :attrs {:drive 8 :slew "fast"}}
>
>           {:match "io_p7_6" :signal "uart0_rx"}
>           {:match "io_p7_5" :signal "uart0_tx" :attrs {:drive 8 :slew
> "fast"}}
>           ]}
>
> and rerun "make soc_gen".


Sorry, I sent that too soon. It isn't quite right. Instead delete

            {:match "uart_tx" :signal "uart0_rx"}
            {:match "uart_rx" :signal "uart0_tx" :attrs {:drive 8 :slew 
"fast"}}

and change the end of the :rules vector from

            {:match ["io_p" n "_" m] :signal ["io_p" n "(" m ")"]
             :attrs {:drive 8 :slew "fast"}}]}

to

            {:match ["io_p" n "_" m] :signal ["io_p" n "(" m ")"]
             :attrs {:drive 8 :slew "fast"}}

            {:match "io_p7_6" :signal "uart0_rx" :attrs {:drive nil 
:slew nil}}
            {:match "io_p7_5" :signal "uart0_tx" :attrs {:drive 8 :slew 
"fast"}}
            ]}

and rerun "make soc_gen". I've attached a new diff of the results.

The addition of :attrs {:drive nil :slew nil} in the :signal "uart0_rx" 
rule removes the drive and slew attributes set by the earlier :match 
["io_p" n "_" m] rule. Drive and slew are not used for an input pin. If 
you compare pad_ring.vhd in the two diff files, the presence of those 
attrs caused soc_gen to add DRIVE and SLEW generics to the IBUF 
instantiated for the pin. IBUFs do not have DRIVE and SLEW generics, so 
the bitstream build would fail.

I could have also removed the :attrs {:drive 8 :slew "fast"} from the 
:signal "uart0_tx" rule, because those attrs are set by the earlier 
:match ["io_p" n "_" m] rule. Setting them again has no effect.

Newer versions of soc_gen ignore attrs that don't apply to the 
particular io buffer being instantiated and won't add invalid generics.

- Geoff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: move_uart_pins2.diff
Type: text/x-patch
Size: 3970 bytes
Desc: not available
URL: <http://lists.j-core.org/pipermail/j-core/attachments/20160429/121cf8c5/attachment-0001.bin>


More information about the J-core mailing list