From: Luke Kenneth Casson Leighton Date: Sat, 23 Jan 2021 21:43:36 +0000 (+0000) Subject: move sanity-checks, add mode into svp64_rm X-Git-Tag: 24jan2021_ls180~1 X-Git-Url: https://git.libre-soc.org/?p=soc.git;a=commitdiff_plain;h=e73b963497852ecb573bd9ac04ac12c458279651;ds=sidebyside move sanity-checks, add mode into svp64_rm --- diff --git a/src/soc/sv/trans/svp64.py b/src/soc/sv/trans/svp64.py index a5dcf15c..79090c96 100644 --- a/src/soc/sv/trans/svp64.py +++ b/src/soc/sv/trans/svp64.py @@ -471,6 +471,17 @@ class SVP64: elif encmode == 'svm': # sub-vector mode mapreduce_svm = True + # sanity-check that 2Pred mask is same mode + if has_pmask and has_smask: + assert smmode == pmmode, \ + "predicate masks %s and %s must be same reg type" % \ + (pme, sme) + + # sanity-check that twin-predication mask only specified in 2P mode + if ptype == '1P': + assert has_smask == False, \ + "source-mask can only be specified on Twin-predicate ops" + # construct the mode field, doing sanity-checking along the way if mapreduce_svm: @@ -540,19 +551,10 @@ class SVP64: assert rc_mode, "pr-mode BO only possible when Rc=1" mode |= (predresult << 2) # set BO - # whewww.... modes all done... :) + # whewww.... modes all done :) + # now put into svp64_rm mode |= sv_mode - - # sanity-check that 2Pred mask is same mode - if has_pmask and has_smask: - assert smmode == pmmode, \ - "predicate masks %s and %s must be same reg type" % \ - (pme, sme) - - # sanity-check that twin-predication mask only specified in 2P mode - if ptype == '1P': - assert has_smask == False, \ - "source-mask can only be specified on Twin-predicate ops" + svp64_rm |= (mode << 19) # mode: bits 19-23 # put in predicate masks into svp64_rm if ptype == '2P':