From c6457e199eb10be0ff207bac9a41db7f4a159964 Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Tue, 14 May 2019 15:15:25 +0200 Subject: [PATCH] Removed obsolete era.mi in master branch --- era.mi/.classpath | 11 - era.mi/.project | 17 - era.mi/.settings/org.eclipse.jdt.core.prefs | 12 - era.mi/bin/era/mi/logic/Bit.class | Bin 2299 -> 0 bytes era.mi/bin/era/mi/logic/Simulation.class | Bin 586 -> 0 bytes era.mi/bin/era/mi/logic/Util$BitOp.class | Bin 247 -> 0 bytes era.mi/bin/era/mi/logic/Util.class | Bin 3046 -> 0 bytes .../mi/logic/components/BasicComponent.class | Bin 1612 -> 0 bytes .../bin/era/mi/logic/components/Clock.class | Bin 1591 -> 0 bytes .../bin/era/mi/logic/components/Merger.class | Bin 1923 -> 0 bytes .../bin/era/mi/logic/components/Merger2.class | Bin 1985 -> 0 bytes era.mi/bin/era/mi/logic/components/Mux.class | Bin 1671 -> 0 bytes .../era/mi/logic/components/Splitter.class | Bin 1686 -> 0 bytes .../mi/logic/components/gates/AndGate.class | Bin 1535 -> 0 bytes .../mi/logic/components/gates/NotGate.class | Bin 1360 -> 0 bytes .../mi/logic/components/gates/OrGate.class | Bin 1531 -> 0 bytes .../mi/logic/components/gates/XorGate.class | Bin 1448 -> 0 bytes .../era/mi/logic/tests/ComponentTest.class | Bin 5454 -> 0 bytes .../logic/timeline/Timeline$InnerEvent.class | Bin 1090 -> 0 bytes .../bin/era/mi/logic/timeline/Timeline.class | Bin 2556 -> 0 bytes .../era/mi/logic/timeline/TimelineEvent.class | Bin 448 -> 0 bytes .../logic/timeline/TimelineEventHandler.class | Bin 203 -> 0 bytes era.mi/src/era/mi/logic/Bit.java | 95 ------ era.mi/src/era/mi/logic/Simulation.java | 12 - era.mi/src/era/mi/logic/Util.java | 92 ------ .../mi/logic/components/BasicComponent.java | 29 -- .../era/mi/logic/components/BitDisplay.java | 35 -- era.mi/src/era/mi/logic/components/Clock.java | 32 -- .../src/era/mi/logic/components/Merger.java | 61 ---- .../src/era/mi/logic/components/Merger2.java | 70 ---- era.mi/src/era/mi/logic/components/Mux.java | 77 ----- era.mi/src/era/mi/logic/components/Mux2.java | 101 ------ .../src/era/mi/logic/components/Splitter.java | 53 --- .../src/era/mi/logic/components/TriState.java | 33 -- .../mi/logic/components/gates/AndGate.java | 43 --- .../mi/logic/components/gates/NotGate.java | 37 --- .../era/mi/logic/components/gates/OrGate.java | 43 --- .../mi/logic/components/gates/XorGate.java | 42 --- .../src/era/mi/logic/tests/ComponentTest.java | 291 ----------------- era.mi/src/era/mi/logic/tests/Connector.java | 38 --- .../era/mi/logic/tests/TestBitDisplay.java | 48 --- .../src/era/mi/logic/timeline/Timeline.java | 95 ------ .../era/mi/logic/timeline/TimelineEvent.java | 17 - .../logic/timeline/TimelineEventHandler.java | 6 - era.mi/src/era/mi/logic/wires/WireArray.java | 307 ------------------ .../era/mi/logic/wires/WireArrayObserver.java | 6 - 46 files changed, 1703 deletions(-) delete mode 100644 era.mi/.classpath delete mode 100644 era.mi/.project delete mode 100644 era.mi/.settings/org.eclipse.jdt.core.prefs delete mode 100644 era.mi/bin/era/mi/logic/Bit.class delete mode 100644 era.mi/bin/era/mi/logic/Simulation.class delete mode 100644 era.mi/bin/era/mi/logic/Util$BitOp.class delete mode 100644 era.mi/bin/era/mi/logic/Util.class delete mode 100644 era.mi/bin/era/mi/logic/components/BasicComponent.class delete mode 100644 era.mi/bin/era/mi/logic/components/Clock.class delete mode 100644 era.mi/bin/era/mi/logic/components/Merger.class delete mode 100644 era.mi/bin/era/mi/logic/components/Merger2.class delete mode 100644 era.mi/bin/era/mi/logic/components/Mux.class delete mode 100644 era.mi/bin/era/mi/logic/components/Splitter.class delete mode 100644 era.mi/bin/era/mi/logic/components/gates/AndGate.class delete mode 100644 era.mi/bin/era/mi/logic/components/gates/NotGate.class delete mode 100644 era.mi/bin/era/mi/logic/components/gates/OrGate.class delete mode 100644 era.mi/bin/era/mi/logic/components/gates/XorGate.class delete mode 100644 era.mi/bin/era/mi/logic/tests/ComponentTest.class delete mode 100644 era.mi/bin/era/mi/logic/timeline/Timeline$InnerEvent.class delete mode 100644 era.mi/bin/era/mi/logic/timeline/Timeline.class delete mode 100644 era.mi/bin/era/mi/logic/timeline/TimelineEvent.class delete mode 100644 era.mi/bin/era/mi/logic/timeline/TimelineEventHandler.class delete mode 100644 era.mi/src/era/mi/logic/Bit.java delete mode 100644 era.mi/src/era/mi/logic/Simulation.java delete mode 100644 era.mi/src/era/mi/logic/Util.java delete mode 100644 era.mi/src/era/mi/logic/components/BasicComponent.java delete mode 100644 era.mi/src/era/mi/logic/components/BitDisplay.java delete mode 100644 era.mi/src/era/mi/logic/components/Clock.java delete mode 100644 era.mi/src/era/mi/logic/components/Merger.java delete mode 100644 era.mi/src/era/mi/logic/components/Merger2.java delete mode 100644 era.mi/src/era/mi/logic/components/Mux.java delete mode 100644 era.mi/src/era/mi/logic/components/Mux2.java delete mode 100644 era.mi/src/era/mi/logic/components/Splitter.java delete mode 100644 era.mi/src/era/mi/logic/components/TriState.java delete mode 100644 era.mi/src/era/mi/logic/components/gates/AndGate.java delete mode 100644 era.mi/src/era/mi/logic/components/gates/NotGate.java delete mode 100644 era.mi/src/era/mi/logic/components/gates/OrGate.java delete mode 100644 era.mi/src/era/mi/logic/components/gates/XorGate.java delete mode 100644 era.mi/src/era/mi/logic/tests/ComponentTest.java delete mode 100644 era.mi/src/era/mi/logic/tests/Connector.java delete mode 100644 era.mi/src/era/mi/logic/tests/TestBitDisplay.java delete mode 100644 era.mi/src/era/mi/logic/timeline/Timeline.java delete mode 100644 era.mi/src/era/mi/logic/timeline/TimelineEvent.java delete mode 100644 era.mi/src/era/mi/logic/timeline/TimelineEventHandler.java delete mode 100644 era.mi/src/era/mi/logic/wires/WireArray.java delete mode 100644 era.mi/src/era/mi/logic/wires/WireArrayObserver.java diff --git a/era.mi/.classpath b/era.mi/.classpath deleted file mode 100644 index bc8d71b0..00000000 --- a/era.mi/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/era.mi/.project b/era.mi/.project deleted file mode 100644 index 9a89f37b..00000000 --- a/era.mi/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - era.mi - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/era.mi/.settings/org.eclipse.jdt.core.prefs b/era.mi/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index a54bb93c..00000000 --- a/era.mi/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=10 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=10 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=10 diff --git a/era.mi/bin/era/mi/logic/Bit.class b/era.mi/bin/era/mi/logic/Bit.class deleted file mode 100644 index 9bba9f0cee30de7022888b360e01f711c37bbd00..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2299 zcmah~TUQ%Z6#fn~$s}QDxkhMHE)v@$AQ7ZM8!R`2O$kst0UCI44Pk_-xzr))Dv$n* z`UhOgCk$&*R#lcyKKP^5y-%hxlDLF5v*$bK?8~<=Cx86;?h?QZ_B6B!bXty?EZNCo z<D4QE;f$r?}(|}B) zkH5+-EoakFQizu9s5BoX^8#&q8G-in#@2dtdnvn>HUxV1S{V+^7m9Y-u0A67vG_K5 zTB#gZ0r)~76&=0k6Y$TwN5Zk}RnSJ&vCD_4Onf^?XFt&4gFgU`!7Uvcg8+j&Isy!W z42E?C;peXpb?E32xS6%f)<&(gZ#g-0zi4p=Dh0E+Z8|n%xfp_i9ty5{WFJ$cX8Ay1 zF4jz_c_rSw#MBZx?qN*eZVMwVR4DBxJ^QSh)bR->DJ#~uHM2T{erdl2m^GE3;U$WPI@!wGUwxk2QQj?dhrM$#K;x>B!)TK+tp? z^Q2IDc|!SW!7<}$2A6h*x`85*o;Sai>Gc?IG)zlg3O01CfqMMD*V9VTJU&i&{J2dQ z_bl=7q`0HLz<_*}ylwc?fkjfzn#9Ie_`@gVIu6-Pt6K**@noPxD#bLRzU zcqUkZ$Q$-y*{s$aT8>`xHs9P+k5Y@18!N_ZGA`>;^3l0S_&v?UHRlYmkTx5v^gO zHA1vTJu&ynd5B>B+xc*Jm?v~>-O{Ztc;{)QDlAasAI_`RQ>pQF{ zRA0I)T-P&PbTS>TVs+UPjPBZ8lJO-$X|=}$^(uUDG!zNV|H(RZ zlniX3OvrVY8fvTG9v48^G>}D(P_}sBVCGMpXe1_{L#SGzExfUaWRj;v9SXJ+sXWh* zALSEacisAGZT77CLI#9->)u+eKa3+8xSezb5xFc;`=d?Jhv6);ooktRDX(Ug3 diff --git a/era.mi/bin/era/mi/logic/Util$BitOp.class b/era.mi/bin/era/mi/logic/Util$BitOp.class deleted file mode 100644 index 6e5fd47a25c9771241091804063fc91c2f35c6b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 247 zcmZXPJqp4=5QX2U$tE#^R$jnD8@Cg|PC*ca6ygEau!Ie3BKZ-|X5j%mlsHKj(#(U$ zd-KhFfA0@~4JHBu!dw?h-i@?*Vq$r%j9u(a6+Hw-glVdtN?MgAGPPVq)0766i_iXh#H`^^x`B8aU{&dWTMdfgD?FH zed*_uukDLc`!#*<*I&_>zP3N0rRz+BNnlES$ec6#?6daTYwvR=zy9;G1YiPRD{u+4 zXn8fdsYkPBMo&kVEj_EiBhdUneWXUSs*#B8K;Rf-q)j8OGT2~v zbv3b{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al+yC<%IL`ew^AiIeKg_NTrEe1m$*oC2G8M=xAxAxX}waE~xRm(ge{_z%)mgurd z-ynu{3^5FZ+!bY|X7fP0j)9xF#n8T)Ut1~U*H;+E!pZ{5h)t21Dm7}8?WF>Z8W_Vk zWod^yWfkjIijVsQEsD;W zgdEjt+@VS?dEin!Fz^%$G!T_jh~a0daL%$p-YAqmS#aIGS~Yv-S~2jXvwaq6x@;J39#qBu zeQdbA+%|niNYibO+jda~BAbZeQ4%w%0?!TH#Y{rSA^{9W-f@JNv$^jJU&k_)gMvk;`avY_njh=}5chEd(wC{kD)JZ3w@CdEFnQt&M!yljze}txeMdA~o zQS{Ken^w?HLm$2Sp{DYB!-|l8I+1;yo#7hoM-e$j7a}?sbsW8q32dC27?}?=1>}ib z3F!HZ8<``F0GTgH9AZNGkJSCg>lX%*#LyYvJtw|7{Q=F)@dkhCv01s(32zf?W7E5@6mxQPkzCsQw82k;RkDR6e diff --git a/era.mi/bin/era/mi/logic/components/Clock.class b/era.mi/bin/era/mi/logic/components/Clock.class deleted file mode 100644 index 70dfad4c95a58f248bb087a3af61753cf809250f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1591 zcma)6TT|0O6#ljiEG^+yl$%@yv@Jpq6{*DwV3BH}GnBy*pF+EqK$JR2*R!l096cXRe!zWvTQ`{U=AZvdvT!VzHT6OOKx49&EQMqbO?rCr++ zmRr^qOgq2Bp)j;=>wCIp>Q+(9Zf=Xb%Tdn|_ZhlINtlKuw6*FYwMSl-bgN(rhoRoJ zi$zl~unh*quDEH2@r=*IzTt?n_L{~y$I;)9oUPK8IfLA0o7L@Pru8e0#6A)(wwR zsoU}r!4R#X?((z|gCUII7RM+on?L3D;JJ=hG8GD%Pl#cGqhh4p9-WX+^j66!G9Dtk(0oZ ziZlip>g;_>c6T^uSDd_9G-N@Cy^CW)-Wd#P+9HhwQ!keVoxa)M)EJ`H2+~)F06o-~ zbTI{Fr_e0rjZkT9qQ6y71Bk>wqd6WtMq7OB1ntM@{^Z%*pfLi4#ugf7x3$p|K`%)< z$X4$5p`T{C8o(g=rJDpdtNy=x7=W2W498oiP7sS9p6IdB2BCGE6#E VTmiiFv|b@YbC~uLbX6{c{Q^sDebfK| diff --git a/era.mi/bin/era/mi/logic/components/Merger.class b/era.mi/bin/era/mi/logic/components/Merger.class deleted file mode 100644 index e76a7d23b08ec03ca8a1f9d6bd68123f235cb490..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1923 zcmaJ>TT>fl7=FH-mV|I_DCcegYYvzIrBn%EX-gFir8bmK<;ErX8n!08nawWNOK18& zoL+IOGnRIAM6dlDUiuRp#pg>>0tg)@e5d#DywCf*`^UdO9|D-irUswDm~@Ox#mtoL zl3B`K+Pq~+E!>(VJnM?*lM`jyY)b8%4sBuQH%++8^vO) z`iYC+zBS1vzSN)#jJMcbE0<--D6cprufis*J}=0sYuZ*D#sw;yyHY2mq)fM;>J|3K zv`V_AA5&V>P0O`)Hc+p4HCNv?_N3lGt1s!sOuDg;C-jtV%$_`@(`j{Q9p9xRxPnQ= z*n0x8c&>#p?>bDIRn&InOiSMPDm&8IG`=8V( zh@fY&S^=@feO(*^9eLL%e7$Z|>(Mks1T^LAxl+T7K;N0}-!|Q>>dN&f=5RwGT$1jV zQT8Mu#Nvr_t#9HZ4Ic{hoND|d*DOb|0HxG|Z50fvIT7F9K0!uf9I}ksBB*(%Ff2u} zjE|{|r&1R4X2~+jMA08V2Si<}JEoe3OH6SJh$@Msn8abpZ#F#6--_c9)Xt?a=@I?}4_amH}^(ZoGqQYuIO~bW0^pU*n zIR$yoRB~uZU96sHZRY#IWS>(t+^eoq`$St#GQYtH!WxIybx+3TVn=PL#t}>^e zzaV`4)c>0@m>h(eLH9C`1uh5fBy+WUVdFsi6b~qpM&j`KZ)!xHM`jN&n}6XG_0!?YqrXybF#kKI*ZJBvb%4cIy<_AXtRhVGoy0%H z^&0V~iEW-pReeb&W2$C-VZPnM3W2nfi`%sG@g|HrnBh)U#ftwyr-r+tlUA#^*94vA zyN~ah0y#YU1Gm09=^+{b)AeNi4U=OsHGIMp9@AK|&|2*FXFolnG zXaZx>wF*tU&}h}|YN6U{uD2ZNcpHTU>DHxN)Dadq^~l<^3JuGt7Zz6@$*QL#DlmHB z=mXo8v#x7>xwx_+-A(BVgj#J+U~vBExROBBcGlb8hQQFn$YQiWr0iSrLppVD&4;Y0L#BaooE7M?YPEfJCXOTiUq~tQsg5@U&hD#U zX*6WrYRtOzc9UJY{kSUEJ-g*};k-ce-kLNiIVCk)t7el8q-dsNc3QJx+K$&U*c-ucCYHPG!bLC6r3-YeuN#q15}L#Zbh8fxB3weANbx z#DSq^``r(|4^%g{)M~p`dB;|5H}<|Jc@@ZE;B4?8;Z;*J#_y4)rp~`}(s}BLZnL!MJ)mF@LDP7Ck zxT(|(i1qrB7Z7EYaXM#+)hMO10YZo5Fz)zDMX9)=t1&u`cYUQaHA;KAzv7z^&yR&> zo}yRDkSgZBLnQU=i6&BN&;I_QJ!44F&VIio)4X1xjjpn>(`>*spM)7ebx4fiJ)eZ; zw^)%-t?5GOZ$w0oMhcbxr{Ikv6?~sw2^74{yK+U3BD{_HUva3Hw_bwi=``U(9@6m9 Ezp&etzW@LL diff --git a/era.mi/bin/era/mi/logic/components/Mux.class b/era.mi/bin/era/mi/logic/components/Mux.class deleted file mode 100644 index ec4740b381608681186e09aeda6d1ce7e070a1d5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1671 zcmcIkTW=Fb6#mAyjhzh_1EtQ5Nr13+lPoQiQWDZS6r_{{gdCCp;$gg=I79bh&8}0Z z_%H2aA6p3*sYvCWA4Pk{HlYb_o~UHaIkV?{=klF1e)IOvzW`jpw-!} zmFId<(27DCCb7HLerh4ZF!Nsy%OY0ZjduVBCKx7H_j&)Qw2a+NI;&cXXA9(1XGllw zgdrD8UwWiuV)c_G%L;v4RG~_i7@j*The!JVtmO?V=|45i=OchYVq^b1`!zpL=eUe(D zRoGlG#WPIV$RbyuHqP2Ohw}`>qS3fpkEPy~nxX6*O6xnvh4Moa?Sc&pIirIbome>)*d+9_{X_>$7UC*Y>mksiWV48PtFX&WPdS2nnTC|?-5IR&SR zg7_LQrceTK{zwYEfHz@|H3~7@|i#Z@9q}jV(=o z16icZPLP%|)9gx`U{}&iNfyoSlFSjp#t5B9KnJ0Xb*nP=5=SeuFHr2@^c;y&mX2R= z#ORe5IQ=t5UZM1$NPZKqE3+N&*~%Z7-mJ`ZFf-RvOPLOwQl@{&c2N19Vy7`n=NFU} z7^N!5DEm0=?F8mAiAy+xufefIy?lphe2=rZN7hZ8#~dM+di9a7OE;<%7pV^_oHWyM zs;ilv4G&vpgOTZKrvEHHCw&yDzbRzS0%I0V?EOIA8LI43j}4kvx*NIh3YQ-gue`+7 z*Mv@W>o>fCa+{j$o>#vnM)hCoM{r3RzbsM4e>(tP{1-U82VNKmo;e7v4g@a_1Xm7% VZw&-r9|(31f^QE5FLj&y<{yTvWW4|Y diff --git a/era.mi/bin/era/mi/logic/components/Splitter.class b/era.mi/bin/era/mi/logic/components/Splitter.class deleted file mode 100644 index d795f92c4249c96c0b3cd508d781427063fb70e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1686 zcmah}TW=dh6#mBcdhLzV-0HM}rWvOJ)|c8ew1Fl~Af>GoDKrl*sX~Rs#Gcq&*1Oj3 zY@m-w{13zvuOPLFM5UHzeoB7=4}>%8#7-jQ$nwtReCPI^bLQ`V|9k^r3HMDT7`O~X zt>e^OzvVP)4ZqX%J?W{iR`0rwQZg`+Vi4Zi8RB)8QmY8K!&xa z^j!}E@nUN?l)=6X7!1ejMvCG3<}myUgXu?#kRij|vx~6ldyeO*HHI(j;m`{#6}K5u zU;0gHA&IdZMljBhw2RwWFihrPBBOVgbI8K7FpaAwt}t91mP!sYc#mO3G@An!io@eP z0j?Ck$�AIn3fZL)w*IOSKu;h6&CvKPbe8>&ljJ*MnBnp^82Hu_3$4@x2V@8N4TL z$z$HRzsJM4mX6orR9w1NKKFRPQX%g|q2g_^FL}=$U*+OfwYRs6yv)Vo=~J~@)puV1 zu4-Wp3!1zS81nY!AjrB3$nA<|d2G}1?!Iht z4R&0i$>ZI?r&v16+{$VSJ5sg%Cf}2?S$A5Va6|jPqn>?RIFEsawg* zAnD%3lI3*NZ3;#5!th?Ca#_^#YdPH1(~#AZ<_P7}EL(Ly3L5f}qw6<%@^CEovT?Pr7KjePpoqjzOG&;EkZ*O=RxEF9v-+ds%;5+BmH zO3py;Qn*9`jL~--moY(uHHi|Yut@7YS~5J#ET2Oen89#!uh05}@g%NcI)N#MxnW7mxQ-cylu@tm*F5f?aF;<%jVFzAXplz6b7f^$*E2$BqAdzQ^#v|Baq9vZbKr#$x@(`Z%=*An~Q zq2#}_JciYNKbMUVbu4x4IwtqLL#sucjC!6B)@`45QAMqaI1=P2dhgy07XleXA+s9yW>8ugJd8Fk#$mGw|jMPC^%Sc_^=pgqcAiG8DBF!u?MwH`3ou+jH zQV9z;?54L-xI!SRC6NH~hi9lo(4-V)5 p0>>`EPeQ?&LGV&2cqbH`9R#Z(;0T@u@jXM4WRfD>q8gXLegnY(QV{?E diff --git a/era.mi/bin/era/mi/logic/components/gates/NotGate.class b/era.mi/bin/era/mi/logic/components/gates/NotGate.class deleted file mode 100644 index addad50e5d930d1a68e41f3f4650cdda5cfdc6b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1360 zcmah|T~pIQ6g``^L_&m80r{*&zLG$Rir+;WM6gJIJs_k@;u-bc&Oj%mygn;UYffAVYw z+c105b=FC8-qLXm{R~4p!sok<`VkKgoFk7jcq*Ym#U0z#N?$6vm&c!>aeiP&|l+m#qk=P6h;m6ZM(>ph)WuZuvM&5 z?b~YoIu@ReJGe`ven4|$7+uia8Q1VY#eIh5HpY&D>?oa1ALJ1|?j7gVeNpork5V4% zs!0=+p?8&O<_rJnj~rYI-IIf_?FWs}OD^?S^L#ud(ajV$G zdBlr(ERdGm$$XS#Co@XX=^~a| zd2G^+jLKQ3l*=iyO&H&?(!{;L+FF91AmzzKOFu`nv=|=aNsG;;JGef1*Jq{9nWahNMwzwvH|u77QHp4 diff --git a/era.mi/bin/era/mi/logic/components/gates/OrGate.class b/era.mi/bin/era/mi/logic/components/gates/OrGate.class deleted file mode 100644 index ddc06f36317e3238e099a20ac346656a19e729f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1531 zcmbtUZBNrs6n<{kZPHa>AjlX3!-?%+)EC5;A;^|UmJs;>jzklaZoAH!ttD-T@u&DN zG-1>D!5`p{GM?K3x~0qye&{{t-g}EXY9MXB;$}7mM^m`nx0iFog*2T$uPgyXZ^u)iR_5h9oIEK7Rac|5OLZ* zgG_6gAwLw6y}*|3-GJr$K4a|GU(dS=*|rb`YYjYRz(~!q0Ond((^p8 zVgZZ9TXQ+JDku+wq3J`32kR*~msE^EVHn%9Z2qF%s&er>0N&D~Pd^gL0)(f-GS3^hAK{{R`1m|xN)F;{`4sR|@b0?8;@CZN)Km3E&3 zdtfD({)*AuY6r>HTo;o^xqJtyd{0fu9i($9xr-YeWWEGsH)&m>fd$5ha-67>v`%0O zlSotBGo~K9xH~ zhQ4H%B0fcm#5WjSJopoo641?JhQbieMWzHib57HP%`;Miq_~R;!q22g5Lv~7!-c=V n(F^d?P;hDxoDBtUg@V(AU_AsZVLOQL8Fol26yXNdxCr(eM#50V diff --git a/era.mi/bin/era/mi/logic/components/gates/XorGate.class b/era.mi/bin/era/mi/logic/components/gates/XorGate.class deleted file mode 100644 index e2c3f8bd714eaa12cfd49ed1f8b4b00c51346603..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1448 zcmbtTZBNrs6n^g3tTc`U zb+{AwM$-(qZ@h55U2z3!4AIlU}V@SH~ zfI*_Q!cgjon7zbSoa1&t1nG6lv4RbT*IK0~wERD(dX)t3xDBo#i2)TE4AO>H(W`x6 z7*df!TEPvB${1mo=vB0en;2urn2pAM&F9_;_ZW1or@D*4vi?%!8&@GCExZX8*N|oy z*s~n|tlg?{@6fE-oHXsZbTc%PbL-sq53Lq)GP)mG zM7IO_OKRuU&#UNzBC6L^=qNJuHF;1q?KY=eBbxpynr_<)$_kdSEThDbjr8hyVA(1R z+#&i8E;XjC#h_!h;*+dkRmMGr#YmE_DeRgl75A}5mA~PLl)IE0q2glvi;Gf-*0PJf@mcwoAi|AzkJ(kZe_#WM^a6-%ec zmCoIqbc+0!kmDAu1!4vUh-r`*v$PIj1jESFeNT~Bpwm@4C05+VBw682(Z@nh=u3p2 zP$*PSi;*Sm5@s;lQMOAbB0g9AiaGkSXILPUBl8`LXSn-UkP_16Foy9kxhRf+o#YG; z@UTN_kQHYsLHL=R1VlyYaI^3aICTkr6bsIEgJ)vFk7L34Zm<>uPM{p>TgMZ!3MpKn I{%(N%0eNsZuK)l5 diff --git a/era.mi/bin/era/mi/logic/tests/ComponentTest.class b/era.mi/bin/era/mi/logic/tests/ComponentTest.class deleted file mode 100644 index 081de043e2e01b6c363369ad8947d66733c2a42b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5454 zcmbtY3vgUj8U9Z8ag*(B6H6a#jU_@^l_wHt2Nm_=c zbMLw5od2BveE;`<|4DxG-ihY{Y{V-HN(8EOQwt6n!C0c-hy*P?X(fY=iNT>nT#s9w z{8Zo;sMx0sYr&Wn?+@oJu9`rXfV(jf)qQZGOoaztf$~-(uD7QK zdv&u@>y7CG3tJNrE!L%(hWt)5_ndM=EX^gL;>dG`Lnn zJf5&L%SgnzRAp<{is(K|ke3`;kI+K>^HmZ35%#3BXf2rSLpFl-E_V)hCu7GsG( zX=ig=Q)_d36Co<_jr+!UwqR$v5%S?&EK}eYSf012^e}IxiVsU@Jf@!13G7GcY@WeE zgCoIRd^VV-HtItq&XaIf(Wa)kInX70E>LkHss-jnOkK0|=J-&Ghy-f_`EC}hRXx3` zZ4gqhl3~r;eXC)WVFhYb1hASB?P=Q4A){6}iRZ1w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) pYffNTc}v*GLCYx^LtN`jU(tJJ$3jErn&iOHguj56hHz+5qaVRDQmp_0 diff --git a/era.mi/bin/era/mi/logic/timeline/TimelineEventHandler.class b/era.mi/bin/era/mi/logic/timeline/TimelineEventHandler.class deleted file mode 100644 index 7a4a6f7811b07600a1d6d16b9bad0e62cdf741c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 203 zcmX^0Z`VEs1_m<*PId++Mh30aqD1}NO#Phv^vq=alFZ!HoXosb{SYX_wJbHS#3L~; zB`39roq>gsK_Dx!EKxrvF)v-;KPf9UxrC8{Edwmi$e^L&LxgG8nqiC#T*3LJMaijd pnK`M943gMv(*s$=#>l|PzzlRQ0|O(_a#jX55Q~8wNHQ^S005GaIV=DG diff --git a/era.mi/src/era/mi/logic/Bit.java b/era.mi/src/era/mi/logic/Bit.java deleted file mode 100644 index e7c93968..00000000 --- a/era.mi/src/era/mi/logic/Bit.java +++ /dev/null @@ -1,95 +0,0 @@ -package era.mi.logic; - -public enum Bit -{ - ONE, ZERO, Z, X; - - public static Bit and(Bit a, Bit b) - { - return a.and(b); - } - - public Bit and(Bit other) - { - if (equals(Bit.ZERO) || other.equals(Bit.ZERO)) - return Bit.ZERO; - else if (equals(other) && equals(Bit.ONE)) - return Bit.ONE; - else - return Bit.X; - } - - public static Bit or(Bit a, Bit b) - { - return a.or(b); - } - - public Bit or(Bit other) - { - if (equals(Bit.ONE) || other.equals(Bit.ONE)) - return Bit.ONE; - else if (equals(other) && equals(Bit.ZERO)) - return Bit.ZERO; - else - return Bit.X; - } - - public static Bit xor(Bit a, Bit b) - { - return a.xor(b); - } - - public Bit xor(Bit other) - { - // I'm uncertain how this should behave for cases where one value is neither 1 nor 0. - // TODO: Implement xor - return Bit.X; - } - - public Bit not() - { - switch (this) - { - case ONE: - return Bit.ZERO; - case ZERO: - return Bit.ONE; - default: - return Bit.X; - } - } - - /** - * Rules for two bits that get directly connected
- * - * - * - * - * - * - * - * - *
X01Z
XXXXX
0X0X0
1XX11
ZX01Z
- * - * @return the result according to the table - * - * @author Christian Femers - */ - public Bit combineWith(Bit other) - { - if (this == other) - return this; - if (this == X || other == X) - return X; - if (other == Z) - return this; - if (this == Z) - return other; - return X; - } - - public static Bit combine(Bit a, Bit b) - { - return a.combineWith(b); - } -} diff --git a/era.mi/src/era/mi/logic/Simulation.java b/era.mi/src/era/mi/logic/Simulation.java deleted file mode 100644 index 6a63e155..00000000 --- a/era.mi/src/era/mi/logic/Simulation.java +++ /dev/null @@ -1,12 +0,0 @@ -package era.mi.logic; - -import era.mi.logic.timeline.Timeline; - -public class Simulation -{ - public final static Timeline TIMELINE = new Timeline(11); - - public static void main(String[] args) - { - } -} \ No newline at end of file diff --git a/era.mi/src/era/mi/logic/Util.java b/era.mi/src/era/mi/logic/Util.java deleted file mode 100644 index 6f1b93ff..00000000 --- a/era.mi/src/era/mi/logic/Util.java +++ /dev/null @@ -1,92 +0,0 @@ -package era.mi.logic; - -import java.util.Arrays; - -public final class Util -{ - - @SuppressWarnings("unchecked") - public static T[] concat(T[]... arrays) - { - if(arrays.length == 0) - throw new IllegalArgumentException("Cannot concatenate 0 arrays."); - - int length = 0; - for(T[] array : arrays) - length += array.length; - - T[] newArray = Arrays.copyOf(arrays[0], length); - int appendIndex = arrays[0].length; - for(int i = 1; i < arrays.length; i++) - { - System.arraycopy(arrays[i], 0, newArray, appendIndex, arrays[i].length); - appendIndex += arrays[i].length; - } - - return newArray; - } - -// @SuppressWarnings("unchecked") -// public static T[][] split(T[] array, int... lengths) -// { -// //TODO: implement array split again; This version contains an illegal cast -// int totalLength = 0; -// for(int length : lengths) -// totalLength += length; -// -// if(totalLength != array.length) -// throw new IllegalArgumentException(); //TODO: add proper error message -// -// Object[][] newArray = new Object[lengths.length][]; -// int splitIndex = 0; -// for(int i = 0; i < lengths.length; i++) -// { -// System.arraycopy(array, splitIndex, newArray, 0, lengths[i]); -// splitIndex += lengths[i]; -// } -// -// return (T[][]) newArray; -// } - - public static Bit[] and(Bit[] a, Bit[] b) - { - return binBitOp(a, b, (bA, bB) -> Bit.and(bA, bB)); - } - - public static Bit[] or(Bit[] a, Bit[] b) - { - return binBitOp(a, b, (bA, bB) -> Bit.or(bA, bB)); - } - - public static Bit[] xor(Bit[] a, Bit[] b) - { - return binBitOp(a, b, (bA, bB) -> Bit.xor(bA, bB)); - } - - private static Bit[] binBitOp(Bit[] a, Bit[] b, BitOp op) - { - if(a.length != b.length) - throw new IllegalArgumentException("Bit Arrays were not of equal length."); - Bit[] out = new Bit[a.length]; - for(int i = 0; i < a.length; i++) - { - out[i] = op.execute(a[i], b[i]); - } - return out; - } - - public static Bit[] not(Bit[] a) - { - Bit[] out = new Bit[a.length]; - for(int i = 0; i < a.length; i++) - { - out[i] = a[i].not(); - } - return out; - } - - interface BitOp - { - Bit execute(Bit a, Bit b); - } -} diff --git a/era.mi/src/era/mi/logic/components/BasicComponent.java b/era.mi/src/era/mi/logic/components/BasicComponent.java deleted file mode 100644 index ddcf4cea..00000000 --- a/era.mi/src/era/mi/logic/components/BasicComponent.java +++ /dev/null @@ -1,29 +0,0 @@ -package era.mi.logic.components; - -import era.mi.logic.Simulation; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArrayObserver; - -public abstract class BasicComponent implements WireArrayObserver -{ - private int processTime; - - /** - * - * @param processTime Amount of time this component takes to update its outputs. Must be more than 0, otherwise 1 is assumed. - * - * @author Fabian Stemmler - */ - public BasicComponent(int processTime) - { - this.processTime = processTime > 0 ? processTime : 1; - } - - @Override - public void update(WireArray initiator) - { - Simulation.TIMELINE.addEvent((e) -> {compute();}, processTime); - } - - protected abstract void compute(); -} diff --git a/era.mi/src/era/mi/logic/components/BitDisplay.java b/era.mi/src/era/mi/logic/components/BitDisplay.java deleted file mode 100644 index 940f69c0..00000000 --- a/era.mi/src/era/mi/logic/components/BitDisplay.java +++ /dev/null @@ -1,35 +0,0 @@ -package era.mi.logic.components; - -import java.util.Arrays; - -import era.mi.logic.Bit; -import era.mi.logic.wires.WireArray; - -public class BitDisplay extends BasicComponent -{ - private final WireArray in; - private Bit[] displayedValue; - - public BitDisplay(WireArray in) - { - super(1); - this.in = in; - in.addObserver(this); - } - - @Override - protected void compute() - { - displayedValue = in.getValues(); - } - - public Bit[] getDisplayedValue() - { - return displayedValue; - } - - public boolean isDisplaying(Bit... values) - { - return Arrays.equals(displayedValue, values); - } -} diff --git a/era.mi/src/era/mi/logic/components/Clock.java b/era.mi/src/era/mi/logic/components/Clock.java deleted file mode 100644 index 9f2ecca6..00000000 --- a/era.mi/src/era/mi/logic/components/Clock.java +++ /dev/null @@ -1,32 +0,0 @@ -package era.mi.logic.components; - -import era.mi.logic.Bit; -import era.mi.logic.Simulation; -import era.mi.logic.timeline.TimelineEvent; -import era.mi.logic.timeline.TimelineEventHandler; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayInput; - -public class Clock implements TimelineEventHandler -{ - private boolean toggle = false; - private WireArrayInput outI; - - public Clock(WireArray out) - { - this.outI = out.createInput(); - } - - @Override - public void handle(TimelineEvent e) - { - Simulation.TIMELINE.addEvent(this, 50); - outI.feedSignals(new Bit[] { toggle ? Bit.ONE : Bit.ZERO }); - toggle = !toggle; - } - - public WireArray getOut() - { - return outI.owner; - } -} diff --git a/era.mi/src/era/mi/logic/components/Merger.java b/era.mi/src/era/mi/logic/components/Merger.java deleted file mode 100644 index eb910a4f..00000000 --- a/era.mi/src/era/mi/logic/components/Merger.java +++ /dev/null @@ -1,61 +0,0 @@ -package era.mi.logic.components; - -import era.mi.logic.Util; -import era.mi.logic.Bit; -import era.mi.logic.WireArray; -import era.mi.logic.WireArrayObserver; - -@Deprecated -public class Merger implements WireArrayObserver -{ - private WireArray out; - private WireArray[] inputs; - - //TODO: General problem with this concept; New inputs coming in at the same time override each other - - /** - * - * @param union The output of merging n {@link WireArray}s into one. Must have length = a1.length() + a2.length() + ... + an.length(). - * @param inputs The inputs to be merged into the union - */ - public Merger(WireArray union, WireArray... inputs) - { - this.inputs = inputs; - this.out = union; - - int length = 0; - for(WireArray input : inputs) - { - length += input.length(); - input.addObserver(this); - } - - if(length != union.length()) - throw new IllegalArgumentException("The output of merging n WireArrays into one must have length = a1.length() + a2.length() + ... + an.length()."); - } - - protected void compute() - { - Bit[][] bits = new Bit[inputs.length][]; - for(int i = 0; i < inputs.length; i++) - bits[i] = inputs[i].getValues(); - Bit[] newOut = Util.concat(bits); - out.feedSignals(newOut); - } - - public WireArray getInput(int index) - { - return inputs[index]; - } - - public WireArray getUnion() - { - return out; - } - - @Override - public void update(WireArray initiator) - { - compute(); //No inner delay - } -} diff --git a/era.mi/src/era/mi/logic/components/Merger2.java b/era.mi/src/era/mi/logic/components/Merger2.java deleted file mode 100644 index ca242544..00000000 --- a/era.mi/src/era/mi/logic/components/Merger2.java +++ /dev/null @@ -1,70 +0,0 @@ -package era.mi.logic.components; - -import era.mi.logic.WireArray; -import era.mi.logic.WireArrayObserver; - -public class Merger2 implements WireArrayObserver -{ - private WireArray out; - private WireArray[] inputs; - private int[] beginningIndex; - - /** - * - * @param union The output of merging n {@link WireArray}s into one. Must have length = a1.length() + a2.length() + ... + an.length(). - * @param inputs The inputs to be merged into the union - */ - public Merger2(WireArray union, WireArray... inputs) - { - this.inputs = inputs; - this.out = union; - this.beginningIndex = new int[inputs.length]; - - int length = 0; - for(int i = 0; i < inputs.length; i++) - { - beginningIndex[i] = length; - length += inputs[i].length(); - inputs[i].addObserver(this); - } - - if(length != union.length()) - throw new IllegalArgumentException("The output of merging n WireArrays into one must have length = a1.length() + a2.length() + ... + an.length()."); - } - - public WireArray getInput(int index) - { - return inputs[index]; - } - - public WireArray getUnion() - { - return out; - } - - @Override - public void update(WireArray initiator) - { - int index = find(initiator); - int beginning = beginningIndex[index]; - out.feedSignals(beginning, initiator.getValues()); - } - - private int find(WireArray w) - { - for(int i = 0; i < inputs.length; i++) - if(inputs[i] == w) - return i; - return -1; - } - - public WireArray getOut() - { - return out; - } - - public WireArray[] getInputs() - { - return inputs.clone(); - } -} diff --git a/era.mi/src/era/mi/logic/components/Mux.java b/era.mi/src/era/mi/logic/components/Mux.java deleted file mode 100644 index 0b19e7c8..00000000 --- a/era.mi/src/era/mi/logic/components/Mux.java +++ /dev/null @@ -1,77 +0,0 @@ -package era.mi.logic.components; - -import era.mi.logic.Bit; -import era.mi.logic.wires.WireArray; - -/** - * Models a Multiplexer. A is selected when select bit is 1, B when select bit is 0. Outputs X otherwise. - * @author Fabian - * - */ -public class Mux extends BasicComponent -{ - private WireArray a, b, out; - private WireArray select; - private final int size; - - /** - * {@link WireArray}s a, b and out must be of uniform length, select - * @param a Must be of uniform length with b and out. - * @param b Must be of uniform length with a and out. - * @param select C - * @param out Must be of uniform length with a and b. - */ - public Mux(int processTime, WireArray a, WireArray b, WireArray select, WireArray out) - { - super(processTime); - size = a.length; - if(b.length != out.length || b.length != size) - throw new IllegalArgumentException("All MUX wire arrays must be of uniform length!"); - this.a = a; - a.addObserver(this); - this.b = b; - b.addObserver(this); - this.select = select; - select.addObserver(this); - this.out = out; - } - - @Override - protected void compute() - { - WireArray active = b; - switch(select.getValue()) - { - case ONE: - active = a; - case ZERO: - out.feedSignals(active.getValues()); - break; - default: - Bit[] newValues = new Bit[size]; - for(int i = 0; i < size; i++) - newValues[i] = Bit.X; - out.feedSignals(newValues); - } - } - - public WireArray getA() - { - return a; - } - - public WireArray getB() - { - return b; - } - - public WireArray getOut() - { - return out; - } - - public WireArray getSelect() - { - return select; - } -} diff --git a/era.mi/src/era/mi/logic/components/Mux2.java b/era.mi/src/era/mi/logic/components/Mux2.java deleted file mode 100644 index c0c4ce32..00000000 --- a/era.mi/src/era/mi/logic/components/Mux2.java +++ /dev/null @@ -1,101 +0,0 @@ -package era.mi.logic.components; - -import era.mi.logic.Simulation; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayInput; -import era.mi.logic.wires.WireArrayObserver; - -/** - * Models a Multiplexer. A is selected when select bit is 1, B when select bit is 0. Outputs X otherwise. - * @author Fabian Stemmler - * - */ -public class Mux2 implements WireArrayObserver -{ - private WireArray select; - private WireArrayInput outI; - private WireArrayInput[] inputs; - private final int size; - private final int processTime; - private int selected; - - /** - * {@link WireArray}s a, b and out must be of uniform length, select - * @param out Must be of uniform length with a and b. - * @param select Indexes the input array which is to be mapped to the output - * @param inputs One of these inputs is mapped to the output, depending on the select wires - */ - public Mux2(int processTime, WireArray out, WireArray select, WireArray... inputs) - { - this.processTime = processTime; - size = out.length; - - this.inputs = new WireArrayInput[inputs.length]; - for(int i = 0; i < this.inputs.length; i++) - { - if(inputs[i].length != size) - throw new IllegalArgumentException("All MUX wire arrays must be of uniform length!"); - this.inputs[i] = inputs[i].createInput(); - inputs[i].addObserver(this); - } - - this.select = select; - select.addObserver(this); - selected = -1; - - int maxInputs = 1 << select.length; - if(this.inputs.length > maxInputs) - throw new IllegalArgumentException("There are more inputs (" - + this.inputs.length + ") to the MUX than supported by " - + select.length + " select bits (" + maxInputs + ")."); - - outI = out.createInput(); - out.addObserver(this); - } - - public WireArray getOut() - { - return outI.owner; - } - - public WireArray getSelect() - { - return select; - } - - @Override - public void update(WireArray initiator) { - int selectValue; - if(!select.hasNumericValue() || (selectValue = (int) select.getUnsignedValue()) > size) - { - if(initiator == select) - { - Simulation.TIMELINE.addEvent((e) -> { - if(selected != -1) - { - inputs[selected].clearSignals(); - selected = -1; - outI.clearSignals(); - } - }, processTime); - } - return; - } - - WireArrayInput active = inputs[selectValue]; - Simulation.TIMELINE.addEvent((e) -> { - if(initiator == select) - { - if(selected != -1) - inputs[selected].clearSignals(); - selected = selectValue; - active.feedSignals(outI.owner.getValues()); - outI.feedSignals(active.owner.getValues()); - } - else if(initiator == outI.owner) - active.feedSignals(outI.owner.getValues()); - else if(initiator == active.owner) - outI.feedSignals(active.owner.getValues()); - }, processTime); - } -} diff --git a/era.mi/src/era/mi/logic/components/Splitter.java b/era.mi/src/era/mi/logic/components/Splitter.java deleted file mode 100644 index 58d48e7c..00000000 --- a/era.mi/src/era/mi/logic/components/Splitter.java +++ /dev/null @@ -1,53 +0,0 @@ -package era.mi.logic.components; - -import era.mi.logic.Bit; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArrayObserver; - -public class Splitter implements WireArrayObserver -{ - private WireArray input; - private WireArray[] outputs; - - public Splitter(WireArray input, WireArray... outputs) - { - this.input = input; - this.outputs = outputs; - input.addObserver(this); - int length = 0; - for(WireArray out : outputs) - length += out.length; - - if(input.length != length) - throw new IllegalArgumentException("The input of splitting one into n WireArrays must have length = a1.length() + a2.length() + ... + an.length()."); - } - - protected void compute() - { - int startIndex = 0; - Bit[] inputBits = input.getValues(); - for(int i = 0; i < outputs.length; i++) - { - Bit[] outputBits = new Bit[outputs[i].length]; - System.arraycopy(inputBits, startIndex, outputBits, 0, outputs[i].length); - outputs[i].feedSignals(outputBits); - startIndex += outputs[i].length; - } - } - - public WireArray getInput() - { - return input; - } - - public WireArray[] getOutputs() - { - return outputs.clone(); - } - - @Override - public void update(WireArray initiator) - { - compute(); - } -} diff --git a/era.mi/src/era/mi/logic/components/TriState.java b/era.mi/src/era/mi/logic/components/TriState.java deleted file mode 100644 index 2bddbf1c..00000000 --- a/era.mi/src/era/mi/logic/components/TriState.java +++ /dev/null @@ -1,33 +0,0 @@ -package era.mi.logic.components; - -import era.mi.logic.Bit; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayInput; - -public class TriState extends BasicComponent{ - WireArray in, enable; - WireArrayInput outI; - - public TriState(int processTime, WireArray in, WireArray out, WireArray enable) { - super(processTime); - if(in.length != out.length) - throw new IllegalArgumentException("Tri-state output must have the same amount of bits as the input. Input: " + in.length + " Output: " + out.length); - if(enable.length != 1) - throw new IllegalArgumentException("Tri-state enable must have exactly one bit, not " + enable.length + "."); - this.in = in; - in.addObserver(this); - this.enable = enable; - enable.addObserver(this); - outI = out.createInput(); - } - - @Override - protected void compute() - { - if(enable.getValue() == Bit.ONE) - outI.feedSignals(in.getValues()); - else - outI.clearSignals(); - } - -} diff --git a/era.mi/src/era/mi/logic/components/gates/AndGate.java b/era.mi/src/era/mi/logic/components/gates/AndGate.java deleted file mode 100644 index b3269cbd..00000000 --- a/era.mi/src/era/mi/logic/components/gates/AndGate.java +++ /dev/null @@ -1,43 +0,0 @@ -package era.mi.logic.components.gates; - -import era.mi.logic.Util; -import era.mi.logic.components.BasicComponent; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayInput; - -public class AndGate extends BasicComponent -{ - private WireArray a, b, out; - private WireArrayInput outI; - - public AndGate(int processTime, WireArray a, WireArray b, WireArray out) - { - super(processTime); - this.a = a; - a.addObserver(this); - this.b = b; - b.addObserver(this); - this.out = out; - outI = out.createInput(); - } - - protected void compute() - { - outI.feedSignals(Util.and(a.getValues(), b.getValues())); - } - - public WireArray getA() - { - return a; - } - - public WireArray getB() - { - return b; - } - - public WireArray getOut() - { - return out; - } -} diff --git a/era.mi/src/era/mi/logic/components/gates/NotGate.java b/era.mi/src/era/mi/logic/components/gates/NotGate.java deleted file mode 100644 index 1aba6b86..00000000 --- a/era.mi/src/era/mi/logic/components/gates/NotGate.java +++ /dev/null @@ -1,37 +0,0 @@ -package era.mi.logic.components.gates; - -import era.mi.logic.Util; -import era.mi.logic.components.BasicComponent; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayInput; - -public class NotGate extends BasicComponent -{ - private WireArray in, out; - private WireArrayInput outI; - - - public NotGate(int processTime, WireArray in, WireArray out) - { - super(processTime); - this.in = in; - in.addObserver(this); - this.out = out; - outI = out.createInput(); - } - - public void compute() - { - outI.feedSignals(Util.not(in.getValues())); - } - - public WireArray getIn() - { - return in; - } - - public WireArray getOut() - { - return out; - } -} diff --git a/era.mi/src/era/mi/logic/components/gates/OrGate.java b/era.mi/src/era/mi/logic/components/gates/OrGate.java deleted file mode 100644 index c1d95a78..00000000 --- a/era.mi/src/era/mi/logic/components/gates/OrGate.java +++ /dev/null @@ -1,43 +0,0 @@ -package era.mi.logic.components.gates; - -import era.mi.logic.Util; -import era.mi.logic.components.BasicComponent; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayInput; - -public class OrGate extends BasicComponent -{ - private WireArray a, b, out; - private WireArrayInput outI; - - public OrGate(int processTime, WireArray a, WireArray b, WireArray out) - { - super(processTime); - this.a = a; - a.addObserver(this); - this.b = b; - b.addObserver(this); - this.out = out; - this.outI = out.createInput(); - } - - protected void compute() - { - outI.feedSignals(Util.or(a.getValues(), b.getValues())); - } - - public WireArray getA() - { - return a; - } - - public WireArray getB() - { - return b; - } - - public WireArray getOut() - { - return out; - } -} diff --git a/era.mi/src/era/mi/logic/components/gates/XorGate.java b/era.mi/src/era/mi/logic/components/gates/XorGate.java deleted file mode 100644 index c7a94550..00000000 --- a/era.mi/src/era/mi/logic/components/gates/XorGate.java +++ /dev/null @@ -1,42 +0,0 @@ -package era.mi.logic.components.gates; - -import era.mi.logic.Util; -import era.mi.logic.components.BasicComponent; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayInput; - -public class XorGate extends BasicComponent -{ - private WireArray a, b, out; - private WireArrayInput outI; - - public XorGate(int processTime, WireArray a, WireArray b, WireArray out) - { - super(processTime); - this.a = a; - a.addObserver(this); - this.b = b; - b.addObserver(this); - this.out = out; - } - - protected void compute() - { - outI.feedSignals(Util.xor(a.getValues(), b.getValues())); - } - - public WireArray getA() - { - return a; - } - - public WireArray getB() - { - return b; - } - - public WireArray getOut() - { - return out; - } -} diff --git a/era.mi/src/era/mi/logic/tests/ComponentTest.java b/era.mi/src/era/mi/logic/tests/ComponentTest.java deleted file mode 100644 index 722c52a2..00000000 --- a/era.mi/src/era/mi/logic/tests/ComponentTest.java +++ /dev/null @@ -1,291 +0,0 @@ -package era.mi.logic.tests; - -import static org.junit.jupiter.api.Assertions.*; - -import java.util.Arrays; -import java.util.function.LongConsumer; - -import org.junit.jupiter.api.Test; - -import era.mi.logic.Bit; -import era.mi.logic.Simulation; -import era.mi.logic.components.Mux2; -import era.mi.logic.components.gates.AndGate; -import era.mi.logic.components.gates.NotGate; -import era.mi.logic.components.gates.OrGate; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayInput; - -class ComponentTest -{ - -// @Test -// void circuitExampleTest() -// { -// Simulation.TIMELINE.reset(); -// WireArray a = new WireArray(1, 1), b = new WireArray(1, 1), c = new WireArray(1, 10), d = new WireArray(2, 1), e = new WireArray(1, 1), -// f = new WireArray(1, 1), g = new WireArray(1, 1), h = new WireArray(2, 1), i = new WireArray(2, 1), j = new WireArray(1, 1), k = new WireArray(1, 1); -// new AndGate(1, a, b, f); -// new NotGate(1, f, g); -// new Merger2(h, c, g); -// new Mux(1, h, d, e, i); -// new Splitter(i, k, j); -// -// a.createInput().feedSignals(Bit.ZERO); -// b.createInput().feedSignals(Bit.ONE); -// c.createInput().feedSignals(Bit.ZERO); -// d.createInput().feedSignals(Bit.ONE, Bit.ONE); -// e.createInput().feedSignals(Bit.ONE); -// -// while(Simulation.TIMELINE.hasNext()) -// { -// Simulation.TIMELINE.executeNext(); -// } -// -// assertEquals(Simulation.TIMELINE.getSimulationTime(), 14); -// assertEquals(Bit.ONE, j.getValue()); -// assertEquals(Bit.ZERO, k.getValue()); -// } -// -// @Test -// void splitterTest() -// { -// Simulation.TIMELINE.reset(); -// WireArray a = new WireArray(3, 1), b = new WireArray(2, 1), c = new WireArray(3, 1), in = new WireArray(8, 1); -// in.createInput().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO,Bit.ONE, Bit.ZERO, Bit.ONE); -// new Splitter(in, a, b, c); -// -// while(Simulation.TIMELINE.hasNext()) -// { -// Simulation.TIMELINE.executeNext(); -// } -// -// assertTrue(Arrays.equals(a.getValues(), new Bit[] { Bit.ZERO, Bit.ONE, Bit.ZERO })); -// assertTrue(Arrays.equals(b.getValues(), new Bit[] { Bit.ONE, Bit.ZERO })); -// assertTrue(Arrays.equals(c.getValues(), new Bit[] { Bit.ONE, Bit.ZERO, Bit.ONE })); -// } -// -// @Test -// void mergerTest() -// { -// Simulation.TIMELINE.reset(); -// WireArray a = new WireArray(3, 1), b = new WireArray(2, 1), c = new WireArray(3, 1), out = new WireArray(8, 1); -// a.createInput().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO); -// b.createInput().feedSignals(Bit.ONE, Bit.ZERO); -// c.createInput().feedSignals(Bit.ONE, Bit.ZERO, Bit.ONE); -// -// new Merger2(out, a, b, c); -// -// while(Simulation.TIMELINE.hasNext()) -// { -// Simulation.TIMELINE.executeNext(); -// } -// -// assertTrue(Arrays.equals(out.getValues(), new Bit[] { Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE })); -// } - - @Test - void muxTest() - { - Simulation.TIMELINE.reset(); - WireArray a = new WireArray(1, 3), b = new WireArray(1, 2), select = new WireArray(1, 1), out = new WireArray(1, 1); - WireArrayInput selectIn = select.createInput(); - - selectIn.feedSignals(Bit.ZERO); - a.createInput().feedSignals(Bit.ONE); - b.createInput().feedSignals(Bit.ZERO); - - new Mux2(1, out, select, a, b); - assertEquals(Bit.Z, out.getValue()); - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - - assertEquals(Bit.ONE, out.getValue()); - selectIn.feedSignals(Bit.ONE); - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - - assertEquals(out.getValue(), Bit.ZERO); - } - - @Test - void andTest() - { - Simulation.TIMELINE.reset(); - AndGate gate = new AndGate(1, new WireArray(4, 1), new WireArray(4, 1), new WireArray(4, 1)); - gate.getA().createInput().feedSignals(Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ZERO); - gate.getB().createInput().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); - - - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - assertTrue(Arrays.equals(gate.getOut().getValues(), new Bit[] { Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ZERO })); - } - - @Test - void orTest() - { - Simulation.TIMELINE.reset(); - OrGate gate = new OrGate(1, new WireArray(4, 1), new WireArray(4, 1), new WireArray(4, 1)); - gate.getA().createInput().feedSignals(Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ZERO); - gate.getB().createInput().feedSignals(Bit.ZERO, Bit.ONE, Bit.ZERO, Bit.ONE); - - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - - assertTrue(Arrays.equals(gate.getOut().getValues(), new Bit[] { Bit.ONE, Bit.ONE, Bit.ZERO, Bit.ONE })); - } - - @Test - void rsLatchCircuitTest() - { - Simulation.TIMELINE.reset(); - WireArray r = new WireArray(1, 1), s = new WireArray(1, 1), t1 = new WireArray(1, 15), t2 = new WireArray(1, 1), q = new WireArray(1, 1), - nq = new WireArray(1, 1); - - new OrGate(1, r, nq, t2); - new OrGate(1, s, q, t1); - new NotGate(1, t2, q); - new NotGate(1, t1, nq); - - WireArrayInput sIn = s.createInput(), rIn = r.createInput(); - - sIn.feedSignals(Bit.ONE); - rIn.feedSignals(Bit.ZERO); - - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - - assertEquals(q.getValue(), Bit.ONE); - assertEquals(nq.getValue(), Bit.ZERO); - - sIn.feedSignals(Bit.ZERO); - - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - - assertEquals(q.getValue(), Bit.ONE); - assertEquals(nq.getValue(), Bit.ZERO); - - rIn.feedSignals(Bit.ONE); - - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - - assertEquals(q.getValue(), Bit.ZERO); - assertEquals(nq.getValue(), Bit.ONE); - } - - @Test - void numericValueTest() - { - Simulation.TIMELINE.reset(); - - WireArray a = new WireArray(4, 1); - a.createInput().feedSignals(Bit.ONE, Bit.ONE, Bit.ONE, Bit.ONE); - - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - - assertEquals(a.getUnsignedValue(), 15); - assertEquals(a.getSignedValue(), -1); - } - - @Test - void multipleInputs() - { - Simulation.TIMELINE.reset(); - WireArray w = new WireArray(2, 1); - WireArrayInput wI1 = w.createInput(), wI2 = w.createInput(); - wI1.feedSignals(Bit.ONE, Bit.Z); - wI2.feedSignals(Bit.Z, Bit.X); - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - assertTrue(Arrays.equals(w.getValues(), new Bit[] { Bit.ONE, Bit.X })); - - wI2.feedSignals(Bit.ZERO, Bit.Z); - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - assertTrue(Arrays.equals(w.getValues(), new Bit[] { Bit.X, Bit.Z })); - - wI2.feedSignals(Bit.Z, Bit.Z); - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - assertTrue(Arrays.equals(w.getValues(), new Bit[] { Bit.ONE, Bit.Z })); - - wI2.feedSignals(Bit.ONE, Bit.Z); - w.addObserver((i) -> fail("WireArray notified observer, although value did not change.")); - while(Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - } - assertTrue(Arrays.equals(w.getValues(), new Bit[] { Bit.ONE, Bit.Z })); - } - - @Test - void wireConnections() - { - // Nur ein Experiment, was über mehrere 'passive' Bausteine hinweg passieren würde - - Simulation.TIMELINE.reset(); - - WireArray a = new WireArray(1, 2); - WireArray b = new WireArray(1, 2); - WireArray c = new WireArray(1, 2); - WireArrayInput aI = a.createInput(); - WireArrayInput bI = b.createInput(); - WireArrayInput cI = c.createInput(); - - TestBitDisplay test = new TestBitDisplay(c); - LongConsumer print = time -> System.out.format("Time %2d\n %s\n %s\n %s\n", time, a, b, c); - - cI.feedSignals(Bit.ONE); - test.assertAfterSimulationIs(print, Bit.ONE); - - cI.feedSignals(Bit.X); - test.assertAfterSimulationIs(print, Bit.X); - - cI.feedSignals(Bit.X); - cI.feedSignals(Bit.Z); - test.assertAfterSimulationIs(print, Bit.Z); - - Connector c1 = new Connector(b, c); - test.assertAfterSimulationIs(print, Bit.Z); - System.out.println("ONE"); - bI.feedSignals(Bit.ONE); - test.assertAfterSimulationIs(print, Bit.ONE); - System.out.println("ZERO"); - bI.feedSignals(Bit.ZERO); - test.assertAfterSimulationIs(print, Bit.ZERO); - System.out.println("Z"); - bI.feedSignals(Bit.Z); - test.assertAfterSimulationIs(Bit.Z); - } - - private static void assertBitArrayEquals(Bit[] actual, Bit... expected) - { - assertArrayEquals(expected, actual); - } -} diff --git a/era.mi/src/era/mi/logic/tests/Connector.java b/era.mi/src/era/mi/logic/tests/Connector.java deleted file mode 100644 index d59ee8c0..00000000 --- a/era.mi/src/era/mi/logic/tests/Connector.java +++ /dev/null @@ -1,38 +0,0 @@ -package era.mi.logic.tests; - -import era.mi.logic.Simulation; -import era.mi.logic.wires.WireArray; -import era.mi.logic.wires.WireArray.WireArrayInput; -import era.mi.logic.wires.WireArrayObserver; - -public class Connector implements WireArrayObserver -{ - private final WireArray a; - private final WireArray b; - private final WireArrayInput aI; - private final WireArrayInput bI; - - public Connector(WireArray a, WireArray b) - { - if (a.length != b.length) - throw new IllegalArgumentException("WireArray width does not match: " + a.length + ", " + b.length); - this.a = a; - this.b = b; - a.addObserver(this); - b.addObserver(this); - aI = a.createInput(); - bI = b.createInput(); - } - - @Override - public void update(WireArray initiator) - { - Simulation.TIMELINE.addEvent((e) -> - { - if (initiator == a) - bI.feedSignals(a.getValues()); - else - aI.feedSignals(b.getValues()); - }, 1); - } -} diff --git a/era.mi/src/era/mi/logic/tests/TestBitDisplay.java b/era.mi/src/era/mi/logic/tests/TestBitDisplay.java deleted file mode 100644 index 99131163..00000000 --- a/era.mi/src/era/mi/logic/tests/TestBitDisplay.java +++ /dev/null @@ -1,48 +0,0 @@ -package era.mi.logic.tests; - -import static org.junit.jupiter.api.Assertions.assertArrayEquals; - -import java.util.Arrays; -import java.util.function.LongConsumer; - -import era.mi.logic.Bit; -import era.mi.logic.Simulation; -import era.mi.logic.components.BitDisplay; -import era.mi.logic.wires.WireArray; - -public final class TestBitDisplay extends BitDisplay -{ - - public TestBitDisplay(WireArray in) - { - super(in); - } - - public void assertDisplays(Bit... expected) - { - assertArrayEquals(expected, getDisplayedValue()); - } - - public void assertAfterSimulationIs(Bit... expected) - { - Simulation.TIMELINE.executeAll(); - assertDisplays(expected); - } - - public void assertAfterSimulationIs(LongConsumer r, Bit... expected) - { - while (Simulation.TIMELINE.hasNext()) - { - Simulation.TIMELINE.executeNext(); - r.accept(Simulation.TIMELINE.getSimulationTime()); - } - assertDisplays(expected); - } - - @Override - protected void compute() - { - super.compute(); - System.out.println("update: value is " + Arrays.toString(getDisplayedValue())); - } -} diff --git a/era.mi/src/era/mi/logic/timeline/Timeline.java b/era.mi/src/era/mi/logic/timeline/Timeline.java deleted file mode 100644 index 2392f4c2..00000000 --- a/era.mi/src/era/mi/logic/timeline/Timeline.java +++ /dev/null @@ -1,95 +0,0 @@ -package era.mi.logic.timeline; - -import java.util.PriorityQueue; - -/** - * Orders Events by the time they are due to be executed. Can execute Events individually. - * @author Fabian Stemmler - * - */ -public class Timeline -{ - private PriorityQueue events; - private long currentTime = 0; - - public Timeline(int initCapacity) - { - events = new PriorityQueue(initCapacity, (a, b) -> { - long difference = a.getTiming() - b.getTiming(); - if(difference == 0) - return 0; - return difference < 0 ? -1 : 1; - }); - } - - public boolean hasNext() - { - return !events.isEmpty(); - } - - public void executeNext() - { - InnerEvent first = events.poll(); - currentTime = first.getTiming(); - first.run(); - } - - public void executeAll() - { - while (hasNext()) - executeNext(); - } - - public long getSimulationTime() - { - return currentTime; - } - - public void reset() - { - events.clear(); - currentTime = 0; - } - - /** - * Adds an Event to the {@link Timeline} - * @param function The {@link TimelineEventHandler} that will be executed, when the {@link InnerEvent} occurs on the timeline. - * @param relativeTiming The amount of MI ticks in which the {@link InnerEvent} is called, starting from the current time. - */ - public void addEvent(TimelineEventHandler function, int relativeTiming) - { - long timing = currentTime + relativeTiming; - events.add(new InnerEvent(function, new TimelineEvent(timing), timing)); - } - - private class InnerEvent - { - - private final long timing; - private final TimelineEventHandler function; - private final TimelineEvent event; - - /** - * Creates an {@link InnerEvent} - * @param function {@link TimelineEventHandler} to be executed when the {@link InnerEvent} occurs - * @param timing Point in the MI simulation {@link Timeline}, at which the {@link InnerEvent} is executed; - */ - InnerEvent(TimelineEventHandler function, TimelineEvent event, long timing) - { - this.function = function; - this.event = event; - this.timing = timing; - } - - public long getTiming() - { - return timing; - } - - public void run() - { - function.handle(event); - } - - } -} \ No newline at end of file diff --git a/era.mi/src/era/mi/logic/timeline/TimelineEvent.java b/era.mi/src/era/mi/logic/timeline/TimelineEvent.java deleted file mode 100644 index 6cec9079..00000000 --- a/era.mi/src/era/mi/logic/timeline/TimelineEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -package era.mi.logic.timeline; - -public class TimelineEvent -{ - private final long timing; - - TimelineEvent(long timing) - { - super(); - this.timing = timing; - } - - public long getTiming() - { - return timing; - } -} \ No newline at end of file diff --git a/era.mi/src/era/mi/logic/timeline/TimelineEventHandler.java b/era.mi/src/era/mi/logic/timeline/TimelineEventHandler.java deleted file mode 100644 index 59a91c95..00000000 --- a/era.mi/src/era/mi/logic/timeline/TimelineEventHandler.java +++ /dev/null @@ -1,6 +0,0 @@ -package era.mi.logic.timeline; - -public interface TimelineEventHandler -{ - public void handle(TimelineEvent e); -} \ No newline at end of file diff --git a/era.mi/src/era/mi/logic/wires/WireArray.java b/era.mi/src/era/mi/logic/wires/WireArray.java deleted file mode 100644 index 8cceebef..00000000 --- a/era.mi/src/era/mi/logic/wires/WireArray.java +++ /dev/null @@ -1,307 +0,0 @@ -package era.mi.logic.wires; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import era.mi.logic.Bit; -import era.mi.logic.Simulation; - -/** - * Represents an array of wires that can store n bits of information. - * @author Fabian Stemmler - * - */ -public class WireArray -{ - private Bit[] values; - public final int travelTime; - private List observers = new ArrayList(); - public final int length; - private List inputs = new ArrayList(); - - public WireArray(int length, int travelTime) - { - if(length < 1) - throw new IllegalArgumentException("Tried to create an array of wires with length " + length + ", but a length of less than 1 makes no sense."); - this.length = length; - this.travelTime = travelTime; - initValues(); - } - - private void initValues() - { - values = new Bit[length]; - for(int i = 0; i < length; i++) - values[i] = Bit.Z; - } - - private void recalculateSingleInput() - { - WireArrayInput input = inputs.get(0); - if(!Arrays.equals(input.getValues(), values)) - { - System.arraycopy(input.getValues(), 0, values, 0, length); - notifyObservers(); - } - } - - private void recalculateMultipleInputs() - { - Iterator it = inputs.iterator(); - Bit[] newValues = it.next().values.clone(); - - while(it.hasNext()) - { - WireArrayInput input = it.next(); - Bit[] bits = input.getValues(); - for(int i = 0; i < length; i++) - { - if(Bit.Z.equals(bits[i]) || newValues[i].equals(bits[i])) - continue; - else if(Bit.Z.equals(newValues[i])) - newValues[i] = bits[i]; - else - newValues[i] = Bit.X; - } - } - - if(!Arrays.equals(newValues, values)) - { - notifyObservers(); - values = newValues; - } - } - - private void recalculate() - { - switch(inputs.size()) - { - case 0: - return; - case 1: - recalculateSingleInput(); - break; - default: - recalculateMultipleInputs(); - } - } - - /** - * The WireArray is interpreted as an unsigned integer with n bits. - * @return true if all bits are either Bit.ONE or Bit.ZERO (they do not all have to have the same value), not Bit.X or Bit.Z. false is returned otherwise. - * - * @author Fabian Stemmler - */ - public boolean hasNumericValue() - { - for(Bit b : values) - { - if(b != Bit.ZERO && b != Bit.ONE) - return false; - } - return true; - } - - /** - * The WireArray is interpreted as an unsigned integer with n bits. - * @return The unsigned value of the {@link WireArray}'s bits, where value 0 corresponds with 2^0, value 1 is 2^1 and so on. - * - * @author Fabian Stemmler - */ - public long getUnsignedValue() - { - long val = 0; - long mask = 1; - for(int i = 0; i < length; i++) - { - switch(values[i]) - { - default: - case Z: - case X: - return 0; //TODO: Proper handling for getUnsignedValue(), if not all bits are 1 or 0; Random number? - case ONE: - val |= mask; - break; - case ZERO: - } - mask = mask << 1; - } - return val; - } - - /** - * The WireArray is interpreted as a signed integer with n bits. - * @return The signed value of the {@link WireArray}'s bits, where value 0 corresponds with 2^0, value 1 is 2^1 and so on. - * - * @author Fabian Stemmler - */ - public long getSignedValue() - { - long val = getUnsignedValue(); - long mask = 1 << (length - 1); - if((mask & val) != 0) - { - int shifts = 64 - length; - return (val << shifts) >> shifts; - } - return val; - } - - /** - * Included for convenient use on {@link WireArray}s of length 1. - * @return The value of bit 0. - * - * @author Fabian Stemmler - */ - public Bit getValue() - { - return getValue(0); - } - - /** - * - * @param index Index of the requested bit. - * @return The value of the indexed bit. - * - * @author Fabian Stemmler - */ - public Bit getValue(int index) - { - return values[index]; - } - - public Bit[] getValues(int start, int end) - { - int length = end - start; - Bit[] bits = new Bit[length]; - System.arraycopy(values, start, bits, 0, length); - return bits; - } - - - /** - * @return An array of length n containing the values of the n bits in the {@link WireArray}. Can be safely modified. - * - * @author Fabian Stemmler - */ - public Bit[] getValues() - { - return values.clone(); - } - - /** - * Adds an {@link WireArrayObserver}, who will be notified when the value of the {@link WireArray} is updated. - * @param ob The {@link WireArrayObserver} to be notified of changes. - * @return true if the given {@link WireArrayObserver} was not already registered, false otherwise - * - * @author Fabian Stemmler - */ - public boolean addObserver(WireArrayObserver ob) - { - return observers.add(ob); - } - - private void notifyObservers() - { - for(WireArrayObserver o : observers) - o.update(this); - } - - public WireArrayInput createInput() - { - return new WireArrayInput(this); - } - - private void registerInput(WireArrayInput toRegister) - { - inputs.add(toRegister); - } - - public class WireArrayInput { - public final WireArray owner; - private Bit[] values; - - private WireArrayInput(WireArray owner) { - super(); - this.owner = owner; - initValues(); - owner.registerInput(this); - } - - private void initValues() - { - values = new Bit[length]; - for(int i = 0; i < length; i++) - values[i] = Bit.Z; - } - - /** - * Sets the wires values. This takes up time, as specified by the {@link WireArray}s travel time. - * @param newValues The new values the wires should take on. - * - * @author Fabian Stemmler - */ - public void feedSignals(Bit... newValues) - { - if(newValues.length == length) - { - feedSignals(0, newValues); - } - else - throw new IllegalArgumentException("Attempted to input " + newValues.length + " bits instead of " + length + " bits."); - } - - /** - * Sets values of a subarray of wires. This takes up time, as specified by the {@link WireArray}s travel time. - * @param newValues The new values the wires should take on. - * @param startingBit The first index of the subarray of wires. - * - * @author Fabian Stemmler - */ - public void feedSignals(int startingBit, Bit... newValues) - { - Simulation.TIMELINE.addEvent((e) -> setValues(startingBit, newValues), travelTime); - } - - private void setValues(int startingBit, Bit... newValues) - { - int exclLastIndex = startingBit + newValues.length; - if(length < exclLastIndex) - throw new ArrayIndexOutOfBoundsException("Attempted to input bits from index " + startingBit + " to " - + exclLastIndex + " when there are only " + length + "wires."); - if(!Arrays.equals(values, startingBit, exclLastIndex, newValues, 0, newValues.length)) - { - System.arraycopy(newValues, 0, values, startingBit, newValues.length); - owner.recalculate(); - } - } - - public Bit[] getValues() - { - return values.clone(); - } - - public void clearSignals() - { - Bit[] bits = new Bit[length]; - for(int i = 0; i < length; i++) - bits[i] = Bit.Z; - feedSignals(bits); - } - - @Override - public String toString() - { - return Arrays.toString(values); - } - } - - @Override - public String toString() - { - return String.format("wire 0x%08x value: %s inputs: %s", hashCode(), Arrays.toString(values), inputs); - } -} diff --git a/era.mi/src/era/mi/logic/wires/WireArrayObserver.java b/era.mi/src/era/mi/logic/wires/WireArrayObserver.java deleted file mode 100644 index c0766a2b..00000000 --- a/era.mi/src/era/mi/logic/wires/WireArrayObserver.java +++ /dev/null @@ -1,6 +0,0 @@ -package era.mi.logic.wires; - -public interface WireArrayObserver -{ - public void update(WireArray initiator); -} -- 2.17.1