performance improvements

This commit is contained in:
2020-10-07 23:40:00 +02:00
parent a3eae0a8a9
commit e3fe3c6d72
18 changed files with 151 additions and 90 deletions
+7 -7
View File
@@ -2,7 +2,7 @@
extern crate log;
use std::collections::HashMap;
use std::sync::Arc;
use std::time::Duration;
use clappconfig::{AppConfig, clap};
@@ -10,7 +10,7 @@ use clappconfig::clap::ArgMatches;
use serde::{Deserialize, Serialize};
use crsn::asm::data::literal::Addr;
use crsn::module::OpTrait;
use crsn::module::{OpTrait, CrsnUniq};
use crsn::runtime::run_thread::{RunThread, ThreadToken, ThreadParams};
use crsn_arith::ArithOps;
use crsn_screen::ScreenOps;
@@ -121,13 +121,13 @@ fn main() -> anyhow::Result<()> {
let source = read_file::read_file(&config.program_file)?;
let parsers = Arc::new(vec![
let uniq = CrsnUniq::new();
let parsed = crsn::asm::assemble(&source, &uniq, vec![
ArithOps::new(),
StackOps::new(),
ScreenOps::new(),
]);
let parsed = crsn::asm::assemble(&source, parsers)?;
])?;
if config.asm_only {
for (n, op) in parsed.ops.iter().enumerate() {
@@ -147,7 +147,7 @@ fn main() -> anyhow::Result<()> {
let args = &[];
let thread = RunThread::new(ThreadParams {
id: ThreadToken(0),
uniq: None,
uniq,
program: parsed,
pc: Addr(0),
cycle_time: config.cycle_time,