Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional backend #4401

Closed
wants to merge 51 commits into from
Closed

Functional backend #4401

wants to merge 51 commits into from

Conversation

RCoeurjoly
Copy link
Contributor

This is a Work In Progress PR to track progress towards a functional backend.

@RCoeurjoly RCoeurjoly marked this pull request as draft May 16, 2024 11:02
@whitequark
Copy link
Member

What's a functional backend?

@whitequark
Copy link
Member

Wait, are you... duplicating all the work that went into CXXRTL, for some reason?

@RCoeurjoly RCoeurjoly changed the title Functional Functional backend May 23, 2024
@RCoeurjoly RCoeurjoly force-pushed the functional branch 3 times, most recently from eb5a97b to 7ce8ec2 Compare May 24, 2024 10:25
jix and others added 13 commits May 24, 2024 13:06
This adds a generic non-recursive implementation of Tarjan's linear time
SCC algorithm that produces components in topological order. It can be
instantiated to work directly on any graph representation for which the
enumerate_nodes and enumerate_successors interface can be implemented.
When implementing custom log_... functions or custom overloads for the
core log functions like log_signal it is necessary to return `char *`
that are valid long enough.

The log_... functions implemented in log.cc use either `log_id_cache` or
`string_buf` which both are cleared on log_pop.

This commit adds a public `log_str` function which stores its argument
in the `log_id_cache` and returns the stored copy, such that custom
log functions outside of log.cc can also create strings that remain
valid until the next `log_pop`.
This is already supported by `SigSpec` and since both `SigChunk` and
`SigSpec` implement `extract` which is the multi-bit variant of this,
there is no good reason for `SigChunk` to not support
`SigBit operator[](int offset)`.
It adds `DriveBit`, `DriveChunk` and `DriveSpec` types which are similar
to `SigBit`, `SigChunk` and `SigSpec` but can also directly represent
cell ports, undriven bits and multiple drivers. For indexing an RTLIL
module and for querying signal drivers it comes with a `DriverMap` type
which is somewhat similar to a `SigMap` but is guaranteed to produce
signal drivers as returned representatives.

A `DriverMap` can also optionally preserve connections via intermediate
wires (e.g. querying the driver of a cell input port will return a
connected intermediate wire, querying the driver of that wire will
return the cell output port that's driving the wire).
@RCoeurjoly RCoeurjoly force-pushed the functional branch 3 times, most recently from c6dddac to 7d07bb3 Compare May 27, 2024 13:43
@RCoeurjoly RCoeurjoly closed this Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants