forked from libre-chip/cpu
		
	format code
This commit is contained in:
		
							parent
							
								
									b969249f5f
								
							
						
					
					
						commit
						00ddd602c5
					
				
					 7 changed files with 20 additions and 23 deletions
				
			
		|  | @ -1,10 +1,10 @@ | ||||||
| // SPDX-License-Identifier: LGPL-3.0-or-later
 | // SPDX-License-Identifier: LGPL-3.0-or-later
 | ||||||
| // See Notices.txt for copyright information
 | // See Notices.txt for copyright information
 | ||||||
| use crate::{ | use crate::{ | ||||||
|     instruction::{MOpTrait, PRegNum, RenamedMOp, UnitNum, UnitOutRegNum, CONST_ZERO_UNIT_NUM}, |     instruction::{CONST_ZERO_UNIT_NUM, MOpTrait, PRegNum, RenamedMOp, UnitNum, UnitOutRegNum}, | ||||||
|     unit::{ |     unit::{ | ||||||
|         unit_base::{UnitForwardingInfo, UnitToRegAlloc}, |  | ||||||
|         UnitCancelInput, UnitKind, UnitOutputWrite, |         UnitCancelInput, UnitKind, UnitOutputWrite, | ||||||
|  |         unit_base::{UnitForwardingInfo, UnitToRegAlloc}, | ||||||
|     }, |     }, | ||||||
| }; | }; | ||||||
| use fayalite::prelude::*; | use fayalite::prelude::*; | ||||||
|  |  | ||||||
|  | @ -25,10 +25,7 @@ impl<T: MOpTrait> MOpInto<T> for T { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| pub trait MOpTrait: Type { | pub trait MOpTrait: Type { | ||||||
|     type Mapped<NewDestReg: Type, NewSrcRegWidth: Size>: MOpTrait< |     type Mapped<NewDestReg: Type, NewSrcRegWidth: Size>: MOpTrait<DestReg = NewDestReg, SrcRegWidth = NewSrcRegWidth>; | ||||||
|         DestReg = NewDestReg, |  | ||||||
|         SrcRegWidth = NewSrcRegWidth, |  | ||||||
|     >; |  | ||||||
|     type DestReg: Type; |     type DestReg: Type; | ||||||
|     type SrcRegWidth: Size; |     type SrcRegWidth: Size; | ||||||
|     fn dest_reg_ty(self) -> Self::DestReg; |     fn dest_reg_ty(self) -> Self::DestReg; | ||||||
|  |  | ||||||
|  | @ -3,18 +3,18 @@ | ||||||
| use crate::{ | use crate::{ | ||||||
|     config::CpuConfig, |     config::CpuConfig, | ||||||
|     instruction::{ |     instruction::{ | ||||||
|         MOp, MOpDestReg, MOpRegNum, MOpTrait, MoveRegMOp, PRegNum, RenameTableName, UnitOutRegNum, |         COMMON_MOP_SRC_LEN, MOp, MOpDestReg, MOpRegNum, MOpTrait, MoveRegMOp, PRegNum, | ||||||
|         COMMON_MOP_SRC_LEN, |         RenameTableName, UnitOutRegNum, | ||||||
|     }, |     }, | ||||||
|     unit::{ |     unit::{ | ||||||
|         unit_base::{UnitForwardingInfo, UnitInput}, |  | ||||||
|         GlobalState, TrapData, UnitMOp, UnitOutput, UnitOutputWrite, UnitResult, |         GlobalState, TrapData, UnitMOp, UnitOutput, UnitOutputWrite, UnitResult, | ||||||
|         UnitResultCompleted, UnitTrait, |         UnitResultCompleted, UnitTrait, | ||||||
|  |         unit_base::{UnitForwardingInfo, UnitInput}, | ||||||
|     }, |     }, | ||||||
|     util::tree_reduce::tree_reduce_with_state, |     util::tree_reduce::tree_reduce_with_state, | ||||||
| }; | }; | ||||||
| use fayalite::{ | use fayalite::{ | ||||||
|     memory::{splat_mask, WriteStruct}, |     memory::{WriteStruct, splat_mask}, | ||||||
|     module::{instance_with_loc, memory_with_loc, wire_with_loc}, |     module::{instance_with_loc, memory_with_loc, wire_with_loc}, | ||||||
|     prelude::*, |     prelude::*, | ||||||
|     util::ready_valid::ReadyValid, |     util::ready_valid::ReadyValid, | ||||||
|  |  | ||||||
|  | @ -4,8 +4,8 @@ | ||||||
| use crate::{ | use crate::{ | ||||||
|     config::CpuConfig, |     config::CpuConfig, | ||||||
|     instruction::{ |     instruction::{ | ||||||
|         mop_enum, AluBranchMOp, LoadStoreMOp, MOp, MOpDestReg, MOpInto, MOpRegNum, MOpTrait, |         AluBranchMOp, LoadStoreMOp, MOp, MOpDestReg, MOpInto, MOpRegNum, MOpTrait, RenamedMOp, | ||||||
|         RenamedMOp, UnitOutRegNum, |         UnitOutRegNum, mop_enum, | ||||||
|     }, |     }, | ||||||
|     register::{FlagsMode, PRegValue}, |     register::{FlagsMode, PRegValue}, | ||||||
|     unit::unit_base::UnitToRegAlloc, |     unit::unit_base::UnitToRegAlloc, | ||||||
|  |  | ||||||
|  | @ -4,14 +4,14 @@ | ||||||
| use crate::{ | use crate::{ | ||||||
|     config::CpuConfig, |     config::CpuConfig, | ||||||
|     instruction::{ |     instruction::{ | ||||||
|         AddSubMOp, AluBranchMOp, AluCommonMOp, CommonMOp, LogicalMOp, MOpTrait, OutputIntegerMode, |         AddSubMOp, AluBranchMOp, AluCommonMOp, COMMON_MOP_SRC_LEN, CommonMOp, LogicalMOp, MOpTrait, | ||||||
|         RenamedMOp, UnitOutRegNum, COMMON_MOP_SRC_LEN, |         OutputIntegerMode, RenamedMOp, UnitOutRegNum, | ||||||
|     }, |     }, | ||||||
|     register::{FlagsMode, PRegFlagsPowerISA, PRegFlagsX86, PRegValue}, |     register::{FlagsMode, PRegFlagsPowerISA, PRegFlagsX86, PRegValue}, | ||||||
|     unit::{ |     unit::{ | ||||||
|         unit_base::{unit_base, ExecuteEnd, ExecuteStart, UnitToRegAlloc}, |  | ||||||
|         DynUnit, DynUnitWrapper, GlobalState, UnitKind, UnitMOp, UnitOutput, UnitResult, |         DynUnit, DynUnitWrapper, GlobalState, UnitKind, UnitMOp, UnitOutput, UnitResult, | ||||||
|         UnitResultCompleted, UnitTrait, |         UnitResultCompleted, UnitTrait, | ||||||
|  |         unit_base::{ExecuteEnd, ExecuteStart, UnitToRegAlloc, unit_base}, | ||||||
|     }, |     }, | ||||||
| }; | }; | ||||||
| use fayalite::{ | use fayalite::{ | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ | ||||||
| 
 | 
 | ||||||
| use crate::{ | use crate::{ | ||||||
|     config::CpuConfig, |     config::CpuConfig, | ||||||
|     instruction::{MOpTrait, PRegNum, UnitNum, UnitOutRegNum, COMMON_MOP_SRC_LEN}, |     instruction::{COMMON_MOP_SRC_LEN, MOpTrait, PRegNum, UnitNum, UnitOutRegNum}, | ||||||
|     register::PRegValue, |     register::PRegValue, | ||||||
|     unit::{UnitCancelInput, UnitOutput, UnitOutputWrite}, |     unit::{UnitCancelInput, UnitOutput, UnitOutputWrite}, | ||||||
|     util::tree_reduce::tree_reduce, |     util::tree_reduce::tree_reduce, | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ | ||||||
| use cpu::{ | use cpu::{ | ||||||
|     config::{CpuConfig, UnitConfig}, |     config::{CpuConfig, UnitConfig}, | ||||||
|     instruction::{AddSubMOp, LogicalMOp, MOp, MOpDestReg, MOpRegNum, OutputIntegerMode}, |     instruction::{AddSubMOp, LogicalMOp, MOp, MOpDestReg, MOpRegNum, OutputIntegerMode}, | ||||||
|     reg_alloc::{reg_alloc, FetchedDecodedMOp}, |     reg_alloc::{FetchedDecodedMOp, reg_alloc}, | ||||||
|     register::{FlagsMode, PRegFlagsPowerISA}, |     register::{FlagsMode, PRegFlagsPowerISA}, | ||||||
|     unit::{GlobalState, UnitKind}, |     unit::{GlobalState, UnitKind}, | ||||||
| }; | }; | ||||||
|  | @ -12,7 +12,7 @@ use fayalite::{ | ||||||
|     assert_export_firrtl, |     assert_export_firrtl, | ||||||
|     firrtl::ExportOptions, |     firrtl::ExportOptions, | ||||||
|     prelude::*, |     prelude::*, | ||||||
|     sim::{time::SimDuration, vcd::VcdWriterDecls, Simulation}, |     sim::{Simulation, time::SimDuration, vcd::VcdWriterDecls}, | ||||||
|     util::RcWriter, |     util::RcWriter, | ||||||
| }; | }; | ||||||
| use std::num::NonZeroUsize; | use std::num::NonZeroUsize; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue