So, far you know we have studied about modulation and signal beating, but the question to us is you know how do I find out this modulated signal which has been carried by a carrier signal. We talked about amplitude modulated signal, how a carrier frequency carries a modulated frequency. The information from the machinery to us is actually the modulated signal. So, when you looked at the amplitude modulated signal in time domain, we had a signal of this nature wherein this is the high frequency carrier signal. This may not be of interest to us, but it is this envelope. If you look at this envelope which is a low frequency signal as you can see from the time period is actually the signal which contains information which will be useful for machinery diagnostics. The question before us is you know if we go to a real machinery we would be having such signals on top of it there will be lot of noise. So, question is once I do an FFT of such a signal which has the high frequency signal which has the noise etcetera in the frequency spectrum the significance of this green signal in our case will be lost. It will be kind of buried in a high frequency noise. There will be lot of high frequency noise and then how do I identify this or well intuitively you can write a say you know why do not we filter it. We will filter it filter the high frequency signals. So, that the green signals in the low frequency green signals are available that is fine. It is people can do it that way and people also do that way that putting a high pass filter where they when sorry rather a low pass filter wherein they will remove certain high frequency components and look into the low frequency signal. But sometimes it happens that even in this low frequencies there is lot of noise or other phenomena happening which kind of obscures this green signal. So, we have to find out ways to find out this low frequency envelope. So, this happens because of signal modulation. So, at the at the generation point of the signal there is a modulation effect happening because of the frequency of one being related to other or one being caused by the other like the case of the rottering fans which I was telling you about. So, signal has got modulated it has come to us as a modulated signal. So, our objective on how is to demodulate the signal. So, this demodulation has to be done by one is I can put a set of low pass filters and then there are another another technique which you will be covering mostly today is this Hilbert transform. But the problem with low pass filter as you will realize is we do not know the frequency content of the signal. So, what will be my cutoff frequency of the low pass filter is a very difficult thing to establish, but you know diagnosticians or analysts who do with certain signals they play around with the low pass frequency the cutoff frequency of the low pass filter and see whether any meaningful information is being obtained in the low pass low side of the frequency spectrum that is one way wherein just by analog filtering we can do some sort of a demodulation. But now there are well established digital signal processing techniques using Hilbert transform which will demodulated demodulate the signal to find out its envelope. So, envelope which we call as envelope analysis is nothing, but it is also signal demodulation because I need to find out the low frequency signal which is coming as an envelope I can demodulate the demodulate the measured signal and then I can get the information about the signal. Once this signal has been demodulated or envelope analyzed I can then do my traditional FFT to find out its frequency content. So, demodulation itself is in time domain or the low pass filters you know we set it in all the signals from this filters are again in time domain after the Hilbert transform also the signals are in time domain. So, and after we have got this time domain signal and that was that green envelope signal which I talked about we can do further signal processing like an FFT analysis. Now I will before I go to the process of doing demodulation or envelope analysis let me give you one example as to how this demodulation this modulation occurs in a real machinery and then how we can demodulate it to find out the defect frequencies of that machinery. Let us take the case of a simple ball bearing. So, ball bearing actually has you know many elements this is known as the outer rays which is usually stationary and this is the inner rays and these are the rolling elements and these are the balls or rollers. Now there are possible scenarios this is rotating and this is usually fixed the outer rays is fixed in our case and this is rotating. Now there could be few possible cases that I have a defect located here in the outer rays. In this case if you will imagine if you look at the time signal and each time this balls basically this balls will spin and rotate around the inner rays and outer rays and they have this rotating frequencies that can be calculated from the dimensions which will come to later on. There are different because the shaft is rotating at n rpm all this will be relative to n rpm you know some will be little higher some will be little lower and so on.  As many times the balls hit this defect I will be getting a continuous pulse of impacts ok. Now this impact the frequency of the impact is actually inverse of the time period and that relates to the speed at which the balls are going over the defect ok. But the phenomena is actually inside this impact if you if you imagine if I one of one such impacts may be you will get a ringing signal like this. The frequency which is there or which is characteristic of this defect is actually inside this. This is one way of getting an uniform signal out of this bearing because of defect in the outer rays. On the other hand suppose the defect was there in the inner rays let me put it here ok and because the shaft carry a load and load is always acting downward some load double. So each time the defect comes under the load axis there is a great amount of force on this defect here and the outer inner rays and then once the inner rays moves away this force will decrease and so on. So the intensity of the vibration will be modulated as the as a function of the rotational speed and if I was to draw it here I will have one defect in time domain. This high peaks means the I R defect is right on the axis of the load on the shaft acting downwards and of course this is the vibration signal. So you will see that there is again a effect of modulation occurring here. So this is how physically a modulation also occurs ok. Now if I am talking about a gear box with intermediate shafts you can imagine there are about 6 to 7 bearings and you see because if I have put just one transducer on the machine and this transducer suppose it is to measure. Now I am going to explain to you the severity and the magnitude of the vibration levels and what kind of contamination a transducer may be having. Suppose this is my shaft this is my gear box ok. There are bearings here bearings in the holding the intermediate shaft and there could be gears this is my input shaft output shaft. If I just put one transducer somewhere here and these are all the gears bearing B1, B2, B3, B4, B5, B6 a simple gear box has in a B1 to B6 bearings G1 to G4 gears and I have one transducer T1. So the signal measured by this transducer T1 could have everything. The problem before me is to identify from signal processing which bearing is defective and this is what in reality we face the problem. So the effects of suppose there are few bearings which are having defect there are couple of gears which are having defect.  So the problem before us is how do I find out which bearing is defective. So we have to know the characteristic frequencies of each of this gears and bearings and specifically if I come to one bearing one bearing itself the inner rest there could be a defect outer rest there could be a defect in the rolling elements there could be a defect. So all these defects will have characteristic frequencies and these frequencies we will tell later how they can be calculated once you know the rotational speed and the dimensions and the number of rolling elements. So if the frequencies are known to us beforehand I am sure that in this signal these frequencies are buried they are there but then we have to have a right kind of eye or magnifying glass if you may say so to look into them and find out what these frequencies are. So the envelope analysis is one such technique or signal demodulation is one such technique by which I can find out these characteristic frequencies. So nowadays in the FFT analyzers which are available there is an option of doing FFT after envelope analysis we do the fast Fourier transform not of the total signal but only of the signal which is carrying the information. I am not interested to know about the carrier frequency okay I am not interested to know the rotational speed I am interested to know whether my defects which are showing as modulated signals which are showing as that envelope can be detected in the signal. So envelope analysis is that way a very very powerful technique for signal processing. Now as I was telling you filtering is one method of finding out the envelope in a signal but the another method is this technique known as the Hilbert transform. So before I go into Hilbert transform I just wanted to briefly tell you about this signals which are one is an amplitude modulated case if I have this amplitude as a function of cosine or a sine series this is the frequency of modulation and then this is the carrier frequency you will see that the amplitude the modulated signal can be represented as this equation and you will see the sum and difference signals also show up and that is what we did by what is known as the side bands occur because of a modulated signal okay and apart from the carrier frequency but the just to recall if the signals were beating you would not see an individual frequency you will only see the sum and difference frequencies but once they are modulating you will see an individual carrier frequency and the side bands around the carrier frequency as fc plus fm and fc minus fm and then once you have the frequency modulated you will see lot of symmetrical side bands okay and given by this number k here. So fc plus k k could be 1, 2, 3 so there are lot of symmetrical side bands will occur and this particularly occurs in gear boxes we will see practical examples later on the question is we know how to detect side bands because of signal modulation okay but question is if I am just interested to know fm it becomes a problem for me because fm could be a very very low frequency signal how do I find out that fm from signal analysis okay so that is the problem we have in front of us. So there is one mathematical technique which we do for example if the 2 signals are beating I will get this kind of waveform and amplitude modulated signal would also look like this as you would have seen so the this signals here are actually a high frequency carrier signals because this number of data points are 1000 here and that the time period here could be dependent on the sampling frequency whatever sampling frequency is taken here so number of data points times delta t so delta t will be total time period will be just recollect total time period nothing but n times delta t which is nothing but n times 1 by fs n by fs so total time period of a block if n is equal to 1000 fs is whatever you will get that many seconds here. Now the question is I am interested to find out the this envelope here how do I do that there is a technique which is very widely used Hilbert transform in this what happens is this is a mathematical expression of the Hilbert transform okay we generate an analytical signal z t here which is the original signal x t plus the imaginary part is the Hilbert transform of this signal x t okay. So this analytical signal actually if you do the fft of the envelope signal we will get what is known I mean sorry the analytical signal itself is going to give you the envelope of the signal and this can be done in the software MATLAB to use the function Hilbert on an amplitude modulated signal we will get the envelope. Now if you look here this is the envelope which was of the beating signal which has been obtained by just doing Hilbert transform of that beating signal and this you all can do in software like MATLAB etcetera very easily. So no matter what because this is the low frequency signal which has been carried by my high frequency carriers if you look at the high frequency carrier here okay this high frequency carrier has is carrying this modulated signal and I am interested to know this envelope and I will not go into the mathematical details of this transformation but it suffice to say by just by doing Hilbert transform of the signal you will get an analytical signal wherein you can get the instantaneous frequency of the signal you can get the phase angle of the signal I will not go into the details of this right now and then we will very easily get the envelope and this envelope can be you can do the frequency analysis of this envelope signal so that you can find out the properties of the signal frequency contents of the signal. So envelope analysis of the bearing signals can be done and then we can get the low frequency bearing defect signals because if you will recollect this bearings, bearings are elastic members say let me take the case of an outer race just an outer race say bearing is used in a machinery wherein the maximum rpm is 3000 rpm and that boils down to 3060 that is 50 hertz so any operation in this bearing is going to produce a 50 hertz excitation frequency right or few multiples of it at the most maybe if it is 10 times the fundamental rate this could be 500 hertz so the external forcing function external forcing frequency on the bearing is about 500 hertz imagine because this is an elastic material it has its mass it has its density it has its stiffness etcetera. So this rings also have their natural frequency we can model them itself some equivalent stiffness and mass obviously a bearing designer is not going to design a bearing whose natural frequencies are in this range otherwise you know every time the bearing is in operation it will get excited at its resonance so no designer would do that usually as a thumb rule the natural frequencies of the structural elements of the bearings are much much higher and above 20 kilo hertz ok so that during the operation of a bearing these do not get excited the bearing does not have large motions because of its resonating conditions but you can think of it another way suppose now this outer race there is a defect as a pit as if you are going on a road and suddenly there is a pit so if this balls are travelling spinning and travelling on this outer race what is going to happen that if I come across this pit on the outer race I am going to have an impulse this will be an impulse excitation as if something has hit the outer race as if you have banged on it like you go on a bump or a pothole on the road you feel that impulse so this bearing has got excited by an impulse read now I will draw your attention to your earlier theories on Fourier analysis any time domain signal 80 suppose this is a very small signal of dimension tau tau becomes very very small its response in the frequency domain will be very very large and you perhaps would have done this as a homework I believe and so on ok or if this is this tau tends to 0 I will have the frequency response of a similar to a broadband excitation that means here because of an impulse where time period is very small the frequency response is very very large time and frequency are inversely related so now if I go back to the example of my rolling element bearing is getting excited by a frequency because of a small defect which looks something like this or something like this ok almost close to an excitation where all frequencies are present ok so if this mechanical system which has a stiffness which has a natural frequency omega n k by m is getting excited by a forcing function wherein all the frequencies are getting excited obviously its natural frequency will get excited if I was to pose the problem another way suppose I can model the bearing by this set of equation by a forcing vector in the right hand side so this force is actually this in the frequency in the this in time domain but in the frequency domain this would look like this that means what the system in this case the bearing has got excited at all the frequencies and it has got excited at its resonant frequencies so I am going to have a resonant condition for it is known as the high frequency technique h f r t so in this case what happens if I go to the bearing signal on top of the amplitude modulated signal I will have if I was just to draw them visually on top of it I will have also large motion so I have a high frequency resonant technique a resonance phenomenon occurring on top of it I have the low frequency amplitude modulation and my transducer is not a mathematician transducer cannot understand all this transducer will faithfully represent my mechanical vibrations as an electrical signal and it will only give me this so it is we through our technique we have to understand whether resonant resonant has a resonance has occurred or whether a modulation is occurring because in such large motions very very low frequency small amplitude amplitude modulation will be obscured on top of it there will be so much of signal noise okay so we have to again find out by what method I can be sure that defect in the bearing has occur so one way is to monitor the high frequency vibrations anything greater than 20 kilo Hertz so because of an impact or because if you say because of a shock this is constituted as a shock because of a shock large motions occur and they occur at high frequencies so traditionally or conventionally there are many products one such is the shock pulse meter or SPM this essentially means to measure the bearings response at frequencies beyond 20 kilo Hertz to check whether the bearings resonance has been excited or not well who is exciting the bearings resonance it is not the normal operating function of a bearing but it is if there is a defect like a pit like defect in the inner s outer s because of this pit I am getting an impulse and this impulses frequency response is a wide band response which has excited the right hand side of the equation so I am getting large motions at the resonant frequencies of this bearing and as a bearing designer they would they always make sure that the bearings natural frequency are not in the operating frequencies of the bearing and they are at a frequencies much much higher than the operating zone and usually of the order of 20 kilo Hertz so in fact a vibration measurement at high frequencies is a sure indicator that a defect has occurred so in fact a shock pulse meter is nothing but a high frequency vibration meter so then we can say for sure that a defect has occurred but we have a little more diagnostic problem in the sense here well this defect is because of what is it because of an inner s is it because of a ball is it because of an outer s so from the geometry if I can calculate the defect frequencies okay this could be because of the inner s outer s ball or the fundamental trend frequency and I will tell you later on how this frequencies can be calculated once these frequencies are calculated we can then use the envelope analysis or signal demodulation to identify in the frequency spectrum whether these frequencies show up okay and then I will when we talk about the fault diagnostics and bearings I will give you certain actual measured values and measured spectrums of the inner s frequency outer s frequency after demodulation because if you will see I will just I will give you two frequencies spectrum one without envelope analysis one with envelope analysis one without envelope envelope analysis okay where this could be the defect frequencies but if I do it with the envelope analysis so this could be the IR defect this is 2 times x 3 times x and so on and these are IR this could be OR and this is what without envelope this is with envelope these are the vibration signals in fact the signals which have drawn here they are even much much I would say dirtier or noisier than this spectrum shown here so it becomes sometimes very very difficult to know whether it is an IR signal or a noise signal but once we do an FFT sorry envelope and then do an FFT all this modulated frequencies will very nicely show up but this is not to be confused with the shock pulse meter because shock pulse meter is a very very high frequency variation measurements which will only tell you about the level but with this envelope analysis I can find out the individual defect frequencies now I will give you another another example here as to you must have all realized this is this is from a plant very close to Kalapur where in this is a electrical motor it's a 3-4 electrical motor and then there is a blower basically they take in air and from the atmosphere and there are then there are series of blowers in this blower house there are about 5 such blowers and each one operating at close to 28-2900 rpm and then you will see all of this there are lot of valves here because this 5 blowers are in series and eventually they will take in the air and feed to the excuse me excuse me feed to the blast furnace okay now in this single room because there are 5 blowers what happens if one of them is having running at a frequency or a speed little less than even you know one rpm or a few rpms the frequency of these machines will be different and because they are close by you will happen they happen the phenomenon of beating is going to occur and if you enter such a place you will hear this kind of a loud you know decreasing increasing sound if you go to any plant wherein many machines are operating supposed to operate at the same speeds because of some reason or the other if some machine is running a little lower speed than the other you will hear this kind of this kind of waning voxing noise which happens even in the ship engine rooms also I believe because there will be machines which will be running not exactly at the same frequencies and this happens in the blowers also of course you know now the reason I wanted to show you this is this sometimes should not be confused as modulation okay because if you look at the response of a beating signal and a modulated signal they all look very similar in the time domain but if you look at the frequency contents of these rooms of these signals they are quite different in the amplitude modulated signals I will see side bands fm fc plus minus fm and also if I am interested to know fm I can do the signal demodulation or do the envelope analysis but if I want to do find out the two frequencies which are responsible for beating I can simply do a fast Fourier transform wherein I have to be sure that the delta f is very fine excuse me very fine okay to distinguish beating I need to have a frequency resolution where delta f has to be very very fine suppose we have one signal at so this is 10 hertz and this is 10 10.5 hertz if my delta f is 2 hertz I am never able to distinguish between these two signals isn't it but this signals would have created beating so in my frequency domain I can very easily mess this if delta f is kept at 2 hertz if delta f was equal to or less than 0.5 hertz I will be able to distinguish them so that is the problem while doing frequency analysis to identify beating otherwise I will just mess this and beating is because of independent independent frequencies because in this example this two blowers or two motors may not be having the same speed okay and they are independent one is not related to the other okay but then this will give rise to a beating phenomena as opposed to the case of the ball bearing wherein the defects and the frequencies which are related because if I have the inner rays rotating at one speed the outer rays the balls the their frequencies are all related to the inner rays frequencies okay and thus they modulate modulate because of the load modulate because of the speed and so on so amplitude modulation can be very nicely because you know if I if I have an FFT of a signal wherein there is a modulated frequency of a very low frequency FM this will be as I was telling you very easily obscured in other noises so envelope analysis is a excellent method to find out FM okay but there may not be any other frequencies next to FM if I have a finer resolutions I can check that but if I see other two frequencies 10.5 and 10 who are not related to each other then I can say the signals are independent and they are responsible for beating of the signal okay now in a in a plant like this and I should just mention it to you that in fact we at IIT Kharagpur had designed this enclosure for them just to kill this noise which was generated because of the beating because again if you see if I have one machine generating 100 decibel of noise another machine of course another 100 and 100 100 decibel of noise the sum effect will be 106 decibels but because of beating at some frequencies there will be a large amplitude and that amplitude will be very very loud so to reduce that we can do put an enclosure enclosure wherein you can put in lot of a lining material we will come to this later on but I will just show you another spectrum of this noise which was measured by the by which was measured and then we had analyzed this at that frequency now this what is here is a one-third octave spectrum we have talked about the different types of filter wherein I can have a fixed resolution filter wherein if a filter has an upper band and a lower band okay the bandwidth of the filter is upper band minus lower band in the fixed resolution case like we do in the narrow band when you do the narrow band analysis what happens is delta F we specify delta F how do you specify it is 1 by T 1 by n delta T it is equal to FS by n and that is fixed when we do the narrow band FFT analysis but if FFT analysis was not done but I am doing a frequency domain analysis by filtering I can set filters of different bandwidth I can set filters of constant bandwidth another world another filter is percentage bandwidth in percentage bandwidth there is a relationship between this upper frequency and lower frequency if the upper frequency is equal to twice of the lower frequency this is what is known as an octave band and its upper frequency is 2 to the power 1 by 3 FL this is a one-third octave band the reason we have octave band and one-third octave band there is a history behind it because you know our human ears can distinguish octaves of frequency very easily I may not my ear may not be able to distinguish 10 hertz and 10.5 hertz I may require an araband analyzer to distinguish between 10 and 10.5 hertz or 10 and 10.25 hertz but perhaps our human ear some of you can perhaps distinguish between 100 hertz or 200 hertz or 400 hertz or 1000 hertz because they are almost multiples so traditionally when FFT analysis was not being used people were using fixed band filters analog filters to do filtering and nowadays also since this has been predominantly used in the industry people stick to what is known as one-third octave band and if you look at this spectrum here this closely corresponds to about 500 600 some odd frequency which happens in this band you will see all the levels are pretty low but it sticks up around 600 this is 400 this is 1 kilo there is a one-third octave spectrum so there is a percentage bandwidth here around this is nothing but the electrical motors blade pass frequency because behind the electrical motor you know such large motors traditionally each of these motors was close to about 900 kilowatt of the power and you know this large motors and then the shaft which is rotating and this motors and running continuously and then they are all blowing in hot air you know this air finally goes to the furnace at a very very high flow rate so this motors and all become heated up so in fact in the rear of the motor there is a blower and this blower has a fan and this fan there are number of I think about 23 vanes so this air gets sucked in into the motor and this motor is getting cooled and then and this vane creates you know because it is a fan rotating at very very high speed this is what is responsible for the motor noise and this frequency has shown up here and if there are 5 such motors in that plant and there is a small variation in their speed this is giving rise to beating okay and obviously I cannot bring down the beating phenomena because for operational reasons some of the fans rotate at slightly lesser speed in the other one so all I can do is to reduce the effect of the large noise which is heard because of the beating is to put an enclosure on the motor of course there are other issues that this enclosure should not introduce you know should not increase the temperature inside the motor because the bearings which are there they are certain class they should not get overheated more than 75 degree Celsius because if you enclose it the cooling air capacity to the motor reduces and the bearings become hot so bearings may cease so you know it's there all it's like a domino effect so any plant if you see there are enough protections for the motor for the bearing for the vibration for the noise particularly for the bearing there we need to also have a round the clock temperature indicated to see whether the temperature is increasing or decreasing or staying still if the temperature increases we need to take precautions as to how to reduce the bearing temperature maybe we should have you know chillers on the enclosures when we have you know hot environment wherein the machines affect machines will get heated up because of an enclosure we need to have you know chilled cool air going in okay like an air conditioner small air conditioner put in fact such enclosures are there enclosures with having chillers then so the temperature does not increase okay so the purpose of this lecture was to demonstrate to you the two phenomena which occurs in machinery one is beating beating has occurred in this case of the blower and other is a signal modulation these are two phenomenons which occur and then we have to find out methods how to distinguish them to distinguish beating I have to have the frequency resolution reduced to distinguish amplitude modulation I have to do what is known as the envelope analysis envelope analysis could be done by low-pass filtering or it can be done by Hilbert transform okay and once we have understood the signals we can now diagnose the fault in the machine okay thank you


Good morning, everyone. Welcome to this morning's Mentoring Hour. We will begin with a word of prayer. I'd like to request any one of us to please lead in a word of prayer. Divya, would you be able to lead us, please? Sure, Pastor Nancy. Thank you. Thank you, Lord. Thank you, Father, for this wonderful time that you've given us, Lord. Thank you, Father, for this opportunity, Lord, to ask questions, Lord, to get, Lord, your wisdom, Father, into all the questions that we are having, Father. Thank you, Father, for the pastors. Thank you, Lord, for all those who are joining. Father, Lord, bless each one of us, Father. Let your presence be with us throughout this time. In Jesus' precious name, we pray. Amen. Amen. Thank you. Thank you, Divya. So, as we're all aware, the Mentoring Hour is a great time for us to ask questions. These questions can be pertaining to the things that we are learning in the course, or they can be questions outside of the course. It can be questions from daily life. So, if there are any questions, then please do post it on the chat, or you could please unmute your mics and go ahead and ask these questions. So, even as we wait for people to share their questions here, I just thought I would ask what different ones of us are learning in our journey with the Lord. So, if there's something new that you're learning, it would be great if you can share it with all of us. So, this time is open. Anyone who would like to share what you're learning from God's Word. Okay, once again, I think I will ask Divya. Divya, is there anything new that you're learning in this season? Actually, in my reading of the Bible, I was getting more into each words, trying to understand the meaning of the words in a deeper way. So, I think it's not like a peripheral kind of reading that I'm doing. So, the Bible College has helped me to have interest in that way, to really understand. And, currently I'm reading. Yeah, one thing that really strikes me was in Hosea. I was reading Hosea, and one thing was like, without the lack of knowledge, the people perish, that particular verse. That strikes me a lot, because if I stop learning and understanding more of God, and trying to have a deeper relationship, then I feel like our growth will be stunted. Because we do not, that relationship with God is so important. And I really loved, in the course, Developing the Human Spirit, Abbas Rajesh had told us about seven disciplines that we can use for our growth. Like Communion and reading the Word, Praying. Yeah, yeah. So, yeah, it's helping me in my personal spiritual growth. Wow, yeah, that's really wonderful Divya, and thank you so much for sharing it with us. I'm excited to know that your course, your study here at APC Bible College is also helping you in your journey with the Lord. So, yeah, thanks once again. At this moment, I want to ask all of us once again, if you have any questions, if you have, then please do go ahead and post on the chat, or maybe ask by unmuting your mics. Yes. So, actually, I have a question. I don't know if it's a very, you know, it's a question that has an answer already, but I thought I would just pose it for us here. So that in the current scenario, some of the things are happening in the world. So I was just asking myself this question, you know, how do you understand the things that are unfolding? Currently, we have a situation that is happening between two particular countries.  How do we understand the events that are taking place currently? Yeah. Thank you. Okay. Yes. I'll just share some thoughts and others can also share. So, thank you. So we're seeing Russia invade Ukraine. And we're seeing just one other European country, Belarus, who's kind of feel just aligning themselves with Russia. And then of course we're also seeing some other countries that are non-committal like China, India. Who are not, you know, they're just taking, trying to take a neutral stand, especially China. So, and then of course we're seeing how, you know, a lot of the European Union, the countries in the European Union as well as North America and who are, you know, coming together in a very, very united way to counteract what Russia is doing. So I think all of this is very interesting, especially when you look at what will be played out in Bible times, sorry, in the end times, as given to us in Scripture. When we, especially when you look at the buildup towards Armageddon, the final war, we know that, you know, the scriptures to reveal to us that, and this is in Revelation 16, that towards, you know, the end of the seven year tribulation, the nations of the earth will be, will move against or towards Israel as a nation. And that's the buildup of the war towards Armageddon. And, you know, and if you just see how all of that plays out, how the Antichrist comes into power and how he actually unfolds that. And you look at what Daniel Rebelle, he talks about 10 leaders coming out of the former Roman Empire, which largely is the area, you know, that covers the European Union as well as other parts. 10 leaders coming there and then one leader coming out who will then subdue three others. You know, and I'm not saying Putin is an Antichrist, but I'm just saying you can see that kind of dynamic already happening how Putin has in some way subdued the president of Belarus, meaning he's just having him like a puppet. So very much like that, the Antichrist would subdue three of these 10 leaders, they will just fall in place with him. And they will give him, you know, the means to come into power and the Antichrist and then his all out attack is against Israel. And now here, today we are seeing Putin just going against Ukraine, the Ukrainians, for whatever reason. But, you know, you see so much of that in the Antichrist going out against Israel. And then we see Ezekiel 38-39 shows how Russia would move from the north against Israel. It'll have its allies, including Persia, which is modern day Iran, Turkey. Today Turkey is somewhat opposing Russia, but maybe Turkey will come into alignment with Russia according to Ezekiel 38 later on. We see Turkey, we see parts of Germany. We see all those nations mentioned there in Ezekiel 38 that fall into alignment with Russia as it moves in towards Israel. As Revelation 16, 9 and 10 talks about the armies of the east, which most likely would be, you know, big nations in the east of Israel are obviously Russia and China. So they're moving in towards Israel. So we see all of the, you know, what's playing out today in some ways like a miniature version of the Battle of Armageddon. So, you know, just the dynamics between nations, the alignment of nations, you know, towards a foreign against each other. All of that is very interesting to see as we see, you know, as we see things given to us in the Bible in Daniel, Ezekiel, Revelation. So from that perspective, I think it's just interesting to observe. Of course, what is happening is not nice, but it is interesting to see these things. Thank you, Pastor. Thank you so much for helping us understand what is going on right now through the eyes of Scripture. We have some questions here on our chat. These questions are from Herbert. So Herbert asks some, some people say the first day of the week is Sunday, whereas others say it's Monday. And I think some others say Saturday. Who are most correct? So that is Herbert's first question. So maybe we'll take up this question and then I'll go ahead and read Herbert's next question. So which is the week's first day? Who is correct? So that is his question. Would one of our faculty like to answer this question? Pastor Paul, any, any insights, thoughts on this question? Hi, Pastor. I'm not really sure about this. Sorry. All right. All right. Yes. Thank you so much. So then I'll just leave it open to any of our faculty to please take this. Pastor, would you? Yeah, but so if you want to go biblically, biblically, Sunday is also referred to as the first day of the week. That's the resurrection day. And so in the New Testament, Sunday is referred to as the first day of the week. So that's biblically. Also, if you look at it from a calendar standpoint, we know all our calendars start with Sunday, Sunday to Saturday. So from a calendar practical standpoint, Sunday is also the first day of the week. So now, of course, Monday is considered the first day of the work week. So it depends if somebody is talking about the work week, then obviously they're referring to Monday in most parts of the world.  So their work week may start on a different day, either Saturday or Sunday. That just depends on their part of the world. But generally speaking, if you want to look at biblically, biblically, the first day of the week is Sunday. If you look at it from a calendar perspective, the first day of the week is Sunday, or the first day of the work week is Monday. So that's fine. Thank you, Pasta. Thank you, Herbert. The next question that Herbert has here for us is, Ash Wednesday, is it when Jesus went in wilderness for 40 days? So Ash Wednesday, like how does that come about? Is it correlated to the fasting that Jesus took, he went into the wilderness for 40 days? Pasta, would you please like to answer this question as well? I don't know too much about Ash Wednesday. Yeah, I think the Ash Wednesday is actually 46 days before Easter Sunday. But when you don't count the Sundays, so it's a 40 day season and it's basically represents Christ's time of temptation in the wilderness. So these 40 days is, you know, people just spend time with repentance, fasting, and just focusing on Christ's finished work, what he's done, you know, just kind of time of personal growth, time of personal reflection, one's own life, taking time out to just, you know, look into their own lives, just spend time with the Lord.   So it just symbolizes that, yeah. So it's a time when the church will celebrate or take time off to just focus and, you know, time of repentance, fasting, and focusing on the Lord. Yeah, thank you. Thank you so much, Pastor Selina, for sharing. Thank you, Pastor. Yeah, thank you for also asking these questions. We'll go further. If, you know, any others have things that you would like to ask, then please do. Yes, Divya, I see that you've raised your hand. Please go ahead. Thank you. Thank you, Pastor Nancy. My question is from Hebrews chapter 9, which I'll just, it's talking about the tabernacle and how the lampstand, the table, showbread, all these are arranged. And in verse 4, it talks about the altar of incense and the Ark of the Covenant within the most holy place. In Hebrews 9 verse 4, I'll just read the verse 4, which had the golden censor and the Ark of the Covenant overlaid on all sides with gold. Yeah, and it just keeps telling about those things in the most, in the tabernacle sanctuary. Right, so my question is, like, when we read the Old Testament, we get to see that the altar of incense is outside the most holy place. Like, it is in front of the veil, but here in Hebrews chapter 9, it is mentioned that it is within the most holy place. So I had a question, why is it, has the author deliberately mentioned that way? Is there any importance? Thank you. Yes, thank you, Divya. Thank you so much for that question. So, Divya is asking about the position of the altar of incense, whether it is in the holy place or, you know, the most holy place. So why has the writer of the Hebrews included it here in the most holy place? Any of our faculty would like to answer that? The golden altar of incense, it stood at the veil before the holy of holies. So that is where it was placed. It was placed at the, you know, just stood at the veil before the holy of holies. I think in the, in the holy of holies was just the Ark of the Covenant. So if you look at various translations, I don't know which translation she's read. Maybe we can see various translations and see. This is NKJV. But this, the golden altar of incense is just placed at the, it stood at the veil before the holy of holies. It was used to burn incense. And I don't think it's, you know, in the holy of holies because the high priest would go only just once a year to make the atoning sacrifice for the sins of the whole is the right race. So, and he would make a sacrifice for himself first before he goes in. So, yeah, yeah, that's right. That's right. In Hebrews 9.4, it is not very clearly mentioned, at least in my version here in NKJV. It seems as though it has been mentioned. It is within the most holy place. Yes, you're right. Because even in the NIV, it says that behind the second curtain was a room called the most holy place which had the altar of incense. So, but actually it was placed there. Okay, I'm just, you know, I'm just guessing. Okay. This is not a, I wouldn't call this a Bible answer. So what I mean, what we are pointed out in this very good observation is that in the tabernacle of Moses, in the inner court, we had the table of the showbread, the altar of incense and the candlestick. And then in the most holy place that is behind the second curtain, there was just the Ark of the Covenant that was in the tabernacle of Moses. Whereas in Hebrews 9, as Divya is pointing out, you can see very clearly the right of Hebrews is talking about the altar of incense as being behind the second veil, which obviously means the most holy place. So, it seems to be a little contradiction because we know in the tabernacle of Moses, the instructions God gave him, the altar of incense was actually not in the most holy place, but it was in the inner court. So, whereas here he's positioning the golden sense as being in the most holy place. So, I don't know, you know, what the writer of Hebrews, why he was doing, I mean, why this discrepancy. But what I would like to say, I'm just taking a guess here, I'm not saying this is the right answer. But what we know is when Moses was instructed to build the sanctuary, he was instructed to build a copy of what was already there in the heavens. So that means the heavenly tabernacle was already in place. That means the way God had set up the heavenly, his throne room and his place or ship in the heavens was already there. And Moses was supposed to make a copy of that. So, and this is my part that when God gave the instructions to him, he intentionally positioned the altar of incense outside the most holy place. He placed it in the inner court and say, you put it there because everything has a meaning. It's telling us that, you know, this is how you do it, and it has a meaning.  And I think actually multiple times a week into the inner court where he would, you know, trim, and that the candle stands, of course, gave light to what he was doing. He would replace the showbread and he would work on the altar of incense, make sure that the fire kept on burning. So it was something that he would do on an ongoing basis, telling us that these things, which is eating of the bread, when the showbread and the altar of incense is something that's always ongoing, you keep on doing it. But the high priest would only go into the most holy place once a year, right, by the Ark of the Covenant was. He would go there only once a year. Whereas this, the inner court where he would be doing these things was happening every week, not every day, but every week. Now he was engaging and there's something that is an ongoing thing. Whereas things have changed in the New Testament. For the New Testament believer, these three partitions no longer exist in the sense that we know that Christ has rented the veil. He's opened away and so everything has changed. And the New Testament believer can learn from the Old Testament tabernacle as giving some meaning. But the New Testament believer is encouraged to come boldly. We have the Hebrew stand in the next chapter. He says, we have boldness to enter into the holiest by the blood of Jesus. Meaning is like, hey, there's no more of these partitions and divisions. And unlike the Old Testament, they had only certain times where they can go into the most holy place. The New Testament believer just walks right in. So there's no longer is of any importance. And yet to the New Testament believer in Hebrew stand, he's saying, he's kind of drawing similarities. He says, wash your conscience, sprinkle your conscience from dead works, which is what they would do in the outer court when they would use the wash basin to wash themselves. So everything has changed. There are these partitions to no longer exist, which means that in heaven. Those partitions are not of any importance. Hebrews 5 says our hope goes right into the veil. So it means, you know, it's no longer there. Hebrews 10 is saying we come right into the holiest, most holy place.  You enter in with a pure heart. So he's drawing some similarities. So I think, and this is only my guess that the reason Hebrews 9 is not really very specific. It's not really paying attention to where the altar, the golden sense of which is the ultimate sense, which represents the prayer of the saints, which we, you know, we see in Revelation 5. It's not so important anymore is because these partitions no longer exist, although we engage in the spiritual type of spiritual ministry that these things represent. So it is the believers always involved in what the ultra friends and symbolizes, which is the prayer of the saints. The believers always involved in what the wash basin represents, which is cleansing his heart of dead works. The believers always involved in the praise and altar, which is a sacrifice. He offers his body as a living sacrifice. He and he also offers up spiritual sacrifices. The believer is always involved in the table, the showbird, which represents the word of God, he partakes of the word of God. And the believer always is always in the most holy place, which is in a very presence of God, the very throne room of God, where the art, which is the other government. So for a believer, he's always engaging in all of these. So where these things are located really doesn't matter. And so the reason he was nine is positioning the golden sensor in the most holy places because the believers always involved in it. And it no longer matters to us. So that's why this is my guess. I'm not saying that we can prove it from scripture. But you know, when we look at Hebrews 5, 9, 10, where they talk about how the believer engages with the heavenly sanctuary. There is no longer these clear, clear set demarcations of out of court in a court most holy place. So that's why I think the altar of incense or the golden sensor is placed in the behind the wheel, because we enter there behind the wheel. This is my guess. You can take it or leave it. It's free. Sure. Buster. Thank you. Thank you. I was also thinking, is it also because the wheel has been torn? No. Yes. So for the believer, yeah, there's no more demarcation. There's no way it's been torn. You understand. Thank you. Thank you. Thank you. Thank you. Thank you for the question. Thank you, Buster, for explaining it so well to us. John Paul has a question. He says, can a believer invest in cryptocurrency? Okay, so anyone who is familiar with cryptocurrency, one of the faculty, if you could kindly answer John's question here. John, this is just my personal opinion. Again, this is not chapter inverse. This is not viable. So basically, you know, if you just go back to the very basic ideas, why do we invest? We invest to make our money grow. That means you're letting money do its work. You know, you make that money multiply money, and that's what it does. So whatever it was, we keep your money in the bank. Yeah, they may give you one, one or 2% in interest in a regular account. But you know, the reason they give interest is they're saying your money can grow if you keep it here. If you move to a fixed deposit, they say, okay, yeah, your money can make 5% to 6% interest if you keep it for a certain period of time. So again, they're encouraging money to grow, money is doing its own work without you doing any work. And that's another form of investment. If you put it into the stock market, the mutual funds there, they promise, you know, anywhere between 9% to 12%, 15%, 17%. And sometimes they may crazy people may say 30%, which usually never happens. But so again, there's an incentive there that is your money can grow by multiplying itself. If you invest, of course, there's all risk. There are different kinds of funds and the risk involved in different things. So they just saying, you know, if you if you are willing to take risk, well, you may get a higher return. It may multiply the higher rate, but it's a higher risk. So similarly, why do you buy property, why do you buy land? It's again, an investment that you put money into buy a property. And then the value of the property increases.  So basically you're making money grow by letting money do its work. So every form of investment, whether you know, these things are under nowadays, there are so many other kinds of investments that are available. For instance, you can invest in commercial properties. And so, so many, so many kinds you can invest in in gold or, you know, precious metals or you can whatever so many different kinds of investments that are available today. So the answer cryptocurrency, the name sounds bad crypto, but it simply is another form of investment that another place where you could put money and expect money to grow. And because of that, maybe the last five, maybe 10, maybe more recently five years, because it seems to be, you know, you could get high returns, so on so forth. It's become a place of interest. So the answer question is it's entirely up to the believer where he or she wants to invest money. Basically, where do you want to put your money so that you can make your money grow. You can keep it in a regular bank account for one or two percent. You could move it in a fixed deposit for five or six percent. You could move it into the mutual funds for 11 or 12 percent or 15 percent. You could move it into bonds. You know, you're going at a different rate. All of these options are there. It's entirely up to you where you want to invest your money, depending on the risk and so on.  He said to one, he gave 10, 5, and 1. He told them to go and invest. I mean, he didn't use the word invest, but he told them to go and engage, you know, occupy till I come, multiply this, engage in the financial system and multiply what I've given you. So, you know, we could see that, that the Lord is interested in us. And for the one person who came back and said, Lord, I didn't do anything. He said, at least you should put my money in the bank.  So, from the Lord's side, from God's side, yeah, he wants us to be good stewards with the finances. But where you invest is entirely up to, you know, the individual. And the only thing we should avoid is doing something that's wrong, unethical, illegal. But there's nothing, you know, necessarily wrong, unethical, with cryptocurrency, except that it is deregulated. It's not regulated by governments as opposed to the other forms of investment. So there's a higher risk. It's like a free market. There's nothing wrong with free market. People are just trying to create something that's open and accessible for everybody. So that's a huge difference. It's unregulated, whereas other forms of investment are regulated by governments. So there's a higher risk here, but they talk about higher returns. So the answer to your question is, you know, you're free to do whatever you feel. Okay. Sorry for that long lecture. Thank you, Pastor, and thank you, John. I think your question is answered. I can see your comment here on that. So we'll continue. We have, we still have some time. So if there are more questions, then please do ask them and our faculty is here to answer them for us. Pastor Nancy, did we raise the hand up? Yes. Okay. Is that a new question that you have? Thank you, Pastor Ina. No, sorry. I think it's my hand raised. Yeah, it is raised. Oh, sorry. No problem. Any other questions? Anything that's anything about, you know, personal lives, I walk with the Lord or anything that's going on around us. Yes, yes. Ami has a question for us. Ami, okay, she's posted on the chat. She says, Pastor, can you explain? Colossians 2, 17 through 23, focusing on verse 18 and then verse 23. Does it have anything to do with the length season? Okay. I'll quickly get this passage for us. Please give me a moment. Just looking it up. Okay. For some reason I'm stuck with the amplified version. It doesn't seem to change. So I'll just post it in the same version here. So that's versus 17 through 19, 23 from Colossians chapter 2. So this passage says such things are only a shadow of what is to come and they have only symbolic value, but the substance, the reality of what is foreshadowed belongs to Christ. Let no one defraud you of your price, your freedom in Christ and your salvation by insisting on more humility and the worship of angels going into detail about visions, the claims. He has seen to justify his authority, poked up in concede by his unspiritual mind and not holding fast to the head of the body, Jesus Christ, from whom the entire body supplied and lit together by its joints and ligaments grows with the growth that can come only from God. If you have died with Christ to the elementary principles of the world, why as if you were still living in the world, do you submit to rules and regulations such as do not handle this, do not taste that, do not even touch. These things all perish with use in accordance with the commandments and teachings of men. These practices indeed have the appearance that popularly passes as that of wisdom in self-made religion and more humility and severe treatment of the body, but ascitism, but are of no value against sinful indulgence because they do not honour God. So Ami, your question with regard to, you said more specifically was 18 and 23. Okay, so basically what Ami is trying to say is that Mama, I just wanted to know, this is what we see in the length season. They abstain from eating certain foods. They go into repentance for a season and all this. Is it commanded in the Bible or because this passage, if you see it says that, I forgot to mention 16th verse, it says do not, so let no one judge you in food or in drink or regarding a festival or new moon or sabbaths. It starts with there and then it goes on to say that they are shadow of things to come. So I just wanted to know if there is any connection of length season with this passage or this is separate and length is a separate thing. So just wanted to know that. Okay. Yes, thank you Ami. So basically what Ami is asking is now that we have freedom in Christ Jesus, Paul is letting the collusion believers know that they must not get, they must not lose that freedom by entangling themselves in certain practices which are not really necessary for salvation. And also he goes on to explain the way he talks about certain practices that people held, but they again in no way really are required in our worship to God. So that is Ami's question and she asks whether the length, the practice of length is something that this passage is talking about. So if one of our faculty would like to answer Pasasalina, would you have any thoughts on this? Actually in verse 16 Paul is saying here that much of the ceremonies of the law of Moses consisted in distinction of meat and days. And it appears that those who keep those distinction, you know, it's not necessary now because crisis come, he's cancelled all the ceremonial law and we don't have to keep it. So Paul is writing and saying that that man not imposed these things upon you because God has not imposed them and that the life that is centered on Jesus and what he did on the cross has no place for legalism, you know, whether it's food, drink or special days or festivals. So that is what he's basically trying to tell them here and about the angels. There was this false teaching that was happening at the church at Colosse when they felt that being humble was a way of humility was actually, you know, worshiping of angels. But Paul is saying that it's not the worship of angels but worshiping Jesus and what he has completed on the cross. When it comes to thinking about, I mean, looking at this context and, you know, what it has to do with Lent. Yes, we don't have to celebrate this Lenten season but actually the church does, I think because it is a time when, you know, we can get people's attention to focus on the cross and what Jesus has basically done on the cross. So when Paul is writing in to the church at Colosse, he's saying don't have, celebrate these special days and, you know, and about how to fast and, you know, observance of food and other rituals and the kind of meat that you have to eat which is accordance to the law of Moses. But, you know, focus on what Christ has done in the finished work of the cross. So I think what the church is really doing during this Lenten season is, you know, they are focusing on the cross and what Jesus has done. So on various topics around the cross and drawing people's attention. So it's a good time of learning for people, especially the traditional church where topics like sanctification, redemption, justification is not taught or people don't know. It's a much detailed study that they do during these, the Ash Venice days and during the season of Lent. And also for people to give up certain things and, you know, just focus on the cross and what Jesus has done is also, in a way, a good thing because some of us also go into, you know, some people take a 20-day fast, 30-day fast or 40-day fast for themselves, just to seek the Lord, just to wait upon the Lord. And so in one way, yes, it's a good thing. But if you look at it in this context of what Paul is saying and to the church at Colosseis, don't, you know, hold on to the mosaic rituals. Like even Paul writes to the church at Ephesus, you know, because the, the Judaizers, those who are Jews, who are becoming Christians were bringing in this whole rituals, Old Testament rituals, Jewish fables, myths that they were teaching that were becoming, you know, like a false teaching that was happening. Also about, you know, a circumcision, they were saying that those who believe in Jesus, all of the Gentile believers have to be circumcised and it was, and Paul was saying, it is not necessary. So in that way, yes, there are certain rituals which we don't have to follow of the Old Testament law. But if you look at it, even what God had given them regarding food and all, it is basically for our own health, for our well-being, for our wholeness, the kind of meat we need to eat, the kind of food we need to eat. So we focus on those, you know, nutritional kind of aspects and we can still follow those mosaic laws.  So it's a good time that we could see that in a positive way what Lent can do in the life of the church and the life of believers. Yes, yes, thank you so much. Thank you. I hope I answered. Sorry, Pastor Nancy, I hope I answered any question if anyone else wants to add in, they can add. Yeah, Avni, is that all right? I hope you got your answer. Yes, I think I got it. Thank you. Yes, thank you. Thank you Pastor Selena and thank you Avni. We have another question here, because we don't have time. I think we would need to take this up in the next mentoring hour, which is next Thursday. So Paul, if you don't mind, you know, we will take up this question in the next mentoring hour. Is it right for married couples to have their conjugal rights when they are fasting? So we will begin with this question next week. Let's pray and close right now. I would like to request someone to please go ahead and pray, please. Pastor Selena, would you? Yeah. Father, we thank you for this day. We thank you, God, that we can learn so much from your word. Thank you for your word. That is true. That the truth sets us free. Thank you for the revelations that we receive from your word. Thank you Holy Spirit for teaching us, for guiding us. We just commit the rest of this day into your hands. We pray and thank you for each of our students. We bless them in your name, Father. We pray for your grace and your wisdom to be imparted even as they learn and even as they study. We pray for all of us as faculties, God, that you would enable us, strengthen us, give us your wisdom so that we can teach and use your word effectively, God, to minister to the lives of people that we are ministering to. We thank you for hearing our prayer. We give you all the glory and honor and praise. In Jesus' name we pray. Amen. Thank you. Thank you, Pastor Selena. Thank you, all faculty and students for joining in this morning's mentoring hour. God bless you. Have a wonderful day and we will meet again tomorrow for the supernatural hour at 8 a.m. So please do join in. Thank you and bye for now.


Felly, hi allwn. Felly, rydyn ni'n dweud i'r Bwbwr. Felly, rydyn ni'n dweud i'r Llorys CIC. Felly, rydyn ni'n dweud i'r open source hardware, rysfi dylai'r ddweud, ac rydyn ni'n dweud i'r effort a dweud i'r rysfi yn ystrym LVM. Felly, byddwyd yn y torw'r gweithiau, rydyn ni'n dweud i'r... Dwi'n dweud yn ymwyng y rei iawn, felly rydyn ni'n dweud i'r lle'r cyfrifiadau some preliminaries, a little bit of insight into what it actually means to pour to compiler like LLVM to RIS5. Then I'll talk a bit about how I've gone about the task, some design decisions, and then pick off a few topics which I felt were maybe representative of the sort of design decisions and tasks that we've been taking on in this effort. I'll of course give a bit of a summary of current status and then an idea of where we're heading in the future. Yeah, I can drive. So first of all, what is LLVM? LLVM is a popular compiler infrastructure. It has a permissive licence just in the last couple of weeks changed to Apache from a BSD style licence. It has a library based design, which many people find useful with my integrated into our projects. And it's often used and paired with the clang language front end, which is the equivalent of GCC in terms of giving C and C++ support. And as we'll touch on later, there's a number of other languages, languages which have used it as their back end, most notably Rust, which I know is one reason why a lot of the distro people are particularly interested in the status of LLVM RIS5 cogeneration and Swift, Julia and other such languages. And so LLVM provides a sort of common infrastructure, a common set of passes, analyses, optimisations, transformations in order to provide to implement basically a whole suite of compilation related tasks. So there's the LLVM and its co-generator, but it's also a family of projects, including Linker, Debugger, C++ runtime. So compiler RT, the equivalent of the low level of LibGCC library, and a growing suite of projects as people upstream contribute new things. OpenMP implementations, sickle coming from Intel soon. And so why are people interested in LLVM? Why am I interested in LLVM for RIS5? I think there are a number of reasons. I think first of all, we should make completely clear that GCC for RIS5 is in fantastic shape. People have been using it to compile a whole bunch of things. So if you just want a working compiler, GCC is there, it's ready to go right now, well supported. There are a range of pre-compiled versions available, people upstreaming and increasingly cross-compiled tool chains upstreamed into distro repositories. But there are a number of people who prefer LLVM either for licensing reasons or because they rely on it as the back end for programme language. So Rust is perhaps the most notable example and I'll be hearing later it's becoming a dependency for any modern distro right now with Lib RSVG and other libraries being ported. I think another LLVM's also had very good uptake in academia research and R&D. One of the reasons is that it's actually very easy to modify and add support for custom extensions. There's a very active developer community and we could argue back and forth about GCC of this LLVM but certainly there's a locus of interest around it for new and interesting compiler analyses and transformations. So I'm just going to give a little bit of a brief overview of what a clang LLVM compilation flow looks like, which we'll use to talk about the tasks that you take on when porting something like LLVM to support new architecture. So it of course has your C input, so in the case of LLVM clang you put this through your C front end and when porting it to an architecture to be honest there's very little you need to do to the clang front end. You need to add support for the set of command line options which get passed through to the back end. Teach it a little bit about the target architecture so it can provide appropriate diagnostics but beyond that it's an order of a few hundred lines. So we have our C input, this gets, eventually we get through to miss gets passed, we get the clang AST and that will eventually spit out LLVM IR which probably most of you have seen in some form at least once. So unlike GCC this is exposed to the end user or people who want to feed it in as inputs to LLVM so people can actually pass that using other tools if you wanted to do your own stuff in practice most people implement their own extensions to LLVM using the library based extension mechanism. So as you see we've lowered the C types in a fairly trivial way, into 32t becomes LLVM's IR type I32 and LLVM IR has its own set of instructions and semantics and one sort of con misconception is that it's some sort of universal IR in the sense that well assembly or other projects are trying to be. So once you've got to LLVM IR you've actually already made a number of target specific assumptions which you need to do in order to meet the CABI and maintain the semantics of your input. So once you have the LLVM IR the next step from that is then putting that through the compiler middle end and eventually this goes through a process which spits out what's called a selection dag and we're not going to go into details of that because it's not particularly relevant to what I'm talking about today but the point is everything that's going on on the LLVM IR level that's mostly target independent and shared so it's all the same code for ARH64, x86, power and so on whereas once you get to this step you've done all of your target independent transformations and analyses this is where the porting effort comes in. So you're able to make use of a whole set of libraries and helper functions but the task is essentially to take this selection dag and to lower it to our final form which is the outputted assembly or ELF object. So in this case it's all very trivial because ultimately we have a single IR instruction, the add which gets lowered to a little bit of extra junk in order to handle the function arguments from return as well as the main meat of it, this selection dag add node which is triggerly then lowered to the add instruction. So that's given a bit of a sort of high level overview of the sort of things that you take on while porting something like LLVM. So this includes, so LLVM CR4 a number of years now includes an integrated assembler so that's a fairly relatively straightforward task of just supporting the RIS5 assembler for syntax. We start looking at defining, so you've implied your assembler and that's actually where I started with the RIS5 LLVM port as to provide a solid base on which to build everything on top of. The next task you want to take on is doing something like defining the instructions so which instructions does the architecture support and how they encoded. So I'll just show a slightly verbose example over the next few slides but you don't need to study the whole thing and also step through the rest of these examples actually. So this is the exploded definition of a single instruction in LLVM and of course you don't need to write this when defining your new target. This is using its domain specific language called tablegen so this is specifying that we have a RIS5 instruction and add the assembler syntax looks like this at the bottom and we have a whole bunch of encoding so actually I've highlighted on the next slide these are the lines that are relevant to encoding the instruction for the target architecture and these are the lines which are relevant for the assembly parser which is actually mostly generated for you and for specifying the inputs and outputs of the instruction. But of course this is verbose painful if you had to write that for every instruction it would become rather tiresome and not particularly easy to maintain. So you start adding in sort of classes which are a feature of the tablegen DSL which means that ultimately you can specify instructions using a fairly straightforward form such as this which defines all the register register instructions in the base RIS5 ISA. So that's enough in order to provide if you have enough support code around it that's enough to generate the assembly parser and to actually produce object code from that but we also want to handle the more common case which is when you have LVMIR input from Clang, Rust, Julia or whatever else and you want to work out how to convert that to RIS5 instructions. And so that involves both writing C++ logic for more complicated cases but in a simple case such as an ad you just write these patterns. So these are just sort of, so these are patterns on nodes of a selection dag so it's just a directly cyclic graph specifying that if you have an ad node which looks like this convert it to a RIS5 instruction which looks like this. And I mean from a high level that's basically what it involves going through each of the instructions supporting that, implementing patterns in this way and then most of the fiddly work is kind of around the edges it's ensuring that the stack frame to set up properly that the ABI's maintained that various corner cases come up which are handled properly. Of course with RIS5 we have, it isn't just a single target and although over time other architectures have also gained a whole range of different features and different options, I think RIS5 is, they don't tend to be exercised simultaneously so essentially we have free base ISA definitions so rv32i, rv32e which is when you have only 16 registers or rv64i but then you have the question of do you support the multiply, atomics, single precision floating point, double precision floating point, the compressed extension and maths will find that's fairly straightforward it's quite every architecture x86 adds new extensions with every Intel chip released but there's also a whole range of ABI's attached to that so whether it's the, which is specified in terms of xlen so whether it's rv32 or rv64 and then indicating whether so just ILP32 would mean that is essentially the soft flow ABI ILP32f is single precision, hard float for single precision which means that your floating point arguments are passed by registers and similarly for ILP32d and LP64d and so on and the way that the RIS5 ABI is defined it's actually pretty easy to handle these with a single function which is parameterised by the supported floating point length and the supported and the general purpose register length but in terms of testing you can see that once you start multiplying all these options there's quite a lot to cover there and there's more to come as people are introducing new custom and standard extensions and introducing new custom or standard ABI's so the report of RIS5LVM back in the early days of RIS5 just when it was making its way out of Berkeley there was a GCC port which some of Berkeley students had developed and there was an initial LVM port and ultimately I actually went and waited around a bit to see what was happening I'd previously been working on a LVM port for a research architecture at Cambridge a large number of very simple in-order cores but with its own ISA so I'd kind of got quite up to speed on LVM back end development through that and I think we'd found that the initial RIS5LVM port although people had managed to do some useful things with it it was quite some way away from being ready for being committed upstream so I sort of started a fresh effort trying to work in a very step by step taking a very step by step methodical approach ensuring that everything was well tested, unit tested and to the extent that I was able to document it and I guess over the past 18 months or so I've been able to get a bit of funding which has helped to increase the time I can spend on this I'll say more about status a little bit later but there's now this started as a downstream project but with the intent of getting it upstream very quickly LVM has a pre-commit review policy which in the early days it took quite a while to actually get things up there but that's sort of sped up substantially now that there are more people interested I'm the upstream code owner so that things got much easier in that respect so at this point there are I guess the sort of high level view of the current status is that it's not there yet for hard float on Linux targets while I'm targeting the next LVM release for that but there are I know multiple companies who are using it internally for their firmware builds on their embedded 32-bit targets quite successfully occasionally working around various limitations but finding it's doing what they need so I think I've covered that so in RISV as you might know there's a compressed extension and how that works is so in the standard RISV instructions the RV32i, RV64i every instruction is 32 bits if you support the compressed extension then for a subset of those instructions you're actually able to encode them in just 16 bits so this is not dissimilar to thumb 2 or various other compressed instruction set designs except that you're able to freely intermix them and we actually had a fair bit of discussion about how to handle this in the compiler and there are a number of decision to design choices that were considered and one of the questions we had to answer quite early on was whether the instruction selector would be aware of the compressed instruction set because of course if you have a 16-bit instruction for an ad it doesn't have the same it has various restrictions on it such as you have to have the whether restricted subset of registers that you're able to access whether restricted immediate field and so there's one approach would be to try and teach the instruction selector about all of these instructions and have that produce it and we actually ended up doing something very similar to what GCC in the GNU assembler does which is to actually handle it basically exclusively as a very very late stage conversion so you go all the way through register allocation through the instruction selector, through register allocation actually generate the in-memory representation of the machine instructions and then we put it through a converter which just is basically a table based system that looks and sees and says for this ad instruction can I convert it to a compressed ad instruction for this load instruction can I do the same and the advantage of this is that it quite substantially simplifies the logic throughout the rest of the back end because I mentioned that we have those long list of instruction patterns and that's pretty straightforward but there's a whole bunch of other target specific analyses such as looking at analyzing control flow and branching and it becomes somewhat tedious if you have to ensure that all of that recognises both the uncompressed form and the compressed form and of course it's an area where you can start to introduce errors but I think that's the starting point rather than the end point so we have it so that and it's not completely naive in that the retro allocator is aware of the fact that some registers are able to be accessed from compressed instructions so they would be chosen in preference to registers which can never be accessed from the compressed instructions and I've gone a bit around in terms of how much to go into detail on the RIS5 merry model support so I'll try and keep it somewhat accessible it turned out to actually be a larger body of work than I was anticipating so as you may know if you've been following RIS5 over the past few years one of the early and probably most successful standardization efforts in the RIS5 foundation was coming to conclusion on what the RIS5 merry model should be so the initial specification it had various things to say about the merry model some researchers at Princeton and others pointed out that actually like most merry models for most architectures there were various things which were somewhat questionable and they quite successfully managed to get a whole group of academics practitioners and industry together and come to an agreement on the merry model which ended up being a sort of very relaxed merry model not dissimilar to ARCH64 and so what do you need to do to support that in the compiler and it's actually the basics of it is relatively straightforward because I have that with the C11 and C++11 merry model there are a number of primitives such as atomic add, atomic subtract, atomic load each with different memory ordering specified by the programmer and all I really need to do is understand each of those so this is a compare and exchange that would have been lowered from the C++11 atomic compare and exchange and then I simply have to convert that to whatever the merry model people tell me is correct and then in theory you're done but it's actually a little bit more fiddly than that so in RIS5 supports it has two sets of atomic instructions so you have the AMOs for the atomic memory operations so atomic add, atomic subtract, atomic all atomic XOR and that's relatively straightforward to support but then there's more general instructions so load reserved and store conditional so if you want to do something a little bit more complicated than just load a value, add it and atomically write that back again then you rely on these primitives so load reserved reads a value and it sets a reservation and the granularity of that reservation is dependent on a micro architecture but let's say it reserves that cache line and then you do some computation based on that and then later you do a store conditional and if somebody else wrote that cache line in the meantime then your store conditional will fail and then your program code if it wants to be correct should then loop back and try again and keep trying and it's this looping again and keeping trying which can be problematic because you want to ensure that this loop will actually terminate at some point and so the RIS5 the RIS5 ISA manual specifies various restrictions on what code can be placed between the load reserved and the store conditional in order to ensure what it calls the architectural forward progress guarantee and the restrictions are pretty simple it just means that you can't have the main thing you can't have are spills or loads of stores from main memory or jumps or floating point instructions and that sort of thing but the difficulty is that the compiler doesn't actually have an easy way of reasoning about that a reasoning about the fact that say for this IR construct once I start to decompose it to RIS5 instructions but before it's done various other analyses of transformations it's not actually possible to specify that this region should be left alone and there shouldn't be any spills and that sort of thing so it's actually a problem which other architectures face and I ended up sort of implementing a new whole set of different hooks for atomic lowering which currently RIS5 is the only user of but I'm hoping that AR64 an arm will move over and essentially the approach is to lower to a to basically treat something like compare exchange as a black box when you lower it so we see this compare exchange we lower to a we load something which is a little bit still very abstracted so it's basically a we know it's a RIS5 compare exchange but it's not converted to RIS5 instructions until a very very late stage after all the other register allocations have been taken place and things like that which ensures that there's absolutely no way that unexpected spills are stacked and that sort of thing are introduced and although in practice say the other backends have managed to avoid this by having a slightly different code path or when you're targeting O0 there's it's still a sort of theoretical concern but I think it's worth addressing so in terms of testing and fuzzing there's been I guess there's a few approaches we take so most of it has been done through unit testing so targeted tests written against the LVM has a whole infrastructure for this based on giving input IR and then writing effectively regular expressions on the output to ensure that the assembly that you expected came out the other end there's been an increasing effort to start to test with of course real world programmes multiple people are compiling spec with Clang and RIS5 and there's some great work last year from some interns at Qualcomm on ffuzzing and this was targeted on the assembly parser so specifying a grammar for RIS5 instructions and then trying to generate a whole bunch of different inputs and seeing how it differs between GCC and the LVM assembler so that was using there's some related work for doing something similar with C so that was inspired by I think there's work some Google's done on A so you specify to specify to specify your grammar and then using LVM's ffuzzing library you're able to instantiate that with with legal and illegal values so one of the another challenge on the compiler side or I guess another task is supporting linker relaxation so if you have so LVM has fairly small immediate sizes so if you have access to a and of course it has fixed instruction length on like x86 so with x86 if you if you want to access global you can stick the whole address there if you wanted to whereas with RIS5 you'd lower it to say a couple of instructions so you're to say lowering the other loading the other 20 bits and then say loading with a 12 bit offset but linker relaxation is when you sort of you allow the linker to look at all of these instruction pairs and then decide and find those cases where actually you didn't need the other 20 bits because it is within range of the say the 12 bits offset and then delete the original the first instruction and this is and if you'd use that approach you have to ensure that the linker knows that the linker has access to to every to every fix-up or relocation in the program which basically means every access to a symbol because all of the instructions could be moved or changed I think so supporting RIS5's ABI as I mentioned one of the challenges is that there are a lot of them the helpful thing is that they're actually basically all very similar and that they are the contractualisation of the supported floating point register length and the general purpose register length so LVM is actually structured so that a lot of the a lot of responsibility for supporting the ABI is done in the front end so this is something I've been talking to some of the people who have been porting Rust about they also have the responsibility of capturing cases where you need to effectively is a problem of say I have a function which takes a unsigned integer and a signed integer how do I convert that to LVMIR which maintains those semantics and that's mostly done for us in Clang but this is work which also has to be repeated for Julia, for Swift and Rust and other languages so one thing I did with this was I've implanted a Python library which aims to be a RIS5 calling convention initially I called it the calling convention goal a model it's now called ABI cop so this is a sort of tool which helps to test that the ABI is conformant to at least my interpretation of the RIS5 ABI specifications there's more work to be done there in terms of randomised testing so it does a fairly naive it has a fairly naive approach of doing randomised instantiations of function pairs and then you can take take your caller compile that with GCC, take your callee compile that with Clang and hopefully you get the result you expect but there's definitely more that can be done there so moving on to status and where we're at I think the first thing I'd like to highlight is that this started out as a project where I was the primary author and it's expanded over time now so we're at the point where we have full external contributors, I'm very grateful to contributions from companies like Qualcomm, Embercosm Andy's Tech and others who've added support for features like working on the compressed instruction sets more recently TLS from Embercosm and a whole series of assemblifix and other things from Andy's Tech and I think we're starting to see as the L of the M backend nears the point where you're able to do things like compile Linux kernel and Linux user space there's a growing number of people who are interested in starting to attribute upstream it's also been something I've tried to encourage through giving tutorials and that sort of things I'll mention, I'll give a link at the end of the talk, I gave a tutorial at the L of the M dev meeting at the end of last year which gives a sort of introduction to hacking on L of the M and hacking on the RIS5 backend in particular so where we're at with L of the M as I mentioned there are multiple companies who are using it internally for their first two bit firmware builds but there are still a few limitations so the TLS support is in review queue and will hopefully soon be upstreamed so that's a thread local storage things like position independent code remains to be implemented and upstreamed and the so the hard float ABIs, which are the ABIs that you want to use on Linux aren't implemented yet so the main block of that had been the 64 bit floating point cogen that has actually merged in the last few days so imminently now will be pushing forward on the hard float ABI support which people want to compile modern Linux applications there is a Rust port and an active community around that targeting the baseline RB32i so the RB32iM whatever extensions you want to add to it so that's now that all the 64 bit stuff they need is upstream they're now looking at porting that 64 bit as well LLD I should have mentioned also that's another thing which I have other contributors to thank for so Andy's Tech did some work on adding support to S5 to the LVM linker and it's so it's there, it works, it's somewhat early days so it doesn't support some of the features that I mentioned like linker relaxation yet that requires a bit more design work but all the basic relocation to support it and you can use it if you want to but you can just use the canoe linker so it will be moving forwards with work on the hard float ABIs that's probably priority number one right now other work which has been going on is on the RIS5 Vector Extension so I won't go into much detail about this this has basically been led by Robin Croop who is a student at TU Damstatt if you've been following the RIS5 Vector Extension discussions it's it's an interesting compiler target like arms like arms SVE Vector Instruction Set one of the basic design decisions is that your vectors are a are a compile time unknown length which is dependent on the micro architecture and so there's quite a few interesting challenges about how to support that and there's been actually work from Robin and some of the other people working on vectorisation LVM working on how to support that for RIS5, SVE and other vector architectures which take a similar approach now there's I think there's a talk later which will be looking at comparing code size on RIS5 vs other architectures just comparing RIS5, LVM and Clang vs GCC there's more that can be done to improve code compression first to meet GCC and then hopefully to move beyond that so I mentioned that the select that targeting the compressed instruction set is there's very little interaction with the instruction selection stage so it's not quite unaware of the fact that you're generating compressed instructions but there's still not much of feedback loop there and there's definitely more you can do so specifically teaching the register allocator about the compressibility of instructions so let's say that I have a series of instructions all of which use the same virtual register so I know that it has a that they want to use the same value but it hasn't yet gone through the register allocator if the register allocator is able to dynamically wait the choice of the registers it can make a more sensible choice because if you know that one of the instructions could never be compressed anyway then there's not much point in using one of the registers which is compressible you'd be better off saving that for a case where you can actually improve code size there's also I mean one thing we've noticed comparing GCC and Clang is that GCC's Clang's ordering a basic block reordering a basic block can be quite aggressive so what it's trying to do is to ensure that based on either profile data or static estimations ensure that the common case or the hot path is sort of linear in memory which is great for for cache effects and performance and so on but if you're trying to minimise code size that's not always what you want because it means that your branch offsets tend to be larger and so you tend to end up not being able to compress all your branches and so tweaking this or adding ways of opting out that behaviour is starting to be further explored so I'm particularly interested in talking to anybody who's been working on different language front-ends for LVM so I've had there is a Haskell LVM backend as well so I know they did a little bit of initial work but I don't think there's been much activity there so I think Rust has been most active I haven't actually heard anything from a Julia or Swift community but if you know people in that community who are interested then please put them in touch it would also be good actually to work together more on the ABI lowering and validation around that so as you know RIS5 has a sort of set of standard instruction set extensions which are defined right now but there's also an ambition to extend that set the RIS5 vector extension was one example of this there's also active work on defining new instructions bit manipulation and so I'm quite keen to work with that working group to provide support for the compiler before it's standardised in order to provide feedback in terms of how difficult it is to support compilation to that extension and getting statistics on how often you can actually select these instructions so I'll hopefully be something we move forward on in the next couple of months I've suggested that it would be worth the proposed extension if they could just pick and encode if it's not final so at least those of us who are doing those sorts of experiments can cross check our tooling to ensure that the assembler is working in the same way and that sort of thing and there's more stuff coming in terms of RIS5 standards there's been talk about supporting floating point registers supporting floating point instructions on values held in general purpose registers of new APIs for embedded targets so APIs where long double isn't 128 bit float and other changes and so this will of course lead to continuing work in the future and there's more to do in terms of support for target independent LVM features that we'd benefit from so I mentioned code size and the machine there is a very promising feature that's been pursued more recently with ARC64 so effectively this is the opposite to inlining so with inlining you see that a function is used and that you don't actually need to have the external function call you can copy it into your function without lining you look and you find common code sequences and because you're trying to optimise code size you decide well actually I could pull this code sequence out to a separate function that's less expensive in code size just have a call to it and so it's obviously not positive for performance but useful for people who are really trying to cram their code into a small matter space and we're actually working on further testing on more real world applications I guess in the last couple of months it's mostly been people who are using it on their own code bases and they've been feeding back upstream when things work and we're moving towards being taking a more structured approach to I guess proactively testing on real world programmes and benchmarks and on the 32 bit side Zephyr, Friartos and moving towards Linux and FreeBSD on the 64 bits side and I guess a more automated comparison to other tool chains and I guess other targets as well in terms of code size like comparing RIS5 versus ARM so I guess I'm getting towards the end of the talk that is roughly the end of it I should say that low risk is hiring we have about five positions open we're ramping up a lot more work in order to deliver free and open source hardware and software so if you're interested have a look and talk to me or Luis or Philip afterwards if you want to get started hacking on LLVM I put together this tutorial at the LLVM dev meeting last year which a lot of people found helpful if you have problems with it let me know and at that point I'll see if there are any questions thank you If I remember correctly well from a couple of years ago when it was hacking LLVM the IR is not completely changed Correct, yeah So if I want to repeat the question Yes, thank you for that So the question was that actually move on to the question and I'll repeat the whole thing So the LLVM IR is not completely machine independent and so if I'm going to write a frontend for LLVM for a different language how much work do I have to put into supporting all the different variants of risk 5 especially 32 and 64 bit variants So the question was given that LLVM IR isn't actually fully target independent how much work is there in order to support a new frontend in order to support the ABI So it's something that we talked about in the LLVM community back and forth for a while because it seems unpleasant that people need to do this for each new frontend language and potentially get it wrong So it depends on the ABI that you're targeting So in the case of risk 5 you actually do need to understand that given your function signature you actually do need to go through and count the registers and determine whether this value is going to be passed on the stack or not because it affects whether you need to add the sign extension or zero extension annotations and things like that So it's hard to quantify how much work there is in that I guess writing something not that hard testing it and ensuring that it works more work and I hope that's an area where more of us who are working on that can collaborate because the testing problem is basically the same one approach is the approach I mentioned of doing separate compilation and compiling the caller and callee under different compilers or perhaps extending the ABI cop tool so that it does a very simple form of code generation in order to provide I suppose more of a even more of a golden model right now it just spits out a text description of what you're expecting but I'd be interested in talking more for anybody looking at doing that Anyone else? So typically they they've standardised on LVM and Clang for whatever reason throughout the company they have toolchain teams who'll support that and so it mostly stems from that Thank you very much