-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2d5e7f
commit fae65f1
Showing
12 changed files
with
241 additions
and
165 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,16 @@ authors = ["Leonardo Riether <[email protected]>"] | |
edition = "2021" | ||
description = "Fast Pretty Good RISC-V Assembly Rendering System" | ||
license = "MIT" | ||
exclude = ["site/", "tests/riscv-tests/", "samples/"] | ||
exclude = ["site/", "tests/riscv-tests/"] | ||
repository = "https://github.com/LeoRiether/FPGRARS/" | ||
|
||
[lib] | ||
bench = false | ||
|
||
[[bin]] | ||
name = "fpgrars" | ||
path = "src/main.rs" | ||
bench = false | ||
|
||
[features] | ||
show_ms = [] # show ms per frame in the window title | ||
|
@@ -43,10 +50,16 @@ thiserror = "1.0.40" | |
owo-colors = "3.5.0" | ||
serde = { version = "1.0.171", features = ["derive"] } | ||
toml = "0.7.6" | ||
criterion = "0.5.1" | ||
ahash = "0.8.11" | ||
|
||
[dependencies.clap] | ||
version = "4.3" | ||
version = "4.5" | ||
features = ["suggestions", "color", "wrap_help", "cargo", "derive"] | ||
|
||
[dev-dependencies] | ||
criterion = { version = "0.3", features = ["html_reports"] } | ||
|
||
[[bench]] | ||
name = "simulator" | ||
harness = false | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use fpgrars::simulator::{self, Simulator}; | ||
|
||
const TESTCASES: &[&str] = &["add.s", "memory.s", "memory2.s", "sort.s", "video.s"]; | ||
|
||
fn criterion_benchmark(c: &mut Criterion) { | ||
for testcase in TESTCASES { | ||
c.bench_function(testcase, |b| { | ||
let memory = simulator::memory::Memory::new(); | ||
let mut simulator = Simulator::default().with_memory(memory); | ||
simulator | ||
.load_file(&format!("./benches/samples/{testcase}")) | ||
.unwrap_or_else(|e| panic!("Couldn't parse {testcase}: {e}")); | ||
|
||
b.iter(|| simulator.run()) | ||
}); | ||
} | ||
} | ||
|
||
criterion_group!(benches, criterion_benchmark); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters