kactus2 / kactus2dev

Kactus2 is a graphical EDA tool based on the IP-XACT standard.
https://research.tuni.fi/system-on-chip/tools/
GNU General Public License v2.0
191 stars 35 forks source link

Bus portmap autoconnect confuses PULLUP and PULLDN, but only sometimes. #61

Closed TonyReinberger closed 2 years ago

TonyReinberger commented 2 years ago

Kactus2 3.9.171 64bit Windows

I have multiple wires / ports which are similarly named except the physical port has the direction as a suffix and the case of some letters may differ. I've replaced digits in the names with a lowercase x.

Bus logical wire examples:

    GPIO_DPGA_x_PULLUP
    GPIO_DPGA_x_PULLDN
    GPIO_SPGA_x_PULLUP
    GPIO_SPGA_x_PULLDN
    GPIO_BUFF_PULLUP
    GPIO_BUFF_PULLDN
    GPIO_BUFFx_PULLUP
    GPIO_BUFFx_PULLDN
    GPIO_DPGA_x_INPUT_NEG_PULLUP
    GPIO_DPGA_x_INPUT_POS_PULLUP
    GPIO_DPGA_x_INPUT_NEG_PULLDN
    GPIO_DPGA_x_INPUT_POS_PULLDN

Component logical port examples:

    gpio_DPGA_x_pulldn_out
    gpio_DPGA_x_pullup_out
    gpio_SPGA_x_pulldn_out
    gpio_SPGA_x_pullup_out
    gpio_BUFF_pulldn_out
    gpio_BUFF_pullup_out
    gpio_BUFFx_pulldn_out
    gpio_BUFFx_pullup_out
    gpio_DPGA_x_input_neg_pullup_out
    gpio_DPGA_x_input_pos_pullup_out
    gpio_DPGA_x_input_neg_pulldn_out
    gpio_DPGA_x_input_pos_pulldn_out

The autoconnect makes the following correct connections.

    GPIO_DPGA_x_PULLDN -> gpio_DPGA_x_pulldn_out
    GPIO_SPGA_x_PULLDN -> gpio_SPGA_x_pulldn_out
    GPIO_BUFF_PULLDN -> gpio_BUFF_pulldn_out
    GPIO_BUFFx_PULLDN -> gpio_BUFFx_pulldn_out
    GPIO_DPGA_x_INPUT_NEG_PULLUP -> gpio_DPGA_x_input_neg_pullup_out
    GPIO_DPGA_x_INPUT_POS_PULLUP -> gpio_DPGA_x_input_pos_pullup_out
    GPIO_DPGA_x_INPUT_NEG_PULLDN -> gpio_DPGA_x_input_neg_pulldn_out
    GPIO_DPGA_x_INPUT_POS_PULLDN -> gpio_DPGA_x_input_pos_pulldn_out

The autoconnect makes the following incorrect connections.

    GPIO_DPGA_x_PULLUP -> gpio_DPGA_x_pulldn_out
    GPIO_SPGA_x_PULLUP -> gpio_SPGA_x_pulldn_out
    GPIO_BUFF_PULLUP -> gpio_BUFF_pulldn_out
    GPIO_BUFFx_PULLUP -> gpio_BUFFx_pulldn_out

Based on my signals, the pullup / pulldn is determined correctly on the longer names but the shorter PULLUP bus wires get assigned to the pulldn ports as well (bus wires shorted). This results in some pullup ports being unassigned to any interface which is how I discovered the problem. I then edit the XML to change "dn" to "up" in the portmaps which are broken since that's the easiest way to fix them when you have 100's of ports.

Hopefully this information will help to improve the algorithm.

epekkar commented 2 years ago

Fixed in a6e5627961851a415e9f81cf486f8d7b9439bcc5.