efabless / caravel-gf180mcu

This repository is the GF180MCU port of Caravel. For more information about Caravel, see the original repo at https://github.com/efabless/caravel.
Apache License 2.0
7 stars 8 forks source link

gfmpw-1 bidirectional constants not correct. input is disabled. #193

Open d-m-bailey opened 8 months ago

d-m-bailey commented 8 months ago

input is disabled.

GPIO_MODE_MGMT_STD_BIDIRECTIONAL should be 0x005 or 0x00d
GPIO_MODE_USER_STD_BIDIRECTIONAL should be 0x004 or 0x00c (with OE_OVERRIDE low, OUTPUT_enable is irrelevant.)

gf180-gpio-defines
RTimothyEdwards commented 7 months ago

output enable is not used when oe_override is not set, so it is clear that the 3rd bit should have been set and not the 4th bit:

#define GPIO_MODE_MGMT_STD_BIDIRECTIONAL 0x005
#define GPIO_MODE_USER_STD_BIDIRECTIONAL 0x004
d-m-bailey commented 7 months ago

@RTimothyEdwards I only added the INPUT_ENABLE bit. I did not change the OUTPUT_ENABLE bit. My understanding was that OUTPUT_ENABLE was irrelevant.

#define GPIO_MODE_MGMT_STD_BIDIRECTIONAL 0x00d
#define GPIO_MODE_USER_STD_BIDIRECTIONAL 0x00c

Is this a problem?

RTimothyEdwards commented 7 months ago

@d-m-bailey : Not a real problem, no, but maybe confusing to the end-user. I interpreted the original problem as just being an accidental bit shift, so fixed it accordingly. But what we really need is just to have a truth table somewhere to properly document the function, presumably in comment lines in the defs.h file:

OE  OE_override  function
--------------------------------------------------------------------------------------------------------
0     1                     output (forced) disabled
1     1                     output (forced) enabled
X     0                     output determined by OE input, not OE configuration bit