fix line ending bug on windows

This commit is contained in:
Fischer Moseley 2023-04-13 19:48:47 -04:00
parent 276069bd79
commit 4d2c3d08e6
1 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,13 @@ class VerilogManipulator:
self.hdl = self.hdl.replace("`timescale 1ns/1ps", "")
self.hdl = self.hdl.strip()
# python tries to be cute and automatically convert
# line endings on Windows, but Manta's source comes
# with (and injects) UNIX line endings, so Python
# ends up adding way too many line breaks, so we just
# undo anything it's done when we load the file
self.hdl = self.hdl.replace("\r\n", "\n")
else:
self.hdl = None