diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-08-27 07:45:15 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-09-06 15:47:50 +0200 |
| commit | e1b830309d86f6b1fff803ed94f34ce7002eb532 (patch) | |
| tree | e21794a14e8b7e7fabbab6e6e0e5051aa710e69f /lib | |
| parent | aa89b4c22f12e9e6ebf18eba371c567ac5cd5c9b (diff) | |
| download | tools.nes-e1b830309d86f6b1fff803ed94f34ce7002eb532.tar.gz tools.nes-e1b830309d86f6b1fff803ed94f34ce7002eb532.zip | |
vnf: implement the randomized initialization for memory
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/vnf/Cargo.toml | 1 | ||||
| -rw-r--r-- | lib/vnf/src/lib.rs | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/vnf/Cargo.toml b/lib/vnf/Cargo.toml index 66bed81..e119a27 100644 --- a/lib/vnf/Cargo.toml +++ b/lib/vnf/Cargo.toml @@ -8,3 +8,4 @@ authors.workspace = true [dependencies] header.workspace = true xixanta.workspace = true +rand = "0.10" diff --git a/lib/vnf/src/lib.rs b/lib/vnf/src/lib.rs index dc314bd..7fbe264 100644 --- a/lib/vnf/src/lib.rs +++ b/lib/vnf/src/lib.rs @@ -307,7 +307,7 @@ fn init_memory(policy: &MemoryPolicy) -> Vec<MemoryCell> { vec.push(MemoryCell { value: match policy.initial_value { MemoryInitialValue::Fixed(n) => n, - MemoryInitialValue::Random => todo!(), + MemoryInitialValue::Random => rand::random(), }, write_allowed, read_allowed, @@ -369,7 +369,6 @@ impl Machine { } } - // TODO: allow for randomized initialization. Ok(Self { active: true, run_function_mode: false, |
