[Libre-soc-bugs] [Bug 50] nmigen pinmux

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Dec 10 23:22:23 GMT 2021


https://bugs.libre-soc.org/show_bug.cgi?id=50

--- Comment #77 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Andrey Miroshnikov from comment #76)

> JTAG has the ios signals as public, however I did not see those signals
> being brought out to Blinker's public ports.

no, and you shouldn't be trying to access them publicly, only via the
public API which is JTAG TDI/TDO.

> Since the JTAG mechanism is working by using TDI however, I'll leave the
> deeper understanding till later.

sensible.  it'll emerge, over time.

> I'm honestly amazed how deceptively simple it is. Again I was
> overcomplicating.

it's easy to do.  this *has* to be simple, because the entire ASIC is
critically dependent on this.

> Just one command!
> 
> Also, for the BS_SAMPLE parameter (address), I set it to be 0. Is this meant
> to be anything else?

see how these match up?

https://git.libre-soc.org/?p=c4m-jtag.git;a=blob;f=c4m/nmigen/jtag/tap.py;h=1f3d424cbd7451c0434e0c71168f5aa0935af860;hb=c2bf4810f9f91ced7fcda777b92b86ab353da288#l357

 356         # TODO: Make commands numbers configurable
 357         cmd_extest = 0
 358         cmd_intest = 0
 359         cmd_idcode = 1
 360         cmd_sample = 2
 361         cmd_preload = 2
 362         cmd_bypass = 2**ir_width - 1 # All ones

https://git.libre-soc.org/?p=pinmux.git;a=blob;f=src/spec/test_jtag_tap_srv.py;h=1ecbd3bad496e29cd29dc7cd19aab71dea2471e0;hb=823c97d150034ced5e10ceaf36d54eb626c642f7#l42

  42 # JTAG boundary scan reg addresses
  43 BS_EXTEST = 0
  44 BS_INTEST = 0
  45 BS_SAMPLE = 2
  46 BS_PRELOAD = 2

generally, having magic constants for addresses is frowned on.

ok, a *Software Engineer* looks on magic constants with either horror
or irritation. sometimes amusement.

> After trying jtag_read_write_reg() with a few test bitstream, I was able to
> alter the states of the signals normally controlled by the core.

awwwesome.  quite an amazing feeling, isn't it?

> For this I want to use the ios dict, as it will allow to easily decode the
> JTAG output bistream (e.g. uart rx pin corresponds to bit0 of the shift
> register and bit19 of the output word).

do make sure to use the names because i've realised over the past couple
of days that create_resources() has to merge with create_pinouts().
long story, will explain on IRC.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list