KIWI Length Matching plugin works for you?

Hey there, looking for a way to make lenght matching for nets that isn`t a differential pair, I found this plugin GitHub - OneKiwiTech/kicad-length-matching: Track Length Calculator that have been discussed here KIWI Length Matching plugin - #4 by BlackCoffee

I liked and wanna give a try, but I have this problem when I run it

--- Logging error ---
Traceback (most recent call last):
  File "C:\Program Files\KiCad\8.0\bin\Lib\logging\__init__.py", line 1113, in emit
    stream.write(msg + self.terminator)
    ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
  File "C:\Users\jairo\Documents\KiCad\8.0\3rdparty\plugins\vn_onekiwi_track-distance\onekiwi\plugin.py", line 16, in Run
    controller = Controller(board)
  File "C:\Users\jairo\Documents\KiCad\8.0\3rdparty\plugins\vn_onekiwi_track-distance\onekiwi\controller\controller.py", line 39, in __init__
    self.logger.info('init done')
Message: 'init done'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "C:\Program Files\KiCad\8.0\bin\Lib\logging\__init__.py", line 1113, in emit
    stream.write(msg + self.terminator)
    ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
  File "C:\Users\jairo\Documents\KiCad\8.0\3rdparty\plugins\vn_onekiwi_track-distance\onekiwi\plugin.py", line 16, in Run
    controller = Controller(board)
  File "C:\Users\jairo\Documents\KiCad\8.0\3rdparty\plugins\vn_onekiwi_track-distance\onekiwi\controller\controller.py", line 39, in __init__
    self.logger.info('init done')
Message: 'init done'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "C:\Program Files\KiCad\8.0\bin\Lib\logging\__init__.py", line 1113, in emit
    stream.write(msg + self.terminator)
    ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
  File "C:\Users\jairo\Documents\KiCad\8.0\3rdparty\plugins\vn_onekiwi_track-distance\onekiwi\plugin.py", line 16, in Run
    controller = Controller(board)
  File "C:\Users\jairo\Documents\KiCad\8.0\3rdparty\plugins\vn_onekiwi_track-distance\onekiwi\controller\controller.py", line 39, in __init__
    self.logger.info('init done')
Message: 'init done'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "C:\Program Files\KiCad\8.0\bin\Lib\logging\__init__.py", line 1113, in emit
    stream.write(msg + self.terminator)
    ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'write'
Call stack:
  File "C:\Users\jairo\Documents\KiCad\8.0\3rdparty\plugins\vn_onekiwi_track-distance\onekiwi\plugin.py", line 16, in Run
    controller = Controller(board)
  File "C:\Users\jairo\Documents\KiCad\8.0\3rdparty\plugins\vn_onekiwi_track-distance\onekiwi\controller\controller.py", line 39, in __init__
    self.logger.info('init done')
Message: 'init done'
Arguments: ()
01-03 12:33:48 vn_onekiwi_track-distance.onekiwi.controller.controller 39:init done
2025.01.03 12:33:48 - INFO - __init__ -  init done
2025.01.03 12:33:48 - INFO - __init__ -  init done
2025.01.03 12:33:48 - INFO - __init__ -  init done

I need fix something on code?, I need install it by other way that isnā€™t says on github repo?, I donā€™t know, if anyone can run it well, please tell me.

thanks a lot

You can implement length matching across nets with DRC rules. Whatā€™s your use-case? We can help with writing the rules. (Share a board if you canā€¦). Also, let us know which version youā€™re running - I added some stuff to make this easier in v9, which is currently in pre-release testing.

Iā€™m running version Kicad 8.0.4, and my case is in a eMMC layout

(Iā€™m still working on it)

And I wanna apply length match on data traces . Always that I applied that, have been on diferential pairs, that is automatic by correct naming, but I donā€™t know how apply it in this cases where tracks doesnā€™t has determinated pattern on it.

Because, I can do that measuring the length of largest and then with ā€œtune length of a single trackā€ adjust there introducing that distance to match, but for another larger projects appears to will take too much time

Ah, so having just looked at this, the changes that make this really easy (or indeed possible in the first place) come in v9. Out in the next couple of months!

1 Like

Uuu thatā€™s great, Iā€™ll wait for it :partying_face:

In looking at the right syntax, Iā€™ve also found some new bugs in it since I implemented that functionality. Iā€™ll get them fixed! But the general idea is that you can:

  1. Put a schematic rule area over all your data lines, with a netclass directive label giving all those nets a common netclass (called something like ā€˜DATAā€™, or whatever)
  2. Sync the schematic with pcbnew.
  3. Define a new Custom Rule in the pcb editor settings, something like:
(version 1)
(rule DATA_LENGTH
	(condition "A.hasNetclass('DATA')")
	(constraint skew (min 0mm) (max 1mm) )
)
  1. Then use the skew tuning tool to tune the length of the shorter tracks.

But this wonā€™t work currently in the nightly build of v9 because somethingā€™s broken. Iā€™m on itā€¦

2 Likes

Sounds great Dude, keep going :fist_right:t3::fist_left:t3:, Iā€™ll wait :ok_hand:t3:

OK, so you can do this in v8. Hereā€™s the recipe:

  1. In eeschema, define a new netclass (called, e.g. ā€˜DATAā€™). The default values are fine.

  1. Add a netclass directive label to each of your nets you want to be tuned, with the netclass set to the name from 1.

  1. Save, and syncronise to pcbnew
  2. Route the longest trace from the set of tracks, measure the trace (select it and look at the status bar)
  3. Define a custom DRC rule (replace 19mm with the longest track length)
(version 1)
(rule DATA_LENGTH
	(condition "A.NetClass=='DATA'")
	(constraint length (opt 19mm))
)

  1. Use the ā€˜Tune length of a single trackā€™ tool on each shorter trace

Not quite as simple as the skew version Iā€™d like to get working for v9, but it works well when youā€™ve routed the longest track. The exact same method works in v9, except you donā€™t need to define the netclass (you can just use it straight from a definition); you can use a rule area on the schematic to assign the netclass to all nets at once; and the rule condition changes to (condition "A.hasNetclass('DATA')").

1 Like

Ok, Iā€™ll do that, thanks a lot for your help :+1:t3: