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

Stage3 #5

Merged
merged 119 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
76a52e2
Update lib.rs
AaronKutch Dec 12, 2023
0f18953
swap TNode and LNode names
AaronKutch Dec 12, 2023
5faba83
Update tnode.rs
AaronKutch Dec 12, 2023
e074029
rename `Note` to `RNode`
AaronKutch Dec 12, 2023
838e392
Update lazy_awi.rs
AaronKutch Dec 12, 2023
a9ae122
Begin work on router
AaronKutch Dec 13, 2023
1476da0
more planning
AaronKutch Dec 13, 2023
d675e38
more high level details
AaronKutch Dec 14, 2023
8d296e4
Update channel.rs
AaronKutch Dec 14, 2023
0325282
Update channel.rs
AaronKutch Dec 16, 2023
3fe4e28
Update channel.rs
AaronKutch Dec 17, 2023
7a11ee7
Update channel.rs
AaronKutch Dec 17, 2023
a9dc1a1
add region advancer
AaronKutch Dec 18, 2023
29bf2cf
Update channel.rs
AaronKutch Dec 18, 2023
5789244
need backref system
AaronKutch Dec 18, 2023
456b086
total refactor of `Channel` to use backref system
AaronKutch Dec 19, 2023
7a50884
change `Epoch::ensemble` into function that takes a closure
AaronKutch Dec 21, 2023
5ced87f
clean up `EpochShared`
AaronKutch Dec 23, 2023
03d7f49
clean up `Epoch`
AaronKutch Dec 23, 2023
e8e6d25
clean up `Epoch`
AaronKutch Dec 23, 2023
2d93a2e
Update epoch.rs
AaronKutch Dec 23, 2023
913a71b
many improvements, needs next awint version
AaronKutch Dec 23, 2023
c2bd932
fix pruning
AaronKutch Dec 23, 2023
e5e6462
suspension tests and doc
AaronKutch Dec 23, 2023
6f8ca81
export SuspendedEpoch
AaronKutch Dec 27, 2023
c8f7746
factor out a `Notary` struct
AaronKutch Dec 27, 2023
824fae0
use a UUID `PExternal`
AaronKutch Dec 27, 2023
515e0ba
Add recasting
AaronKutch Dec 27, 2023
34e3f38
introduce `LNodeKind`
AaronKutch Dec 27, 2023
5466a09
working on channeling
AaronKutch Dec 28, 2023
f16846c
introducing `DynamicValue`
AaronKutch Dec 28, 2023
5b01da6
minor fixes
AaronKutch Dec 28, 2023
412e512
fix the lazyness of `RNode` lowering
AaronKutch Dec 29, 2023
4c79d84
rename `prune` to `lower_and_prune`
AaronKutch Dec 29, 2023
5ebd507
fix warnings
AaronKutch Dec 29, 2023
20a8cf0
Update stats.rs
AaronKutch Dec 29, 2023
d17a71c
Update stats.rs
AaronKutch Dec 29, 2023
06b1dc9
optimize LUTs in the state phase
AaronKutch Dec 30, 2023
2c72d1e
more optimization
AaronKutch Dec 30, 2023
de131cf
use `debug_` in most places
AaronKutch Dec 30, 2023
fb991b0
optimize lut reduction
AaronKutch Dec 30, 2023
30fc162
improve signatures
AaronKutch Dec 30, 2023
036aa43
optimize independence detection
AaronKutch Dec 30, 2023
cc43cc3
working on dynamic LUTs
AaronKutch Dec 30, 2023
f4da755
fix `StarRng`
AaronKutch Dec 30, 2023
38549eb
add primitive variations of `retro_` and `eval`
AaronKutch Dec 31, 2023
c743457
add better LUT tests
AaronKutch Jan 1, 2024
b906f6e
better lazy inits
AaronKutch Jan 1, 2024
d5231db
`all_variations` test
AaronKutch Jan 1, 2024
7872694
prepare for actual Dynamic LUTs
AaronKutch Jan 1, 2024
915712c
fix fixme
AaronKutch Jan 1, 2024
8886900
first dynamic LUT optimizations
AaronKutch Jan 2, 2024
6482cdc
improvements
AaronKutch Jan 2, 2024
c886a1b
fixes
AaronKutch Jan 2, 2024
d711f1f
more fixes
AaronKutch Jan 2, 2024
3ec1ad5
get tests working again
AaronKutch Jan 2, 2024
1e2f9db
add missing test
AaronKutch Jan 2, 2024
4d4b71b
begin enabling more
AaronKutch Jan 3, 2024
823f572
general multiplexing
AaronKutch Jan 3, 2024
3e3aa4c
Update stats.rs
AaronKutch Jan 3, 2024
36fe34b
Update meta.rs
AaronKutch Jan 3, 2024
f86dc30
working on more efficient shifting
AaronKutch Jan 3, 2024
5515c06
Update temporal.rs
AaronKutch Jan 4, 2024
0d493c5
fixes
AaronKutch Jan 4, 2024
2d238e2
fixes
AaronKutch Jan 4, 2024
415a35e
Update temporal.rs
AaronKutch Jan 4, 2024
a0d179f
Update temporal.rs
AaronKutch Jan 4, 2024
7cf4a35
Update lower_op.rs
AaronKutch Jan 4, 2024
53e2e76
updates
AaronKutch Jan 4, 2024
672782c
misc improvements
AaronKutch Jan 4, 2024
8ef318f
Update meta.rs
AaronKutch Jan 4, 2024
55b0638
fix bug in evaluation
AaronKutch Jan 4, 2024
9e721c5
improve shl_
AaronKutch Jan 4, 2024
5b23ce3
Update meta.rs
AaronKutch Jan 4, 2024
84282be
update lshr
AaronKutch Jan 4, 2024
d5134b2
update ashr
AaronKutch Jan 4, 2024
228c7bc
implement remaining rotations
AaronKutch Jan 4, 2024
8e7faa0
prepare
AaronKutch Jan 4, 2024
daa6a42
tmp
AaronKutch Jan 5, 2024
ccaaf89
Update meta.rs
AaronKutch Jan 5, 2024
b00ff3f
Update meta.rs
AaronKutch Jan 5, 2024
8db187f
finally get rid of old crossbar system
AaronKutch Jan 5, 2024
bdd473c
remove old `static_field`
AaronKutch Jan 5, 2024
02bdbc7
Update fuzz_lower.rs
AaronKutch Jan 5, 2024
5b19ba7
renaming
AaronKutch Jan 5, 2024
08321d3
enhancing the fuzzing
AaronKutch Jan 5, 2024
64c83f4
Update fuzz_lower.rs
AaronKutch Jan 5, 2024
6ca7617
Update fuzz_lower.rs
AaronKutch Jan 5, 2024
202a507
Update fuzz_lower.rs
AaronKutch Jan 5, 2024
abdd8b0
improve dynamic eval
AaronKutch Jan 5, 2024
c294703
Update fuzz_elementary.rs
AaronKutch Jan 5, 2024
15571cc
finish improving the fuzzers
AaronKutch Jan 6, 2024
7845192
more ideas
AaronKutch Jan 6, 2024
9a46ca2
introduce `ConstUnknown`
AaronKutch Jan 8, 2024
cd5c71d
begin working on routing again
AaronKutch Jan 9, 2024
ff89b8e
router configuration
AaronKutch Jan 10, 2024
f3f03f2
migrate `EvalError` to `starlight`
AaronKutch Jan 10, 2024
16fb6b3
remove outdated errors
AaronKutch Jan 10, 2024
f7a32d3
rename `EvalError` to `Error`
AaronKutch Jan 10, 2024
f17fb72
fix bugs
AaronKutch Jan 10, 2024
e20c494
improve `RNode` publicity
AaronKutch Jan 10, 2024
b31c6ee
improve debuggability
AaronKutch Jan 10, 2024
5dccd9f
begin generating hierarchy
AaronKutch Jan 11, 2024
68c04f8
Add `RangeOr, RangeAnd, RangeXor`, and `repeat_`
AaronKutch Jan 13, 2024
be602a2
lookup table input rotation
AaronKutch Jan 13, 2024
0ca1195
more defining
AaronKutch Jan 16, 2024
20074ec
tmp
AaronKutch Jan 17, 2024
d9809a4
complete initial concentration ideas
AaronKutch Jan 17, 2024
649dab8
fix bugs
AaronKutch Jan 17, 2024
d36a928
do not make `CNode`s for the configurables
AaronKutch Jan 17, 2024
e85b241
Update debug.rs
AaronKutch Jan 17, 2024
c281063
fix bugs
AaronKutch Jan 18, 2024
04b73ef
avoid unnecessary assertions
AaronKutch Jan 18, 2024
46c0694
fix bug
AaronKutch Jan 18, 2024
49c4c11
debug improvements
AaronKutch Jan 18, 2024
347c55d
Update cnode.rs
AaronKutch Jan 18, 2024
0d1fb2d
fix assertion registration
AaronKutch Jan 18, 2024
db7911a
use `awint` 0.16
AaronKutch Jan 23, 2024
2865c6a
Version 0.3.0
AaronKutch Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [0.3.0] - TODO
### Fixes
- Fixed a off-by-one issue with `StarRng::out_of_*`

### Changes
- merged `Epoch::assert_assertions` and `Epoch::assert_assertions_strict`
- many fixes for `Epoch` behavior
- `LNode`s now have a `LNodeKind`
- `StarRng::index` was renamed to `index_slice`, and a `index_slice_mut` and new `index` function
were added
- Redid the error system

### Additions
- Added `Epoch::suspend`
- Optimization now compresses allocations
- Added many primitive versions of `retro_` and `eval` functions

## [0.2.0] - 2023-12-08
### Crate
- `awint` 0.15
Expand Down
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Starlight

This is a RTL (Register Transfer Level) description library. Instead of the
typical DSL (Domain Specific Language) approach, this allows RTL
This is a DSL (Domain Specific Language) that can describe combinational
logic and temporal logic. This allows RTL (Register Transfer Level)
descriptions in ordinary Rust code with all the features that Rust provides.

This crate is still a WIP, but it currently can describe most combinational
logic. The temporal structs (`Loop` and `Net`) need more development before
they will work properly. Many optimizations are planned in the near future.
This crate still has a considerable amount of WIP stuff needed to evolve
into a proper HDL (Hardware Description Language).

See the documentation of `awint`/`awint_dag` which is used as the backend
for this.
for this. `awint` is the base library that operations are modeled off of.
`awint_dag` allows for recording a DAG of arbitrary bitwidth integer
operations. `starlight` lowers high level operations down into a DAG of
simple lookup tables, and also adds on temporal structs like `Loop`s. It can
optimize, evaluate, and retroactively change values in the `DAG` for various
purposes.

```
use std::num::NonZeroUsize;
Expand Down Expand Up @@ -56,7 +60,7 @@
// First, create an epoch, this will live until this struct is dropped. The
// epoch needs to live until all mimicking operations are done and states are
// lowered. Manually drop it with the `drop` function to avoid mistakes.
let epoch0 = Epoch::new();
let epoch = Epoch::new();

let mut m = StateMachine::new(bw(4));

Expand All @@ -81,45 +85,46 @@
use awi::*;

// discard all unused mimicking states so the render is cleaner
epoch0.prune().unwrap();
epoch.prune_unused_states().unwrap();

// See the mimicking state DAG before it is lowered
epoch0
epoch
.render_to_svgs_in_dir(std::path::PathBuf::from("./".to_owned()))
.unwrap();

// lower into purely static bit movements and lookup tables.
epoch0.lower().unwrap();
epoch0.optimize().unwrap();
// lower into purely static bit movements and lookup tables and optimize
epoch.optimize().unwrap();

// Now the combinational logic is described in a DAG of lookup tables that we
// could use for various purposes
for state in epoch0.ensemble().stator.states.vals() {
awi::assert!(state.lowered_to_tnodes);
}
epoch.ensemble(|ensemble| {
for state in ensemble.stator.states.vals() {
awi::assert!(state.lowered_to_lnodes);
}
});

// "retroactively" assign the input with a non-opaque value
input.retro_(&awi!(0101)).unwrap();
// check assertions (all `dag::assert*` functions and dynamic `unwrap`s done
// during the current `Epoch`)
epoch0.assert_assertions_strict().unwrap();
epoch.assert_assertions(true).unwrap();
// evaluate the outputs
awi::assert_eq!(output_counter.eval().unwrap(), awi!(0011));
awi::assert_eq!(output_data.eval().unwrap(), awi!(0xa505_u16));

// reassign and reevaluate
input.retro_(&awi!(1011)).unwrap();
awi::assert!(epoch0.assert_assertions().is_err());
awi::assert!(epoch.assert_assertions(true).is_err());
awi::assert_eq!(output_data.eval().unwrap(), awi!(0x7b0b_u16));
}
drop(epoch0);
drop(epoch);
```

```
use starlight::{dag, awi, Epoch, EvalAwi};
use dag::*;

let epoch0 = Epoch::new();
let epoch = Epoch::new();

let mut lhs = inlawi!(zero: ..8);
let rhs = inlawi!(umax: ..8);
Expand Down Expand Up @@ -155,4 +160,5 @@
use awi::*;
awi::assert_eq!(output_eval.eval().unwrap(), awi!(01010101));
}
drop(epoch0);
drop(epoch);
```
6 changes: 4 additions & 2 deletions starlight/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starlight"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
authors = ["Aaron Kutch <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand All @@ -13,8 +13,10 @@ categories = ["algorithms"]

[dependencies]
#awint = { path = "../../awint/awint", default-features = false, features = ["rand_support", "dag"] }
awint = { version = "0.15", default-features = false, features = ["rand_support", "dag"] }
awint = { version = "0.16", default-features = false, features = ["rand_support", "dag"] }
rand = { version = "0.8", default-features = false, features = ["std", "std_rng"] }
rand_xoshiro = { version = "0.6", default-features = false }
thiserror = "1.0"

[features]
# note: "dag", "rand_support", and "std" are all turned on always
Expand Down
2 changes: 1 addition & 1 deletion starlight/src/awi_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod eval_awi;
mod lazy_awi;
mod temporal;

pub use epoch::{Assertions, Epoch};
pub use epoch::{Assertions, Epoch, SuspendedEpoch};
pub use eval_awi::EvalAwi;
pub use lazy_awi::{LazyAwi, LazyInlAwi};
pub use temporal::{Loop, Net};
Loading
Loading