87 produce = esi.ChannelService.from_host(AppID(
"produce"), UInt(32))
88 count, count_valid = produce.unwrap(Bits(1)(1))
89 target = count.reg(ports.clk, ports.rst, ce=count_valid, name=
"target")
92 sent = Counter(32)(clk=ports.clk,
96 valid = sent.out < target
97 stream, stream_ready = Channel(Bits(0)).
wrap(Bits(0)(0), valid)
98 xact.assign(valid & stream_ready)
99 esi.ChannelService.to_host(AppID(
"stream"), stream)
101 query = esi.ChannelService.from_host(AppID(
"query"), UInt(8))
102 query_ready = Wire(Bits(1))
103 _, query_valid = query.unwrap(query_ready)
104 resp, resp_ready = Channel(UInt(32)).
wrap(sent.out, query_valid)
105 query_ready.assign(resp_ready)
106 esi.ChannelService.to_host(AppID(
"sent"), resp)