Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ad7796864914
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 77812e0ecfc8
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 21, 2020

  1. Copy the full SHA
    39ec83c View commit details
  2. cli: fix intermittent analyzer error.

    Due to a logic error, sometimes analyzer would crash with a message
    similar to:
    
        vcd.writer.VCDPhaseError: Out of order timestamp: 171587604
    whitequark committed Jul 21, 2020
    Copy the full SHA
    77812e0 View commit details
Showing with 13 additions and 7 deletions.
  1. +9 −3 examples/boilerplate.py
  2. +4 −4 software/glasgow/cli.py
12 changes: 9 additions & 3 deletions examples/boilerplate.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import logging
import asyncio
from nmigen.compat import *
from nmigen import *

from ... import *


class BoilerplateSubtarget(Module):
class BoilerplateSubtarget(Elaboratable):
def __init__(self, pads, in_fifo, out_fifo):
pass
self.pads = pads
self.in_fifo = in_fifo
self.out_fifo = out_fifo

def elaborate(self, platform):
m = Module()
return m


class BoilerplateApplet(GlasgowApplet, name="boilerplate"):
8 changes: 4 additions & 4 deletions software/glasgow/cli.py
Original file line number Diff line number Diff line change
@@ -536,15 +536,15 @@ async def run_analyzer():

for name in signals:
vcd_writer.change(signals[name], next_timestamp, "x")
timestamp += 1e3 # 1us
next_timestamp += 1000 # 1us
break

event_repr = " ".join("{}={}".format(n, v)
for n, v in events.items())
target.analyzer.logger.trace("cycle %d: %s", cycle, event_repr)

timestamp = 1e9 * (cycle + 0) // target.sys_clk_freq
next_timestamp = 1e9 * (cycle + 1) // target.sys_clk_freq
timestamp = int(1e9 * (cycle + 0) // target.sys_clk_freq)
next_timestamp = int(1e9 * (cycle + 1) // target.sys_clk_freq)
if init:
init = False
vcd_writer._timestamp = timestamp
@@ -555,7 +555,7 @@ async def run_analyzer():
vcd_writer.change(signals[name], next_timestamp, "z")
vcd_writer.flush()

vcd_writer.close(timestamp)
vcd_writer.close(next_timestamp)

async def run_applet():
logger.info("running handler for applet %r", args.applet)